linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
To: kbuild test robot <fengguang.wu@intel.com>
Cc: "kbuild-all@01.org" <kbuild-all@01.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [mmotm:master 301/497] include/linux/mm_types.h:371:22: error: 'HUGE_MAX_HSTATE' undeclared here (not in a function)
Date: Fri, 14 Aug 2015 00:55:10 +0000	[thread overview]
Message-ID: <20150814005510.GA6196@hori1.linux.bs1.fc.nec.co.jp> (raw)
In-Reply-To: <201508140757.EXwaVITo%fengguang.wu@intel.com>

On Fri, Aug 14, 2015 at 07:43:58AM +0800, kbuild test robot wrote:
> tree:   git://git.cmpxchg.org/linux-mmotm.git master
> head:   f6a6014bf6b3c724cff30194681f219ac230c898
> commit: b1e17e02f94bd2dec7547553e3cc5330f497193c [301/497] mm: hugetlb: proc: add HugetlbPages field to /proc/PID/status
> config: sh-sh7785lcr_32bit_defconfig (attached as .config)
> reproduce:
>   wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
>   chmod +x ~/bin/make.cross
>   git checkout b1e17e02f94bd2dec7547553e3cc5330f497193c
>   # save the attached .config to linux build tree
>   make.cross ARCH=sh 
> 
> All error/warnings (new ones prefixed by >>):
> 
>    In file included from include/linux/mm.h:16:0,
>                     from arch/sh/kernel/asm-offsets.c:13:
> >> include/linux/mm_types.h:371:22: error: 'HUGE_MAX_HSTATE' undeclared here (not in a function)
>    make[2]: *** [arch/sh/kernel/asm-offsets.s] Error 1
>    make[2]: Target '__build' not remade because of errors.
>    make[1]: *** [prepare0] Error 2
>    make[1]: Target 'prepare' not remade because of errors.
>    make: *** [sub-make] Error 2
> 
> vim +/HUGE_MAX_HSTATE +371 include/linux/mm_types.h
> 
>    365	struct mm_rss_stat {
>    366		atomic_long_t count[NR_MM_COUNTERS];
>    367	};
>    368	
>    369	#ifdef CONFIG_HUGETLB_PAGE
>    370	struct hugetlb_usage {
>  > 371		atomic_long_t count[HUGE_MAX_HSTATE];

When HUGE_MAX_HSTATE is defined in arch-specific code, it's included before
including mm_types.h, so build passes. But if HUGE_MAX_HSTATE is defined in
common code, it's defined in hugetlb.h which is included after mm.h (or
mm_types.h), so this build error happens.

So the fix is simply to move the common definition into mm_types.h.

Thanks,
Naoya Horiguchi
---
Author: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Date:   Fri Aug 14 09:35:21 2015 +0900

    move HUGE_MAX_HSTATE definition into include/linux/mm_types.h

diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 64aa4db01f48..99ea2c651106 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -330,10 +330,6 @@ int __init alloc_bootmem_huge_page(struct hstate *h);
 void __init hugetlb_add_hstate(unsigned order);
 struct hstate *size_to_hstate(unsigned long size);
 
-#ifndef HUGE_MAX_HSTATE
-#define HUGE_MAX_HSTATE 1
-#endif
-
 extern struct hstate hstates[HUGE_MAX_HSTATE];
 extern unsigned int default_hstate_idx;
 
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index e95c5fe1eb7d..27333cdb8b46 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -365,6 +365,10 @@ struct mm_rss_stat {
 };
 
 #ifdef CONFIG_HUGETLB_PAGE
+
+#ifndef HUGE_MAX_HSTATE
+#define HUGE_MAX_HSTATE	1
+#endif
 struct hugetlb_usage {
 	atomic_long_t count[HUGE_MAX_HSTATE];
 };

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2015-08-14  0:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-13 23:43 kbuild test robot
2015-08-14  0:55 ` Naoya Horiguchi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150814005510.GA6196@hori1.linux.bs1.fc.nec.co.jp \
    --to=n-horiguchi@ah.jp.nec.com \
    --cc=akpm@linux-foundation.org \
    --cc=fengguang.wu@intel.com \
    --cc=hannes@cmpxchg.org \
    --cc=kbuild-all@01.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox