]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm: fix build warning for uninitialized value
authorDavid Rientjes <rientjes@google.com>
Fri, 9 Nov 2012 03:03:41 +0000 (14:03 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 12 Nov 2012 03:57:35 +0000 (14:57 +1100)
commit89179211376f4a10a80989f1626e769e9615dfec
treea8d3c184ef1dd2cee12b473ffc6ef1a502e5974f
parent3551ff7529fd601cbcaa84015ca320b8c1797cb1
mm: fix build warning for uninitialized value

do_wp_page() sets mmun_called if mmun_start and mmun_end were initialized
and, if so, may call mmu_notifier_invalidate_range_end() with these
values.  This doesn't prevent gcc from emitting a build warning though:

mm/memory.c: In function `do_wp_page':
mm/memory.c:2530: warning: `mmun_start' may be used uninitialized in this function
mm/memory.c:2531: warning: `mmun_end' may be used uninitialized in this function

It's much easier to initialize the variables to impossible values and do a
simple comparison to determine if they were initialized to remove the bool
entirely.

Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory.c