bonding: make BOND_NO_USES_ARP an inline function
authorVeaceslav Falico <vfalico@gmail.com>
Thu, 15 May 2014 19:39:53 +0000 (21:39 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 May 2014 20:34:32 +0000 (16:34 -0400)
Also, change its name to better reflect its scope, and skip the "no"
part.

CC: Jay Vosburgh <j.vosburgh@gmail.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_main.c
drivers/net/bonding/bond_options.c
drivers/net/bonding/bonding.h

index 5c88c11a3ddd022e6a664497f149099cf870df17..2448e28f38bc1bb487fd7f87aac71542bfb989bc 100644 (file)
@@ -4113,7 +4113,7 @@ static int bond_check_params(struct bond_params *params)
        }
 
        /* reset values for 802.3ad/TLB/ALB */
-       if (BOND_NO_USES_ARP(bond_mode)) {
+       if (!bond_mode_uses_arp(bond_mode)) {
                if (!miimon) {
                        pr_warn("Warning: miimon must be specified, otherwise bonding will not detect link failure, speed and duplex which are essential for 802.3ad operation\n");
                        pr_warn("Forcing miimon to 100msec\n");
index 6dc49da106d6fae818efd618b19c020c63dd9bd4..98c8801ddb67f9b8ad5cfb14d23f9dab6d9a26e9 100644 (file)
@@ -672,7 +672,7 @@ const struct bond_option *bond_opt_get(unsigned int option)
 
 int bond_option_mode_set(struct bonding *bond, const struct bond_opt_value *newval)
 {
-       if (BOND_NO_USES_ARP(newval->value) && bond->params.arp_interval) {
+       if (!bond_mode_uses_arp(newval->value) && bond->params.arp_interval) {
                pr_info("%s: %s mode is incompatible with arp monitoring, start mii monitoring\n",
                        bond->dev->name, newval->string);
                /* disable arp monitoring */
index dca3dfdf42d3f46a33ff0ab17fdc544eca50a569..105c552f96d82eb2b06ec8e5f11cc82c1c93c2e6 100644 (file)
                 ((mode) == BOND_MODE_TLB)          ||  \
                 ((mode) == BOND_MODE_ALB))
 
-#define BOND_NO_USES_ARP(mode)                         \
-               (((mode) == BOND_MODE_8023AD)   ||      \
-                ((mode) == BOND_MODE_TLB)      ||      \
-                ((mode) == BOND_MODE_ALB))
-
 #define IS_IP_TARGET_UNUSABLE_ADDRESS(a)       \
        ((htonl(INADDR_BROADCAST) == a) ||      \
         ipv4_is_zeronet(a))
@@ -292,6 +287,12 @@ static inline bool bond_is_lb(const struct bonding *bond)
               bond->params.mode == BOND_MODE_ALB;
 }
 
+static inline bool bond_mode_uses_arp(int mode)
+{
+       return mode != BOND_MODE_8023AD && mode != BOND_MODE_TLB &&
+              mode != BOND_MODE_ALB;
+}
+
 static inline void bond_set_active_slave(struct slave *slave)
 {
        if (slave->backup) {