[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Wed, 5 May 2010 18:02:46 -0300
From: Marcelo Roberto Jimenez <mroberto@...i.cetuc.puc-rio.br>
To: mroberto@...i.cetuc.puc-rio.br,
Andrew Morton <akpm@...ux-foundation.org>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Christoph Lameter <cl@...ux-foundation.org>,
Mel Gorman <mel@....ul.ie>,
Minchan Kim <minchan.kim@...il.com>,
Russell King - ARM Linux <linux@....linux.org.uk>,
Stephen Rothwell <sfr@...b.auug.org.au>,
"H. Peter Anvin" <hpa@...or.com>, Yinghai Lu <yinghai@...nel.org>,
Sergei Shtylyov <sshtylyov@...sta.com>
Cc: linux@....linux.org.uk, linux-kernel@...r.kernel.org,
linux-mm@...ck.org
Subject: [PATCH] MM: Fix NR_SECTION_ROOTS == 0 when using using sparsemem extreme.
Got this while compiling for ARM/SA1100:
mm/sparse.c: In function '__section_nr':
mm/sparse.c:135: warning: 'root' is used uninitialized in this function
This patch follows Russell King's suggestion for a new calculation for
NR_SECTION_ROOTS. Thanks also to Sergei Shtylyov for pointing out the
existence of the macro DIV_ROUND_UP.
Signed-off-by: Marcelo Roberto Jimenez <mroberto@...i.cetuc.puc-rio.br>
---
include/linux/mmzone.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index cf9e458..e90ad64 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -972,7 +972,7 @@ struct mem_section {
#endif
#define SECTION_NR_TO_ROOT(sec) ((sec) / SECTIONS_PER_ROOT)
-#define NR_SECTION_ROOTS (NR_MEM_SECTIONS / SECTIONS_PER_ROOT)
+#define NR_SECTION_ROOTS DIV_ROUND_UP(NR_MEM_SECTIONS, SECTIONS_PER_ROOT)
#define SECTION_ROOT_MASK (SECTIONS_PER_ROOT - 1)
#ifdef CONFIG_SPARSEMEM_EXTREME
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists