Skip to content

Commit 2603efa

Browse files
pmundttorvalds
authored andcommitted
bug.h: Fix up powerpc build regression.
The asm-generic/bug.h __ASSEMBLY__ guarding is completely bogus, which tripped up the powerpc build when the kernel.h include was added: In file included from include/asm-generic/bug.h:5:0, from arch/powerpc/include/asm/bug.h:127, from arch/powerpc/kernel/head_64.S:31: include/linux/kernel.h:44:0: warning: "ALIGN" redefined [enabled by default] include/linux/linkage.h:57:0: note: this is the location of the previous definition include/linux/sysinfo.h: Assembler messages: include/linux/sysinfo.h:7: Error: Unrecognized opcode: `struct' include/linux/sysinfo.h:8: Error: Unrecognized opcode: `__kernel_long_t' Moving the __ASSEMBLY__ guard up and stashing the kernel.h include under it fixes this up, as well as covering the case the original fix was attempting to handle. Tested-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent a1f42be commit 2603efa

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎include/asm-generic/bug.h‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#define _ASM_GENERIC_BUG_H
33

44
#include <linux/compiler.h>
5-
#include <linux/kernel.h>
65

76
#ifdef CONFIG_BUG
87

@@ -32,6 +31,9 @@ struct bug_entry {
3231

3332
#endif /* CONFIG_GENERIC_BUG */
3433

34+
#ifndef __ASSEMBLY__
35+
#include <linux/kernel.h>
36+
3537
/*
3638
* Don't use BUG() or BUG_ON() unless there's really no way out; one
3739
* example might be detecting data structure corruption in the middle
@@ -61,7 +63,6 @@ struct bug_entry {
6163
* to provide better diagnostics.
6264
*/
6365
#ifndef __WARN_TAINT
64-
#ifndef __ASSEMBLY__
6566
extern __printf(3, 4)
6667
void warn_slowpath_fmt(const char *file, const int line,
6768
const char *fmt, ...);
@@ -70,7 +71,6 @@ void warn_slowpath_fmt_taint(const char *file, const int line, unsigned taint,
7071
const char *fmt, ...);
7172
extern void warn_slowpath_null(const char *file, const int line);
7273
#define WANT_WARN_ON_SLOWPATH
73-
#endif
7474
#define __WARN() warn_slowpath_null(__FILE__, __LINE__)
7575
#define __WARN_printf(arg...) warn_slowpath_fmt(__FILE__, __LINE__, arg)
7676
#define __WARN_printf_taint(taint, arg...) \
@@ -203,4 +203,6 @@ extern void warn_slowpath_null(const char *file, const int line);
203203
# define WARN_ON_SMP(x) ({0;})
204204
#endif
205205

206+
#endif /* __ASSEMBLY__ */
207+
206208
#endif

0 commit comments

Comments
 (0)