linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: Remove BUILD_BUG_ON from asm/bug.h
@ 2012-01-03 18:44 Simon Glass
  2012-01-03 19:39 ` Olof Johansson
  2012-01-03 22:33 ` Stephen Boyd
  0 siblings, 2 replies; 6+ messages in thread
From: Simon Glass @ 2012-01-03 18:44 UTC (permalink / raw)
  To: linux-arm-kernel

BUILD_BUG_ON is defined in linux/kernel.h but that is not included by the
asm/bug.h header which uses it. This causes a build error:

...include/linux/mtd/map.h: In function 'inline_map_read':
...include/linux/mtd/map.h:408:3: error: implicit declaration of function
'BUILD_BUG_ON' [-Werror=implicit-function-declaration]

The check is not essential and is not present for other architectures, so
just remove it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 arch/arm/include/asm/bug.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/arm/include/asm/bug.h b/arch/arm/include/asm/bug.h
index 9abe7a0..fac79dc 100644
--- a/arch/arm/include/asm/bug.h
+++ b/arch/arm/include/asm/bug.h
@@ -32,7 +32,6 @@
 
 #define __BUG(__file, __line, __value)				\
 do {								\
-	BUILD_BUG_ON(sizeof(struct bug_entry) != 12);		\
 	asm volatile("1:\t" BUG_INSTR_TYPE #__value "\n"	\
 		".pushsection .rodata.str, \"aMS\", %progbits, 1\n" \
 		"2:\t.asciz " #__file "\n" 			\
-- 
1.7.3.1

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

* [PATCH] ARM: Remove BUILD_BUG_ON from asm/bug.h
  2012-01-03 18:44 [PATCH] ARM: Remove BUILD_BUG_ON from asm/bug.h Simon Glass
@ 2012-01-03 19:39 ` Olof Johansson
  2012-01-03 19:50   ` Simon Glass
  2012-01-03 22:33 ` Stephen Boyd
  1 sibling, 1 reply; 6+ messages in thread
From: Olof Johansson @ 2012-01-03 19:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 3, 2012 at 10:44 AM, Simon Glass <sjg@chromium.org> wrote:
> BUILD_BUG_ON is defined in linux/kernel.h but that is not included by the
> asm/bug.h header which uses it. This causes a build error:
>
> ...include/linux/mtd/map.h: In function 'inline_map_read':
> ...include/linux/mtd/map.h:408:3: error: implicit declaration of function
> 'BUILD_BUG_ON' [-Werror=implicit-function-declaration]
>
> The check is not essential and is not present for other architectures, so
> just remove it.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>

Acked-by: Olof Johansson <olof@lixom.net>

Simon, have you sent it to Russell's patch tracker? If not, please do.


-Olof

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

* [PATCH] ARM: Remove BUILD_BUG_ON from asm/bug.h
  2012-01-03 19:39 ` Olof Johansson
@ 2012-01-03 19:50   ` Simon Glass
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Glass @ 2012-01-03 19:50 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Olof,

On Tue, Jan 3, 2012 at 11:39 AM, Olof Johansson <olof@lixom.net> wrote:
> On Tue, Jan 3, 2012 at 10:44 AM, Simon Glass <sjg@chromium.org> wrote:
>> BUILD_BUG_ON is defined in linux/kernel.h but that is not included by the
>> asm/bug.h header which uses it. This causes a build error:
>>
>> ...include/linux/mtd/map.h: In function 'inline_map_read':
>> ...include/linux/mtd/map.h:408:3: error: implicit declaration of function
>> 'BUILD_BUG_ON' [-Werror=implicit-function-declaration]
>>
>> The check is not essential and is not present for other architectures, so
>> just remove it.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>
> Acked-by: Olof Johansson <olof@lixom.net>
>
> Simon, have you sent it to Russell's patch tracker? If not, please do.

Done

Regards,
Simon

>
>
> -Olof

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

* [PATCH] ARM: Remove BUILD_BUG_ON from asm/bug.h
  2012-01-03 18:44 [PATCH] ARM: Remove BUILD_BUG_ON from asm/bug.h Simon Glass
  2012-01-03 19:39 ` Olof Johansson
@ 2012-01-03 22:33 ` Stephen Boyd
  2012-01-03 22:40   ` Simon Glass
  1 sibling, 1 reply; 6+ messages in thread
From: Stephen Boyd @ 2012-01-03 22:33 UTC (permalink / raw)
  To: linux-arm-kernel

On 01/03/12 10:44, Simon Glass wrote:
> BUILD_BUG_ON is defined in linux/kernel.h but that is not included by the
> asm/bug.h header which uses it. This causes a build error:
>
> ...include/linux/mtd/map.h: In function 'inline_map_read':
> ...include/linux/mtd/map.h:408:3: error: implicit declaration of function
> 'BUILD_BUG_ON' [-Werror=implicit-function-declaration]
>
> The check is not essential and is not present for other architectures, so
> just remove it.

I thought this check was put in place to catch changes to struct
bug_entry being out of sync with the __BUG macro defined in ARM. Why
can't we include kernel.h instead? Or can you elaborate some more on why
we don't need this check in the commit text?

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

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

* [PATCH] ARM: Remove BUILD_BUG_ON from asm/bug.h
  2012-01-03 22:33 ` Stephen Boyd
@ 2012-01-03 22:40   ` Simon Glass
  2012-01-03 23:26     ` Stephen Boyd
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Glass @ 2012-01-03 22:40 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Stephen,

On Tue, Jan 3, 2012 at 2:33 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:
> On 01/03/12 10:44, Simon Glass wrote:
>> BUILD_BUG_ON is defined in linux/kernel.h but that is not included by the
>> asm/bug.h header which uses it. This causes a build error:
>>
>> ...include/linux/mtd/map.h: In function 'inline_map_read':
>> ...include/linux/mtd/map.h:408:3: error: implicit declaration of function
>> 'BUILD_BUG_ON' [-Werror=implicit-function-declaration]
>>
>> The check is not essential and is not present for other architectures, so
>> just remove it.
>
> I thought this check was put in place to catch changes to struct
> bug_entry being out of sync with the __BUG macro defined in ARM. Why
> can't we include kernel.h instead? Or can you elaborate some more on why
> we don't need this check in the commit text?

Yes that is the reason, but ARM is not unique in this matter, and
other archs do not have this check. I did suggest a solution in this
thread involving putting the check in a C file instead of header. But
it needs an arch-specific #define to specify the size expected by the
assembler, and has the disadvantage of moving the check away from the
assembler code.

It's not that we don't want this check, more that it is not essential
(since there is currently no mismatch), it is causing problems and it
is risky to try to solve this problem some other way at this late
stage in 3.2. So the easiest thing is to remove it, to match other
archs.

Regards,
Simon

>
> --
> Sent by an employee of the Qualcomm Innovation Center, Inc.
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
>

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

* [PATCH] ARM: Remove BUILD_BUG_ON from asm/bug.h
  2012-01-03 22:40   ` Simon Glass
@ 2012-01-03 23:26     ` Stephen Boyd
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Boyd @ 2012-01-03 23:26 UTC (permalink / raw)
  To: linux-arm-kernel

On 01/03/12 14:40, Simon Glass wrote:
> Yes that is the reason, but ARM is not unique in this matter, and
> other archs do not have this check. I did suggest a solution in this
> thread involving putting the check in a C file instead of header. But
> it needs an arch-specific #define to specify the size expected by the
> assembler, and has the disadvantage of moving the check away from the
> assembler code.
>
> It's not that we don't want this check, more that it is not essential
> (since there is currently no mismatch), it is causing problems and it
> is risky to try to solve this problem some other way at this late
> stage in 3.2. So the easiest thing is to remove it, to match other
> archs.

Fair enough. I now see the other thread where this has all been
discussed. Sorry for the noise.

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

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

end of thread, other threads:[~2012-01-03 23:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-03 18:44 [PATCH] ARM: Remove BUILD_BUG_ON from asm/bug.h Simon Glass
2012-01-03 19:39 ` Olof Johansson
2012-01-03 19:50   ` Simon Glass
2012-01-03 22:33 ` Stephen Boyd
2012-01-03 22:40   ` Simon Glass
2012-01-03 23:26     ` Stephen Boyd

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