* [PATCH] net/tg3: simplify conditional
@ 2010-10-08 9:29 Nicolas Kaiser
2010-10-08 17:43 ` Matt Carlson
0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Kaiser @ 2010-10-08 9:29 UTC (permalink / raw)
To: Matt Carlson; +Cc: Michael Chan, netdev, linux-kernel
Simplify: ((a && !b) || (!a && b)) => (a != b)
Signed-off-by: Nicolas Kaiser <nikai@nikai.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;
--
1.7.2.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net/tg3: simplify conditional
2010-10-08 9:29 [PATCH] net/tg3: simplify conditional Nicolas Kaiser
@ 2010-10-08 17:43 ` Matt Carlson
2010-10-09 16:23 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Matt Carlson @ 2010-10-08 17:43 UTC (permalink / raw)
To: Nicolas Kaiser
Cc: Matthew Carlson, Michael Chan, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
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@nikai.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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net/tg3: simplify conditional
2010-10-08 17:43 ` Matt Carlson
@ 2010-10-09 16:23 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2010-10-09 16:23 UTC (permalink / raw)
To: mcarlson; +Cc: nikai, mchan, netdev, linux-kernel
From: "Matt Carlson" <mcarlson@broadcom.com>
Date: Fri, 8 Oct 2010 10:43:12 -0700
> 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@nikai.net>
...
> Looks good to me.
Applied.
Matt, you can give an "Acked-by: " tag to indicate your approval
of a patch in the future :-)
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-10-09 16:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-08 9:29 [PATCH] net/tg3: simplify conditional Nicolas Kaiser
2010-10-08 17:43 ` Matt Carlson
2010-10-09 16:23 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).