Commit ae026b2a authored by Mel Gorman's avatar Mel Gorman Committed by Linus Torvalds
Browse files

mm, meminit: suppress unused memory variable warning

The kbuild test robot reported the following

  tree:   git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
  head:   14a6f198
  commit: 3b242c66 x86: mm: enable deferred struct page initialisation on x86-64
  date:   3 days ago
  config: x86_64-randconfig-x006-201527 (attached as .config)
  reproduce:
    git checkout 3b242c66


    # save the attached .config to linux build tree
    make ARCH=x86_64

  All warnings (new ones prefixed by >>):

     mm/page_alloc.c: In function 'early_page_uninitialised':
  >> mm/page_alloc.c:247:6: warning: unused variable 'nid' [-Wunused-variable]
       int nid = early_pfn_to_nid(pfn);

It's due to the NODE_DATA macro ignoring the nid parameter on !NUMA
configurations.  This patch avoids the warning by not declaring nid.
Signed-off-by: default avatarMel Gorman <mgorman@suse.de>
Reported-by: default avatarWu Fengguang <fengguang.wu@intel.com>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3958b792
...@@ -246,9 +246,7 @@ static inline void reset_deferred_meminit(pg_data_t *pgdat) ...@@ -246,9 +246,7 @@ static inline void reset_deferred_meminit(pg_data_t *pgdat)
/* Returns true if the struct page for the pfn is uninitialised */ /* Returns true if the struct page for the pfn is uninitialised */
static inline bool __meminit early_page_uninitialised(unsigned long pfn) static inline bool __meminit early_page_uninitialised(unsigned long pfn)
{ {
int nid = early_pfn_to_nid(pfn); if (pfn >= NODE_DATA(early_pfn_to_nid(pfn))->first_deferred_pfn)
if (pfn >= NODE_DATA(nid)->first_deferred_pfn)
return true; return true;
return false; return false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment