linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch] mips: do not redefine BUILD_BUG()
@ 2012-02-03  7:51 Cong Wang
  2012-02-03 10:29 ` Sergei Shtylyov
  2012-02-03 11:29 ` Jayachandran C.
  0 siblings, 2 replies; 4+ messages in thread
From: Cong Wang @ 2012-02-03  7:51 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andrew Morton, WANG Cong, Ralf Baechle, David Daney,
	Hillf Danton, linux-mips

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
-#  define BUILD_BUG() do { extern void __build_bug(void); __build_bug(); } while (0)
-# endif
+#include <linux/kernel.h>
 #define HPAGE_SHIFT	({BUILD_BUG(); 0; })
 #define HPAGE_SIZE	({BUILD_BUG(); 0; })
 #define HPAGE_MASK	({BUILD_BUG(); 0; })

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Patch] mips: do not redefine BUILD_BUG()
  2012-02-03  7:51 [Patch] mips: do not redefine BUILD_BUG() Cong Wang
@ 2012-02-03 10:29 ` Sergei Shtylyov
  2012-02-03 10:42   ` Geert Uytterhoeven
  2012-02-03 11:29 ` Jayachandran C.
  1 sibling, 1 reply; 4+ messages in thread
From: Sergei Shtylyov @ 2012-02-03 10:29 UTC (permalink / raw)
  To: Cong Wang
  Cc: linux-kernel, Andrew Morton, Ralf Baechle, David Daney,
	Hillf Danton, linux-mips

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Patch] mips: do not redefine BUILD_BUG()
  2012-02-03 10:29 ` Sergei Shtylyov
@ 2012-02-03 10:42   ` Geert Uytterhoeven
  0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2012-02-03 10:42 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Cong Wang, linux-kernel, Andrew Morton, Ralf Baechle,
	David Daney, Hillf Danton, linux-mips

On Fri, Feb 3, 2012 at 11:29, Sergei Shtylyov <sshtylyov@mvista.com> wrote:
>> 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

>> --- 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...

Because this is the first definition. It's redefined later.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Patch] mips: do not redefine BUILD_BUG()
  2012-02-03  7:51 [Patch] mips: do not redefine BUILD_BUG() Cong Wang
  2012-02-03 10:29 ` Sergei Shtylyov
@ 2012-02-03 11:29 ` Jayachandran C.
  1 sibling, 0 replies; 4+ messages in thread
From: Jayachandran C. @ 2012-02-03 11:29 UTC (permalink / raw)
  To: Cong Wang
  Cc: linux-kernel, Andrew Morton, Ralf Baechle, David Daney,
	Hillf Danton, linux-mips

On Fri, Feb 3, 2012 at 1:21 PM, Cong Wang <xiyou.wangcong@gmail.com> 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>

This is already fixed in linux-mips.org repository:

commit 2f5d5510507626ee799b6d1304d154569b6dfe05
Author: Ralf Baechle <ralf@linux-mips.org>
Date:   Mon Jan 16 12:38:05 2012 +0100

    MIPS: Remove temporary kludge from <asm/page.h>

JC.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-02-03 11:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-03  7:51 [Patch] mips: do not redefine BUILD_BUG() Cong Wang
2012-02-03 10:29 ` Sergei Shtylyov
2012-02-03 10:42   ` Geert Uytterhoeven
2012-02-03 11:29 ` Jayachandran C.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).