Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@mvista.com>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Ralf Baechle <ralf@linux-mips.org>,
	David Daney <david.daney@cavium.com>,
	Hillf Danton <dhillf@gmail.com>,
	linux-mips@linux-mips.org
Subject: Re: [Patch] mips: do not redefine BUILD_BUG()
Date: Fri, 03 Feb 2012 14:29:41 +0400	[thread overview]
Message-ID: <4F2BB715.8090803@mvista.com> (raw)
In-Reply-To: <1328255503-17575-1-git-send-email-xiyou.wangcong@gmail.com>

Hello.

On 03-02-2012 11:51, Cong Wang wrote:

> On mips, we got

> include/linux/kernel.h:717:1: error: "BUILD_BUG" redefined
> arch/mips/include/asm/page.h:43:1: error: this is the location of the previous definition
> make[3]: *** [arch/mips/sgi-ip27/ip27-console.o] Error 1
> make[2]: *** [arch/mips/sgi-ip27] Error 2
> make[1]: *** [arch/mips] Error 2
> make: *** [sub-make] Error 2

> use generic BUILD_BUG() instead of re-defining one.

> Signed-off-by: WANG Cong<xiyou.wangcong@gmail.com>

> ---
> diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
> index d417909..e14121a 100644
> --- a/arch/mips/include/asm/page.h
> +++ b/arch/mips/include/asm/page.h
> @@ -39,9 +39,7 @@
>   #define HPAGE_MASK	(~(HPAGE_SIZE - 1))
>   #define HUGETLB_PAGE_ORDER	(HPAGE_SHIFT - PAGE_SHIFT)
>   #else /* !CONFIG_HUGETLB_PAGE */
> -# ifndef BUILD_BUG

    Not clear why we get the error if we're protected with #ifndef...

> -#  define BUILD_BUG() do { extern void __build_bug(void); __build_bug(); } while (0)
> -# endif
> +#include<linux/kernel.h>

    Do not do #include among the #define's...

>   #define HPAGE_SHIFT	({BUILD_BUG(); 0; })
>   #define HPAGE_SIZE	({BUILD_BUG(); 0; })
>   #define HPAGE_MASK	({BUILD_BUG(); 0; })

WBR, Sergei

  reply	other threads:[~2012-02-03 10:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-03  7:51 [Patch] mips: do not redefine BUILD_BUG() Cong Wang
2012-02-03 10:29 ` Sergei Shtylyov [this message]
2012-02-03 10:42   ` Geert Uytterhoeven
2012-02-03 11:29 ` Jayachandran C.

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=4F2BB715.8090803@mvista.com \
    --to=sshtylyov@mvista.com \
    --cc=akpm@linux-foundation.org \
    --cc=david.daney@cavium.com \
    --cc=dhillf@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=xiyou.wangcong@gmail.com \
    /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