]> git.baikalelectronics.ru Git - kernel.git/commit
mm: fix build warning for uninitialized value
authorDavid Rientjes <rientjes@google.com>
Fri, 16 Nov 2012 22:14:48 +0000 (14:14 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 16 Nov 2012 22:33:03 +0000 (14:33 -0800)
commit51b9e8db2e34a69bb1fc6dba1e890e633e621b41
tree86a8ab12560d600fa5459218979e72827e0311f5
parent354811a0323c78f4042aec322481bcd05508b288
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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memory.c