* [PATCH] nodmask.h: remove macro any_online_node
@ 2010-01-06 23:24 H Hartley Sweeten
2010-01-06 23:51 ` KAMEZAWA Hiroyuki
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: H Hartley Sweeten @ 2010-01-06 23:24 UTC (permalink / raw)
To: Linux Kernel, linuxppc-dev, devicetree-discuss, linux-nfs, netdev
Cc: lee.schermerhorn, bfields, mel, Trond.Myklebust, miltonm, dave,
neilb, chuck.lever, paulus, Ricardo.Labiaga, rientjes, bhalevy,
akpm, davem, kamezawa.hiroyu
nodmask.h: remove macro any_online_node
The macro any_online_node is prone to producing sparse warnings
due to the local symbol 'node'. Since all the in-tree users are really
requesting the first online node (the mask argument is either
NODE_MASK_ALL or node_online_map) just use the first_online_node
macro and remove the any_online_node macro since there are no users.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: David Rientjes <rientjes@google.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Dave Hansen <dave@linux.vnet.ibm.com>
Cc: Milton Miller <miltonm@bga.com>
Cc: Nathan Fontenot <nfont@austin.ibm.com>
Cc: Geoff Levand <geoffrey.levand@am.sony.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: J. Bruce Fields <bfields@fieldses.org>
Cc: Neil Brown <neilb@suse.de>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Benny Halevy <bhalevy@panasas.com>
Cc: Chuck Lever <chuck.lever@oracle.com>
Cc: Ricardo Labiaga <Ricardo.Labiaga@netapp.com>
---
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index b037d95..64c0022 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -451,7 +451,7 @@ static int __cpuinit numa_setup_cpu(unsigned long lcpu)
nid = of_node_to_nid_single(cpu);
if (nid < 0 || !node_online(nid))
- nid = any_online_node(NODE_MASK_ALL);
+ nid = first_online_node;
out:
map_cpu_to_node(lcpu, nid);
@@ -1114,7 +1114,7 @@ int hot_add_scn_to_nid(unsigned long scn_addr)
int nid, found = 0;
if (!numa_enabled || (min_common_depth < 0))
- return any_online_node(NODE_MASK_ALL);
+ return first_online_node;
memory = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");
if (memory) {
@@ -1125,7 +1125,7 @@ int hot_add_scn_to_nid(unsigned long scn_addr)
}
if (nid < 0 || !node_online(nid))
- nid = any_online_node(NODE_MASK_ALL);
+ nid = first_online_node;
if (NODE_DATA(nid)->node_spanned_pages)
return nid;
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index 454997c..c4fa64b 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -69,8 +69,6 @@
* int node_online(node) Is some node online?
* int node_possible(node) Is some node possible?
*
- * int any_online_node(mask) First online node in mask
- *
* node_set_online(node) set bit 'node' in node_online_map
* node_set_offline(node) clear bit 'node' in node_online_map
*
@@ -467,15 +465,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)
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 538ca43..832c1fe 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -133,7 +133,7 @@ svc_pool_map_choose_mode(void)
return SVC_POOL_PERNODE;
}
- node = any_online_node(node_online_map);
+ node = first_online_node;
if (nr_cpus_node(node) > 2) {
/*
* Non-trivial SMP, or CONFIG_NUMA on
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] nodmask.h: remove macro any_online_node
2010-01-06 23:24 [PATCH] nodmask.h: remove macro any_online_node H Hartley Sweeten
@ 2010-01-06 23:51 ` KAMEZAWA Hiroyuki
2010-01-06 23:52 ` David Rientjes
2010-02-01 2:05 ` Benjamin Herrenschmidt
2 siblings, 0 replies; 4+ messages in thread
From: KAMEZAWA Hiroyuki @ 2010-01-06 23:51 UTC (permalink / raw)
To: H Hartley Sweeten
Cc: neilb, Trond.Myklebust, bfields, linuxppc-dev, paulus, rientjes,
mel, devicetree-discuss, akpm, Ricardo.Labiaga, lee.schermerhorn,
linux-nfs, netdev, Linux Kernel, miltonm, dave, chuck.lever,
bhalevy, davem
On Wed, 6 Jan 2010 16:24:58 -0700
H Hartley Sweeten <hartleys@visionengravers.com> wrote:
> nodmask.h: remove macro any_online_node
>
> The macro any_online_node is prone to producing sparse warnings
> due to the local symbol 'node'. Since all the in-tree users are really
> requesting the first online node (the mask argument is either
> NODE_MASK_ALL or node_online_map) just use the first_online_node
> macro and remove the any_online_node macro since there are no users.
>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Thank you.
BTW, it's better to add diffstat to this kind of changes.
Regards,
-Kame
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: David Rientjes <rientjes@google.com>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Cc: Mel Gorman <mel@csn.ul.ie>
> Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Dave Hansen <dave@linux.vnet.ibm.com>
> Cc: Milton Miller <miltonm@bga.com>
> Cc: Nathan Fontenot <nfont@austin.ibm.com>
> Cc: Geoff Levand <geoffrey.levand@am.sony.com>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: J. Bruce Fields <bfields@fieldses.org>
> Cc: Neil Brown <neilb@suse.de>
> Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Benny Halevy <bhalevy@panasas.com>
> Cc: Chuck Lever <chuck.lever@oracle.com>
> Cc: Ricardo Labiaga <Ricardo.Labiaga@netapp.com>
>
> ---
>
> diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
> index b037d95..64c0022 100644
> --- a/arch/powerpc/mm/numa.c
> +++ b/arch/powerpc/mm/numa.c
> @@ -451,7 +451,7 @@ static int __cpuinit numa_setup_cpu(unsigned long lcpu)
> nid = of_node_to_nid_single(cpu);
>
> if (nid < 0 || !node_online(nid))
> - nid = any_online_node(NODE_MASK_ALL);
> + nid = first_online_node;
> out:
> map_cpu_to_node(lcpu, nid);
>
> @@ -1114,7 +1114,7 @@ int hot_add_scn_to_nid(unsigned long scn_addr)
> int nid, found = 0;
>
> if (!numa_enabled || (min_common_depth < 0))
> - return any_online_node(NODE_MASK_ALL);
> + return first_online_node;
>
> memory = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");
> if (memory) {
> @@ -1125,7 +1125,7 @@ int hot_add_scn_to_nid(unsigned long scn_addr)
> }
>
> if (nid < 0 || !node_online(nid))
> - nid = any_online_node(NODE_MASK_ALL);
> + nid = first_online_node;
>
> if (NODE_DATA(nid)->node_spanned_pages)
> return nid;
> diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
> index 454997c..c4fa64b 100644
> --- a/include/linux/nodemask.h
> +++ b/include/linux/nodemask.h
> @@ -69,8 +69,6 @@
> * int node_online(node) Is some node online?
> * int node_possible(node) Is some node possible?
> *
> - * int any_online_node(mask) First online node in mask
> - *
> * node_set_online(node) set bit 'node' in node_online_map
> * node_set_offline(node) clear bit 'node' in node_online_map
> *
> @@ -467,15 +465,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)
> diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
> index 538ca43..832c1fe 100644
> --- a/net/sunrpc/svc.c
> +++ b/net/sunrpc/svc.c
> @@ -133,7 +133,7 @@ svc_pool_map_choose_mode(void)
> return SVC_POOL_PERNODE;
> }
>
> - node = any_online_node(node_online_map);
> + node = first_online_node;
> if (nr_cpus_node(node) > 2) {
> /*
> * Non-trivial SMP, or CONFIG_NUMA on
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nodmask.h: remove macro any_online_node
2010-01-06 23:24 [PATCH] nodmask.h: remove macro any_online_node H Hartley Sweeten
2010-01-06 23:51 ` KAMEZAWA Hiroyuki
@ 2010-01-06 23:52 ` David Rientjes
2010-02-01 2:05 ` Benjamin Herrenschmidt
2 siblings, 0 replies; 4+ messages in thread
From: David Rientjes @ 2010-01-06 23:52 UTC (permalink / raw)
To: H Hartley Sweeten
Cc: neilb, Trond.Myklebust, bfields, linuxppc-dev, paulus,
Ricardo.Labiaga, mel, devicetree-discuss, akpm, kamezawa.hiroyu,
lee.schermerhorn, linux-nfs, netdev, Linux Kernel, miltonm, dave,
chuck.lever, bhalevy, davem
On Wed, 6 Jan 2010, H Hartley Sweeten wrote:
> nodmask.h: remove macro any_online_node
>
> The macro any_online_node is prone to producing sparse warnings
> due to the local symbol 'node'. Since all the in-tree users are really
> requesting the first online node (the mask argument is either
> NODE_MASK_ALL or node_online_map) just use the first_online_node
> macro and remove the any_online_node macro since there are no users.
>
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: David Rientjes <rientjes@google.com>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Cc: Mel Gorman <mel@csn.ul.ie>
> Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Dave Hansen <dave@linux.vnet.ibm.com>
> Cc: Milton Miller <miltonm@bga.com>
> Cc: Nathan Fontenot <nfont@austin.ibm.com>
> Cc: Geoff Levand <geoffrey.levand@am.sony.com>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: J. Bruce Fields <bfields@fieldses.org>
> Cc: Neil Brown <neilb@suse.de>
> Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Benny Halevy <bhalevy@panasas.com>
> Cc: Chuck Lever <chuck.lever@oracle.com>
> Cc: Ricardo Labiaga <Ricardo.Labiaga@netapp.com>
Acked-by: David Rientjes <rientjes@google.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nodmask.h: remove macro any_online_node
2010-01-06 23:24 [PATCH] nodmask.h: remove macro any_online_node H Hartley Sweeten
2010-01-06 23:51 ` KAMEZAWA Hiroyuki
2010-01-06 23:52 ` David Rientjes
@ 2010-02-01 2:05 ` Benjamin Herrenschmidt
2 siblings, 0 replies; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2010-02-01 2:05 UTC (permalink / raw)
To: H Hartley Sweeten
Cc: neilb, Trond.Myklebust, bfields, linuxppc-dev, paulus,
Ricardo.Labiaga, rientjes, mel, devicetree-discuss, akpm,
kamezawa.hiroyu, lee.schermerhorn, linux-nfs, netdev,
Linux Kernel, miltonm, dave, chuck.lever, bhalevy, davem
On Wed, 2010-01-06 at 16:24 -0700, H Hartley Sweeten wrote:
> nodmask.h: remove macro any_online_node
>
> The macro any_online_node is prone to producing sparse warnings
> due to the local symbol 'node'. Since all the in-tree users are really
> requesting the first online node (the mask argument is either
> NODE_MASK_ALL or node_online_map) just use the first_online_node
> macro and remove the any_online_node macro since there are no users.
>
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: David Rientjes <rientjes@google.com>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Cc: Mel Gorman <mel@csn.ul.ie>
> Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Dave Hansen <dave@linux.vnet.ibm.com>
> Cc: Milton Miller <miltonm@bga.com>
> Cc: Nathan Fontenot <nfont@austin.ibm.com>
> Cc: Geoff Levand <geoffrey.levand@am.sony.com>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: J. Bruce Fields <bfields@fieldses.org>
> Cc: Neil Brown <neilb@suse.de>
> Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Benny Halevy <bhalevy@panasas.com>
> Cc: Chuck Lever <chuck.lever@oracle.com>
> Cc: Ricardo Labiaga <Ricardo.Labiaga@netapp.com>
Cheers,
Ben.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-02-01 2:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-06 23:24 [PATCH] nodmask.h: remove macro any_online_node H Hartley Sweeten
2010-01-06 23:51 ` KAMEZAWA Hiroyuki
2010-01-06 23:52 ` David Rientjes
2010-02-01 2:05 ` Benjamin Herrenschmidt
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).