All of lore.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, akpm@linux-foundation.org
Subject: Re: [PATCH] net/sunrpc/svc.c: fix sparse warning
Date: Thu, 14 May 2009 15:02:05 -0400	[thread overview]
Message-ID: <20090514190205.GA8367@fieldses.org> (raw)
In-Reply-To: <BD79186B4FD85F4B8E60E381CAEE19090179A5BE@mi8nycmail19.Mi8.com>

On Thu, May 14, 2009 at 01:25:45PM -0400, H Hartley Sweeten wrote:
> Change any_online_node() from a macro to a static inline function.
> 
> any_online_node() uses the symbol 'node', this causes a sparse
> warning in net/sunrpc/svc.c.  Changing the macro to a static
> inline function removes the sparse warning and will prevent the
> same warning from possibly occurring in the future.
> 
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>

I'm not sure where this goes--so maybe Andrew should take it?

--b.

> 
> ---
> 
> diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
> index 848025c..16df302 100644
> --- a/include/linux/nodemask.h
> +++ b/include/linux/nodemask.h
> @@ -440,15 +440,6 @@ static inline int num_node_state(enum node_states state)
>  #define node_online_map 	node_states[N_ONLINE]
>  #define node_possible_map 	node_states[N_POSSIBLE]
>  
> -#define any_online_node(mask)			\
> -({						\
> -	int node;				\
> -	for_each_node_mask(node, (mask))	\
> -		if (node_online(node))		\
> -			break;			\
> -	node;					\
> -})
> -
>  #define num_online_nodes()	num_node_state(N_ONLINE)
>  #define num_possible_nodes()	num_node_state(N_POSSIBLE)
>  #define node_online(node)	node_state((node), N_ONLINE)
> @@ -460,4 +451,15 @@ static inline int num_node_state(enum node_states state)
>  #define for_each_node(node)	   for_each_node_state(node, N_POSSIBLE)
>  #define for_each_online_node(node) for_each_node_state(node, N_ONLINE)
>  
> +static inline int any_online_node(nodemask_t mask)
> +{
> +	int node;
> +
> +	for_each_node_mask(node, mask) {
> +		if (node_online(node))
> +			break;
> +	}
> +	return node;
> +}
> +
>  #endif /* __LINUX_NODEMASK_H */ 

      reply	other threads:[~2009-05-14 19:02 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
2009-05-14 17:25           ` H Hartley Sweeten
2009-05-14 19:02             ` J. Bruce Fields [this message]

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=20090514190205.GA8367@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=akpm@linux-foundation.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.