* [PATCH] ARM: tegra: uncompress.h: Don't depend on kernel headers
@ 2012-02-27 21:27 Stephen Warren
2012-02-27 21:48 ` Olof Johansson
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Warren @ 2012-02-27 21:27 UTC (permalink / raw)
To: linux-arm-kernel
This fixes the following compile error:
CC arch/arm/boot/compressed/misc.o
In file included from arch/arm/boot/compressed/misc.c:28:0:
arch/arm/mach-tegra/include/mach/uncompress.h: In function 'arch_decomp_setup':
arch/arm/mach-tegra/include/mach/uncompress.h:125:2: error: implicit declaration of function 'BUILD_BUG_ON_ZERO' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
This is due to use of the ARRAY_SIZE() macro. Typically, this would be
solved by including <linux/bug.h>, but the compressor code isn't part of
the kernel, and so should not include kernel headers. Instead, define
the few macros the code uses directly, and in a way that doesn't depend
on <linux/bug.h>.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
arch/arm/mach-tegra/include/mach/uncompress.h | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-tegra/include/mach/uncompress.h b/arch/arm/mach-tegra/include/mach/uncompress.h
index b066ba0..5a440f3 100644
--- a/arch/arm/mach-tegra/include/mach/uncompress.h
+++ b/arch/arm/mach-tegra/include/mach/uncompress.h
@@ -25,13 +25,15 @@
#ifndef __MACH_TEGRA_UNCOMPRESS_H
#define __MACH_TEGRA_UNCOMPRESS_H
-#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/serial_reg.h>
#include <mach/iomap.h>
#include <mach/irammap.h>
+#define BIT(x) (1 << (x))
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+
#define DEBUG_UART_SHIFT 2
volatile u8 *uart;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] ARM: tegra: uncompress.h: Don't depend on kernel headers
2012-02-27 21:27 [PATCH] ARM: tegra: uncompress.h: Don't depend on kernel headers Stephen Warren
@ 2012-02-27 21:48 ` Olof Johansson
0 siblings, 0 replies; 2+ messages in thread
From: Olof Johansson @ 2012-02-27 21:48 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Feb 27, 2012 at 1:27 PM, Stephen Warren <swarren@nvidia.com> wrote:
> This fixes the following compile error:
>
> ?CC ? ? ?arch/arm/boot/compressed/misc.o
> In file included from arch/arm/boot/compressed/misc.c:28:0:
> arch/arm/mach-tegra/include/mach/uncompress.h: In function 'arch_decomp_setup':
> arch/arm/mach-tegra/include/mach/uncompress.h:125:2: error: implicit declaration of function 'BUILD_BUG_ON_ZERO' [-Werror=implicit-function-declaration]
> cc1: some warnings being treated as errors
>
> This is due to use of the ARRAY_SIZE() macro. Typically, this would be
> solved by including <linux/bug.h>, but the compressor code isn't part of
> the kernel, and so should not include kernel headers. Instead, define
> the few macros the code uses directly, and in a way that doesn't depend
> on <linux/bug.h>.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
Thanks, applied on for-3.4/soc-drivers, since that's the branch the
linux/kernel.h include was introduced on.
We're losing bisectability over about 9 commits unless I rebase the
branch to squash it in, but there might be downstream users of it so I
don't want to do that.
-Olof
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-02-27 21:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-27 21:27 [PATCH] ARM: tegra: uncompress.h: Don't depend on kernel headers Stephen Warren
2012-02-27 21:48 ` Olof Johansson
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).