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: Mon, 11 May 2009 19:05:41 -0400 [thread overview]
Message-ID: <20090511230541.GL793@fieldses.org> (raw)
In-Reply-To: <BD79186B4FD85F4B8E60E381CAEE1909015F8F97@mi8nycmail19.Mi8.com>
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.
--b.
>
> Regards,
> Hartley
>
> >>
> >> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> >>
> >> ---
> >>
> >> diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
> >> index 8847add..e781135 100644
> >> --- a/net/sunrpc/svc.c
> >> +++ b/net/sunrpc/svc.c
> >> @@ -122,7 +122,7 @@ module_param_call(pool_mode, param_set_pool_mode,
> >> param_get_pool_mode,
> >> static int
> >> svc_pool_map_choose_mode(void)
> >> {
> >> - unsigned int node;
> >> + unsigned int nid;
> >>
> >> if (num_online_nodes() > 1) {
> >> /*
> >> @@ -132,8 +132,8 @@ svc_pool_map_choose_mode(void)
> >> return SVC_POOL_PERNODE;
> >> }
> >>
> >> - node = any_online_node(node_online_map);
> >> - if (nr_cpus_node(node) > 2) {
> >> + nid = any_online_node(node_online_map);
> >> + if (nr_cpus_node(nid) > 2) {
> >> /*
> >> * Non-trivial SMP, or CONFIG_NUMA on
> >> * non-NUMA hardware, e.g. with a generic
next prev parent reply other threads:[~2009-05-11 23:06 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 [this message]
2009-05-14 15:58 ` H Hartley Sweeten
2009-05-14 16:00 ` J. Bruce Fields
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=20090511230541.GL793@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.