public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: H Hartley Sweeten <hartleys@visionengravers.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net/sunrpc/svc.c: fix sparse warning
Date: Thu, 14 May 2009 12:00:30 -0400	[thread overview]
Message-ID: <20090514160030.GA5675@fieldses.org> (raw)
In-Reply-To: <BD79186B4FD85F4B8E60E381CAEE19090179A55B@mi8nycmail19.Mi8.com>

On Thu, May 14, 2009 at 11:58:37AM -0400, H Hartley Sweeten wrote:
> On Monday, May 11, 2009 4:06 PM, J. Bruce Fields wrote:
> > On Thu, Apr 16, 2009 at 03:15:17PM -0400, H Hartley Sweeten wrote:
> >> On Thursday, April 16, 2009 12:06 PM, J. Bruce Fields wrote:
> >>> On Wed, Apr 15, 2009 at 03:46:13PM -0400, H Hartley Sweeten wrote:
> >>>> Fix sparse warning in net/sunrpc/svc.c.
> >>>> 
> >>>> 	warning: symbol 'node' shadows an earlier one
> >>>
> >>> What's the other symbol?
> >>
> >> Sorry. Left that out...
> >> 
> >> include/linux/nodemask.h
> >> 
> >> #define any_online_node(mask)			\
> >> ({						\
> >> 	int node;				\
> >> 	for_each_node_mask(node, (mask))	\
> >> 		if (node_online(node))		\
> >> 			break;			\
> >> 	node;					\
> >> })
> >> 
> >> arch/powerpc/mm/numa.c is the only other user of that macro. In that
> >> file the local variable is called nid, hence the name change in this
> >> patch.
> >
> > Stupid question (and sorry for the delay): any reason that macro
> > couldn't just be a static inline function?
> >
> > I'm sort of resistant to the idea that the caller should have to care
> > what local variable names the implementation uses.
> 
> That would probably be cleaner and it would prevent the same warning
> from possibly occurring in the future.  I just assumed it was originally
> made a macro for a good reason.
> 
> Should I submit an updated patch changing the macro into an static
> inline function?

I'd be for it.  If nothing else that'll probably be the fastest way to
find out if there was a good reason!

--b.

  reply	other threads:[~2009-05-14 16:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-15 19:46 [PATCH] net/sunrpc/svc.c: fix sparse warning H Hartley Sweeten
2009-04-15 20:49 ` Jesper Juhl
2009-04-15 22:27   ` H Hartley Sweeten
2009-04-16 19:06 ` J. Bruce Fields
2009-04-16 19:15   ` H Hartley Sweeten
2009-05-11 23:05     ` J. Bruce Fields
2009-05-14 15:58       ` H Hartley Sweeten
2009-05-14 16:00         ` J. Bruce Fields [this message]
2009-05-14 17:25           ` H Hartley Sweeten
2009-05-14 19:02             ` J. Bruce Fields

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=20090514160030.GA5675@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=hartleys@visionengravers.com \
    --cc=linux-kernel@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