* [PATCH] ARM: mx51: Fix build error due to missing include of <linux/bug.h>
@ 2012-02-28 12:11 Fabio Estevam
2012-02-28 12:53 ` Russell King - ARM Linux
0 siblings, 1 reply; 7+ messages in thread
From: Fabio Estevam @ 2012-02-28 12:11 UTC (permalink / raw)
To: linux-arm-kernel
Fix the following build error:
arch/arm/mach-imx/cpu_op-mx51.c: In function 'mx51_get_cpu_op':
arch/arm/mach-imx/cpu_op-mx51.c:27: error: implicit declaration of function 'BUILD_BUG_ON_ZERO'
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
This applies against linux-next
arch/arm/mach-imx/cpu_op-mx51.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-imx/cpu_op-mx51.c b/arch/arm/mach-imx/cpu_op-mx51.c
index 9d34c3d..9a4f77a 100644
--- a/arch/arm/mach-imx/cpu_op-mx51.c
+++ b/arch/arm/mach-imx/cpu_op-mx51.c
@@ -14,6 +14,7 @@
#include <linux/types.h>
#include <mach/hardware.h>
#include <linux/kernel.h>
+#include <linux/bug.h>
static struct cpu_op mx51_cpu_op[] = {
{
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] ARM: mx51: Fix build error due to missing include of <linux/bug.h>
2012-02-28 12:11 [PATCH] ARM: mx51: Fix build error due to missing include of <linux/bug.h> Fabio Estevam
@ 2012-02-28 12:53 ` Russell King - ARM Linux
2012-02-28 13:03 ` Fabio Estevam
0 siblings, 1 reply; 7+ messages in thread
From: Russell King - ARM Linux @ 2012-02-28 12:53 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Feb 28, 2012 at 09:11:50AM -0300, Fabio Estevam wrote:
> Fix the following build error:
>
> arch/arm/mach-imx/cpu_op-mx51.c: In function 'mx51_get_cpu_op':
> arch/arm/mach-imx/cpu_op-mx51.c:27: error: implicit declaration of function 'BUILD_BUG_ON_ZERO'
I think having the asm/bug.h replaced with linux/bug.h in linux/kernel.h
would be a better solution.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> This applies against linux-next
>
> arch/arm/mach-imx/cpu_op-mx51.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-imx/cpu_op-mx51.c b/arch/arm/mach-imx/cpu_op-mx51.c
> index 9d34c3d..9a4f77a 100644
> --- a/arch/arm/mach-imx/cpu_op-mx51.c
> +++ b/arch/arm/mach-imx/cpu_op-mx51.c
> @@ -14,6 +14,7 @@
> #include <linux/types.h>
> #include <mach/hardware.h>
> #include <linux/kernel.h>
> +#include <linux/bug.h>
>
> static struct cpu_op mx51_cpu_op[] = {
> {
> --
> 1.7.1
>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] ARM: mx51: Fix build error due to missing include of <linux/bug.h>
2012-02-28 12:53 ` Russell King - ARM Linux
@ 2012-02-28 13:03 ` Fabio Estevam
2012-02-28 13:21 ` Russell King - ARM Linux
0 siblings, 1 reply; 7+ messages in thread
From: Fabio Estevam @ 2012-02-28 13:03 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Feb 28, 2012 at 9:53 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> I think having the asm/bug.h replaced with linux/bug.h in linux/kernel.h
> would be a better solution.
commit 6f863554 (kernel.h: doesn't explicitly use bug.h, so don't
include it. ), which appears in linux-next, has removed asm/debug.h
from linux/kernel.h.
I should have pointed this commit ID in my commit log.
Regards,
Fabio Estevam
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] ARM: mx51: Fix build error due to missing include of <linux/bug.h>
2012-02-28 13:03 ` Fabio Estevam
@ 2012-02-28 13:21 ` Russell King - ARM Linux
2012-02-28 13:25 ` Fabio Estevam
2012-02-28 23:52 ` Paul Gortmaker
0 siblings, 2 replies; 7+ messages in thread
From: Russell King - ARM Linux @ 2012-02-28 13:21 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Feb 28, 2012 at 10:03:33AM -0300, Fabio Estevam wrote:
> On Tue, Feb 28, 2012 at 9:53 AM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
>
> > I think having the asm/bug.h replaced with linux/bug.h in linux/kernel.h
> > would be a better solution.
>
> commit 6f863554 (kernel.h: doesn't explicitly use bug.h, so don't
> include it. ), which appears in linux-next, has removed asm/debug.h
> from linux/kernel.h.
>
> I should have pointed this commit ID in my commit log.
No, this is not a fix, and it probably makes things worse.
linux/kernel.h _does_ use bug stuff - in ARRAY_SIZE().
ARRAY_SIZE() uses __must_be_array(), which is defined in linux/compiler-gcc.h,
which is obtained via linux/compiler.h and linux/linkage.h.
linux/compiler-gcc.h defines __must_be_array() to be:
#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
and BUILD_BUG_ON_ZERO used to be in linux/kernel.h but got moved to
linux/bug.h.
Hence why people are seeing build breakage with ARRAY_SIZE().
The answer is not to start scattering lots of .c files with linux/bug.h
includes, but to fix linux/kernel.h.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] ARM: mx51: Fix build error due to missing include of <linux/bug.h>
2012-02-28 13:21 ` Russell King - ARM Linux
@ 2012-02-28 13:25 ` Fabio Estevam
2012-02-28 23:52 ` Paul Gortmaker
1 sibling, 0 replies; 7+ messages in thread
From: Fabio Estevam @ 2012-02-28 13:25 UTC (permalink / raw)
To: linux-arm-kernel
On 2/28/12, Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
> On Tue, Feb 28, 2012 at 10:03:33AM -0300, Fabio Estevam wrote:
>> On Tue, Feb 28, 2012 at 9:53 AM, Russell King - ARM Linux
>> <linux@arm.linux.org.uk> wrote:
>>
>> > I think having the asm/bug.h replaced with linux/bug.h in linux/kernel.h
>> > would be a better solution.
>>
>> commit 6f863554 (kernel.h: doesn't explicitly use bug.h, so don't
>> include it. ), which appears in linux-next, has removed asm/debug.h
>> from linux/kernel.h.
>>
>> I should have pointed this commit ID in my commit log.
>
> No, this is not a fix, and it probably makes things worse.
>
> linux/kernel.h _does_ use bug stuff - in ARRAY_SIZE().
>
> ARRAY_SIZE() uses __must_be_array(), which is defined in
> linux/compiler-gcc.h,
> which is obtained via linux/compiler.h and linux/linkage.h.
>
> linux/compiler-gcc.h defines __must_be_array() to be:
> #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
>
> and BUILD_BUG_ON_ZERO used to be in linux/kernel.h but got moved to
> linux/bug.h.
>
> Hence why people are seeing build breakage with ARRAY_SIZE().
>
> The answer is not to start scattering lots of .c files with linux/bug.h
> includes, but to fix linux/kernel.h.
This makes sense, thanks.
Will submit a patch for lkml shortly.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] ARM: mx51: Fix build error due to missing include of <linux/bug.h>
2012-02-28 13:21 ` Russell King - ARM Linux
2012-02-28 13:25 ` Fabio Estevam
@ 2012-02-28 23:52 ` Paul Gortmaker
2012-02-29 0:06 ` Russell King - ARM Linux
1 sibling, 1 reply; 7+ messages in thread
From: Paul Gortmaker @ 2012-02-28 23:52 UTC (permalink / raw)
To: linux-arm-kernel
[Re: [PATCH] ARM: mx51: Fix build error due to missing include of <linux/bug.h>] On 28/02/2012 (Tue 13:21) Russell King - ARM Linux wrote:
[...]
> The answer is not to start scattering lots of .c files with linux/bug.h
> includes, but to fix linux/kernel.h.
Hi Russell,
I understand your concerns, and had I found myself "buggering" lots
of .c files, I would have backed away and said to myself, "OK, this
really isn't going to work - we really can't do this."
But to put some metrics to it, after building for about 10 different
arch and all their defconfigs, I only had to change about twenty[1] of
the approximately sixteen thousand .c files in the kernel. That is
about 0.125% -- which is one of the things that made me think "Hey, we
can really do this cleanup!" Including this file, there were only
two .c files in all of arch/arm that were using bug somehow.
So I think having kernel.h not require bug.h is completely do-able.
But in the end, I'm not welded to the idea. I think it is a win, but
I'm not going to kick up a big stink if Linus or Andrew say they don't
think it is of value, and would rather not rock the boat.
Thanks,
Paul.
--
[1] https://lkml.org/lkml/2012/1/26/521
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] ARM: mx51: Fix build error due to missing include of <linux/bug.h>
2012-02-28 23:52 ` Paul Gortmaker
@ 2012-02-29 0:06 ` Russell King - ARM Linux
0 siblings, 0 replies; 7+ messages in thread
From: Russell King - ARM Linux @ 2012-02-29 0:06 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Feb 28, 2012 at 06:52:45PM -0500, Paul Gortmaker wrote:
> [Re: [PATCH] ARM: mx51: Fix build error due to missing include of <linux/bug.h>] On 28/02/2012 (Tue 13:21) Russell King - ARM Linux wrote:
>
> [...]
>
> > The answer is not to start scattering lots of .c files with linux/bug.h
> > includes, but to fix linux/kernel.h.
>
> Hi Russell,
>
> I understand your concerns, and had I found myself "buggering" lots
> of .c files, I would have backed away and said to myself, "OK, this
> really isn't going to work - we really can't do this."
>
> But to put some metrics to it, after building for about 10 different
> arch and all their defconfigs, I only had to change about twenty[1] of
> the approximately sixteen thousand .c files in the kernel.
I think there's more than that - I've seen two reports for other
files which have needed fixing so far, and I wouldn't be surprised if
there's more.
I guess we'll see in coming weeks how it pans out, but my gut feeling
is that this is going to cause a fair number of build problems.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-02-29 0:06 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-28 12:11 [PATCH] ARM: mx51: Fix build error due to missing include of <linux/bug.h> Fabio Estevam
2012-02-28 12:53 ` Russell King - ARM Linux
2012-02-28 13:03 ` Fabio Estevam
2012-02-28 13:21 ` Russell King - ARM Linux
2012-02-28 13:25 ` Fabio Estevam
2012-02-28 23:52 ` Paul Gortmaker
2012-02-29 0:06 ` Russell King - ARM Linux
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.