Re: [PATCH] MM: Fix NR_SECTION_ROOTS == 0 when using usingsparsemem extreme.

From: Atsushi Nemoto
Date: Wed May 19 2010 - 12:44:59 EST

On Wed, 5 May 2010 18:02:46 -0300, Marcelo Roberto Jimenez <mroberto@xxxxxxxxxxxxxxxxxxxxx> wrote:
> 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.

JFYI, This fix is not just silence the warning, fix 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.
Thank you.

Atsushi Nemoto
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at