From: Marcelo Roberto Jimenez Date: Mon, 24 May 2010 21:32:47 +0000 (-0700) Subject: mm: fix NR_SECTION_ROOTS == 0 when using using sparsemem extreme. X-Git-Tag: v2.6.35-rc1~356 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0faa56389c793cda7f967117415717bbab24fe4e;p=pandora-kernel.git 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. Atsushi Nemoto observed: : This fix doesn't just silence the warning - it fixes a real problem. : : Without this fix, mem_section[] might have 0 size so mem_section[0] : will share other variable area. For example, I got: : : c030c700 b __warned.16478 : c030c700 B mem_section : c030c701 b __warned.16483 : : This might cause very strange behavior. Your patch actually fixes it. Signed-off-by: Marcelo Roberto Jimenez Cc: Atsushi Nemoto Cc: KOSAKI Motohiro Cc: Christoph Lameter Cc: Mel Gorman Cc: Minchan Kim Cc: Yinghai Lu Cc: Sergei Shtylyov Cc: Russell King Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed