From: "Kok, Auke" <auke-jan.h.kok@intel.com>
To: Roel Kluin <12o3l@tiscali.nl>
Cc: netdev@vger.kernel.org, Jeff Garzik <jgarzik@pobox.com>
Subject: Re: [PATCH 1] net: fix and typo's
Date: Fri, 26 Oct 2007 10:51:46 -0700 [thread overview]
Message-ID: <47222932.80408@intel.com> (raw)
In-Reply-To: <47221EBE.3070109@tiscali.nl>
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@tiscali.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.)
next prev parent reply other threads:[~2007-10-26 17:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-26 17:07 [PATCH 1] net: fix and typo's Roel Kluin
2007-10-26 17:51 ` Kok, Auke [this message]
2007-10-26 19:54 ` Roel Kluin
2007-10-26 20:06 ` Kok, Auke
2007-10-26 18:25 ` Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47222932.80408@intel.com \
--to=auke-jan.h.kok@intel.com \
--cc=12o3l@tiscali.nl \
--cc=jgarzik@pobox.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).