net/tg3: simplify conditional
Subsystems (2)
PATCH 1/1 net/tg3: simplify conditional
Simplify: ((a && !b) || (!a && b)) => (a != b)
Signed-off-by Nicolas Kaiser <[email protected]>
--- drivers/net/tg3.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/net/tg3.c +1 -2
@@ -9967,8 +9967,7 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparamif (!(phydev->supported & SUPPORTED_Pause) || (!(phydev->supported & SUPPORTED_Asym_Pause) && - ((epause->rx_pause && !epause->tx_pause) || - (!epause->rx_pause && epause->tx_pause)))) + (epause->rx_pause != epause->tx_pause)))return -EINVAL ; tp->link_config.flowctrl =0 ;
Signature · 1 line
1.7.2.2
Quoted 12 lines · Nicolas Kaiser
Simplify: ((a && !b) || (!a && b)) => (a != b)
Signed-off-by Nicolas Kaiser <[email protected]>--- drivers/net/tg3.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)drivers/net/tg3.c +0
-0
drivers/net/tg3.c static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam · line 9973
Quoted 9 lines
drivers/net/tg3.c +1
-2@@ -9967,8 +9967,7 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparamif (!(phydev->supported & SUPPORTED_Pause) || (!(phydev->supported & SUPPORTED_Asym_Pause) && - ((epause->rx_pause && !epause->tx_pause) || - (!epause->rx_pause && epause->tx_pause)))) + (epause->rx_pause != epause->tx_pause)))return -EINVAL ; tp->link_config.flowctrl =0 ;
Looks good to me.
From: "Matt Carlson" <[email protected]>
Date: Fri, 8 Oct 2010 10:43:12 -0700
Quoted 4 lines · Nicolas Kaiser
Quoted 3 lines
Simplify: ((a && !b) || (!a && b)) => (a != b)
Signed-off-by Nicolas Kaiser <[email protected]>
...
Quoted 1 line
Looks good to me.
Applied.
Matt, you can give an "Acked-by: " tag to indicate your approval of a patch in the future :-)
Thanks.