summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bonding.h
diff options
context:
space:
mode:
authorVeaceslav Falico <vfalico@gmail.com>2014-05-15 21:39:57 +0200
committerDavid S. Miller <davem@davemloft.net>2014-05-16 16:34:32 -0400
commitb6adc610f183061bd607d965857870e618d229a6 (patch)
tree6f4f597f0fec36063bf7ed66144f711de5d9e697 /drivers/net/bonding/bonding.h
parent2807a9feb2393648f4db114fdf3fa99860ff6a36 (diff)
downloadlinux-stable-b6adc610f183061bd607d965857870e618d229a6.tar.gz
linux-stable-b6adc610f183061bd607d965857870e618d229a6.tar.bz2
linux-stable-b6adc610f183061bd607d965857870e618d229a6.zip
bonding: convert IS_UP(slave->dev) to inline function
Also, remove the IFF_UP verification cause we can't be netif_running() with being also IFF_UP. 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>
Diffstat (limited to 'drivers/net/bonding/bonding.h')
-rw-r--r--drivers/net/bonding/bonding.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index ac75b0fbf768..6a5393b52ae0 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -40,11 +40,6 @@
#define BOND_DEFAULT_MIIMON 100
-#define IS_UP(dev) \
- ((((dev)->flags & IFF_UP) == IFF_UP) && \
- netif_running(dev) && \
- netif_carrier_ok(dev))
-
/*
* Checks whether slave is ready for transmit.
*/
@@ -297,6 +292,11 @@ static inline bool bond_uses_primary(struct bonding *bond)
return bond_mode_uses_primary(BOND_MODE(bond));
}
+static inline bool bond_slave_is_up(struct slave *slave)
+{
+ return netif_running(slave->dev) && netif_carrier_ok(slave->dev);
+}
+
static inline void bond_set_active_slave(struct slave *slave)
{
if (slave->backup) {
@@ -487,7 +487,7 @@ static inline __be32 bond_confirm_addr(struct net_device *dev, __be32 dst, __be3
static inline bool slave_can_tx(struct slave *slave)
{
- if (IS_UP(slave->dev) && slave->link == BOND_LINK_UP &&
+ if (bond_slave_is_up(slave) && slave->link == BOND_LINK_UP &&
bond_is_active_slave(slave))
return true;
else