Re: [PATCH] net/tg3: simplify conditional

From: Matt Carlson
Date: Fri Oct 08 2010 - 13:43:57 EST


On Fri, Oct 08, 2010 at 02:29:27AM -0700, Nicolas Kaiser wrote:
> Simplify: ((a && !b) || (!a && b)) => (a != b)
>
> Signed-off-by: Nicolas Kaiser <nikai@xxxxxxxxx>
> ---
> drivers/net/tg3.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
> index 16e1a95..714f0fb 100644
> --- a/drivers/net/tg3.c
> +++ b/drivers/net/tg3.c
> @@ -9967,8 +9967,7 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam
>
> if (!(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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/