[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47222932.80408@intel.com>
Date: Fri, 26 Oct 2007 10:51:46 -0700
From: "Kok, Auke" <auke-jan.h.kok@...el.com>
To: Roel Kluin <12o3l@...cali.nl>
CC: netdev@...r.kernel.org, Jeff Garzik <jgarzik@...ox.com>
Subject: Re: [PATCH 1] net: fix and typo's
Roel Kluin wrote:
> A few patches with changes to net code. I have sent these to the lkml
> previously, but they were not yet merged. I am fairly new to kernel
> programming, so it is possible that I make some mistakes. I'll explain my
> rationale, please nack if incorrect, an additional bit of explanation is
> appreciated even more.
>
> The condition '!x & y,' does make little sense: the '!' has a higher
> priority than '&'. It behaves therefore like '!x && y'. In the case
> bitanding flags, however, '!(x & y)' appears to be desired.
>
> Warning: the change of '!x & y,' to '!(x & y)' may change behavior. if
> not desired, I propose changing this to '!x && y', to make it explicitly
> clear.
>
> These '&' typo's can be spotted with:
> a="A-Za-z0-9_"
> git-grep "\![^$a()]*[$a]\+\([$a.]*\|->\)*\(\[[$a.]*\]\)\?[ \W]*&[^&]\+"
>
> --
> Fix priority mistakes similar to '!x & y'
>
> Signed-off-by: Roel Kluin <12o3l@...cali.nl>
> ---
> diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
> index cf70522..14141a5 100644
> --- a/drivers/net/e1000e/82571.c
> +++ b/drivers/net/e1000e/82571.c
> @@ -283,7 +283,7 @@ static s32 e1000_get_invariants_82571(struct e1000_adapter *adapter)
> adapter->flags &= ~FLAG_HAS_WOL;
> /* quad ports only support WoL on port A */
> if (adapter->flags & FLAG_IS_QUAD_PORT &&
> - (!adapter->flags & FLAG_IS_QUAD_PORT_A))
> + (!(adapter->flags & FLAG_IS_QUAD_PORT_A)))
> adapter->flags &= ~FLAG_HAS_WOL;
> break;
>
Ack this e1000e change here!
Auke
(PS since there was only 1 netdriver patch here and the rest is wireless, I would
have suggested splitting this patch up in two and sending them to the wireless
maintainer and netdevice maintainer separately. But I'm sure this will get picked
up anyway.)
-
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