提交 ae026b2a 编写于 作者: M Mel Gorman 提交者: Linus Torvalds

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: NMel Gorman <mgorman@suse.de>
Reported-by: NWu Fengguang <fengguang.wu@intel.com>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册