lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101008174312.GA3562@mcarlson.broadcom.com>
Date:	Fri, 8 Oct 2010 10:43:12 -0700
From:	"Matt Carlson" <mcarlson@...adcom.com>
To:	"Nicolas Kaiser" <nikai@...ai.net>
cc:	"Matthew Carlson" <mcarlson@...adcom.com>,
	"Michael Chan" <mchan@...adcom.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] net/tg3: simplify conditional

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@...ai.net>
> ---
>  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 netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ