if (hard_iface->soft_iface != soft_iface)
                        continue;
 
-               min_mtu = min_t(int, hard_iface->net_dev->mtu - BAT_HEADER_LEN,
+               min_mtu = min_t(int,
+                               hard_iface->net_dev->mtu - BATADV_HEADER_LEN,
                                min_mtu);
        }
        rcu_read_unlock();
                    hard_iface->net_dev->name);
 
        if (atomic_read(&bat_priv->fragmentation) && hard_iface->net_dev->mtu <
-               ETH_DATA_LEN + BAT_HEADER_LEN)
+               ETH_DATA_LEN + BATADV_HEADER_LEN)
                batadv_info(hard_iface->soft_iface,
                            "The MTU of interface %s is too small (%i) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to %zi would solve the problem.\n",
                            hard_iface->net_dev->name, hard_iface->net_dev->mtu,
-                           ETH_DATA_LEN + BAT_HEADER_LEN);
+                           ETH_DATA_LEN + BATADV_HEADER_LEN);
 
        if (!atomic_read(&bat_priv->fragmentation) && hard_iface->net_dev->mtu <
-               ETH_DATA_LEN + BAT_HEADER_LEN)
+               ETH_DATA_LEN + BATADV_HEADER_LEN)
                batadv_info(hard_iface->soft_iface,
                            "The MTU of interface %s is too small (%i) to handle the transport of batman-adv packets. If you experience problems getting traffic through try increasing the MTU to %zi.\n",
                            hard_iface->net_dev->name, hard_iface->net_dev->mtu,
-                           ETH_DATA_LEN + BAT_HEADER_LEN);
+                           ETH_DATA_LEN + BATADV_HEADER_LEN);
 
        if (batadv_hardif_is_iface_up(hard_iface))
                batadv_hardif_activate_interface(hard_iface);
 
 
 #include "packet.h"
 #include "bitarray.h"
+#include <linux/kernel.h>
 
-#define BAT_HEADER_LEN (ETH_HLEN + \
-       ((sizeof(struct unicast_packet) > sizeof(struct bcast_packet) ? \
-        sizeof(struct unicast_packet) : \
-        sizeof(struct bcast_packet))))
-
+#define BATADV_HEADER_LEN \
+       (ETH_HLEN + max(sizeof(struct unicast_packet), \
+                       sizeof(struct bcast_packet)))
 
 struct hard_iface {
        struct list_head list;