From: Xiubo Li Date: Thu, 9 Oct 2014 22:28:21 +0000 (-0700) Subject: mm/compaction.c: fix warning of 'flags' may be used uninitialized X-Git-Tag: firefly_0821_release~176^2~3099^2~58 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b8b2d8253236331c3b26189f34e73f2af89ca982;p=firefly-linux-kernel-4.4.55.git mm/compaction.c: fix warning of 'flags' may be used uninitialized C mm/compaction.o mm/compaction.c: In function isolate_freepages_block: mm/compaction.c:364:37: warning: flags may be used uninitialized in this function [-Wmaybe-uninitialized] && compact_unlock_should_abort(&cc->zone->lock, flags, ^ Signed-off-by: Xiubo Li Cc: Vlastimil Babka Cc: Mel Gorman Cc: David Rientjes Cc: Minchan Kim Cc: Arnd Bergmann Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/compaction.c b/mm/compaction.c index 15163b4b35ab..b9972c0fd917 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -344,7 +344,7 @@ static unsigned long isolate_freepages_block(struct compact_control *cc, { int nr_scanned = 0, total_isolated = 0; struct page *cursor, *valid_page = NULL; - unsigned long flags; + unsigned long flags = 0; bool locked = false; unsigned long blockpfn = *start_pfn; @@ -570,7 +570,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, unsigned long nr_scanned = 0, nr_isolated = 0; struct list_head *migratelist = &cc->migratepages; struct lruvec *lruvec; - unsigned long flags; + unsigned long flags = 0; bool locked = false; struct page *page = NULL, *valid_page = NULL;