From: Andrew Morton <akpm@linux-foundation.org>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [patch] fix unused setup_nr_node_ids
Date: Fri, 18 May 2007 10:53:18 -0700 [thread overview]
Message-ID: <20070518105318.ae611edc.akpm@linux-foundation.org> (raw)
In-Reply-To: <E1Hozre-0003rZ-00@dorka.pomaz.szeredi.hu>
On Fri, 18 May 2007 12:39:14 +0200
Miklos Szeredi <miklos@szeredi.hu> wrote:
> This is now the only (!) compiler warning I get in my UML build :)
>
> ----
> From: Miklos Szeredi <mszeredi@suse.cz>
>
> mm/page_alloc.c:931: warning: 'setup_nr_node_ids' defined but not used
>
> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
> ---
>
> Index: linux/mm/page_alloc.c
> ===================================================================
> --- linux.orig/mm/page_alloc.c 2007-04-26 13:07:11.000000000 +0200
> +++ linux/mm/page_alloc.c 2007-04-26 13:07:12.000000000 +0200
> @@ -914,7 +914,10 @@ static int rmqueue_bulk(struct zone *zon
> #if MAX_NUMNODES > 1
> int nr_node_ids __read_mostly = MAX_NUMNODES;
> EXPORT_SYMBOL(nr_node_ids);
> +#endif
>
> +#ifdef CONFIG_ARCH_POPULATES_NODE_MAP
> +#if MAX_NUMNODES > 1
> /*
> * Figure out the number of possible node ids.
> */
> @@ -930,6 +933,7 @@ static void __init setup_nr_node_ids(voi
> #else
> static void __init setup_nr_node_ids(void) {}
> #endif
> +#endif
>
> #ifdef CONFIG_NUMA
> /*
That doesn't do much to inprove overall readability.
I suspect the warning was only there because the stubbed version of
setup_nr_node_ids() forgot to be declared static inline, yes?
How about this?
--- a/mm/page_alloc.c~fix-unused-setup_nr_node_ids
+++ a/mm/page_alloc.c
@@ -136,6 +136,11 @@ static unsigned long __meminitdata dma_r
#endif /* CONFIG_MEMORY_HOTPLUG_RESERVE */
#endif /* CONFIG_ARCH_POPULATES_NODE_MAP */
+#if MAX_NUMNODES > 1
+int nr_node_ids __read_mostly = MAX_NUMNODES;
+EXPORT_SYMBOL(nr_node_ids);
+#endif
+
#ifdef CONFIG_DEBUG_VM
static int page_outside_zone_boundaries(struct zone *zone, struct page *page)
{
@@ -669,26 +674,6 @@ static int rmqueue_bulk(struct zone *zon
return i;
}
-#if MAX_NUMNODES > 1
-int nr_node_ids __read_mostly = MAX_NUMNODES;
-EXPORT_SYMBOL(nr_node_ids);
-
-/*
- * Figure out the number of possible node ids.
- */
-static void __init setup_nr_node_ids(void)
-{
- unsigned int node;
- unsigned int highest = 0;
-
- for_each_node_mask(node, node_possible_map)
- highest = node;
- nr_node_ids = highest + 1;
-}
-#else
-static void __init setup_nr_node_ids(void) {}
-#endif
-
#ifdef CONFIG_NUMA
/*
* Called from the vmstat counter updater to drain pagesets of this
@@ -2733,6 +2718,26 @@ void __meminit free_area_init_node(int n
}
#ifdef CONFIG_ARCH_POPULATES_NODE_MAP
+
+#if MAX_NUMNODES > 1
+/*
+ * Figure out the number of possible node ids.
+ */
+static void __init setup_nr_node_ids(void)
+{
+ unsigned int node;
+ unsigned int highest = 0;
+
+ for_each_node_mask(node, node_possible_map)
+ highest = node;
+ nr_node_ids = highest + 1;
+}
+#else
+static inline void setup_nr_node_ids(void)
+{
+}
+#endif
+
/**
* add_active_range - Register a range of PFNs backed by physical memory
* @nid: The node ID the range resides on
_
next prev parent reply other threads:[~2007-05-18 17:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-18 10:39 [patch] fix unused setup_nr_node_ids Miklos Szeredi
2007-05-18 17:53 ` Andrew Morton [this message]
2007-05-18 18:30 ` Miklos Szeredi
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=20070518105318.ae611edc.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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.