diff options
| author | Paul Mundt <lethal@linux-sh.org> | 2012-06-25 04:15:31 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-25 13:32:49 -0400 |
| commit | 09682c1dd3820445a27d32dcbeee6a6eafff3dc9 (patch) | |
| tree | 7e4b74d59ea2fbcf2a6210c3834f58aceab194e0 /include/asm-generic | |
| parent | 6b16351acbd415e66ba16bf7d473ece1574cf0bc (diff) | |
bug.h: Fix up CONFIG_BUG=n implicit function declarations.
Commit 2603efa31a03 ("bug.h: Fix up powerpc build regression") corrected
the powerpc build case and extended the __ASSEMBLY__ guards, but it also
got caught in pre-processor hell accidentally matching the else case of
CONFIG_BUG resulting in the BUG disabled case tripping up on
-Werror=implicit-function-declaration.
It's not possible to __ASSEMBLY__ guard the entire file as architecture
code needs to get at the BUGFLAG_WARNING definition in the GENERIC_BUG
case, but the rest of the CONFIG_BUG=y/n case needs to be guarded.
Rather than littering endless __ASSEMBLY__ checks in each of the if/else
cases we just move the BUGFLAG definitions up under their own
GENERIC_BUG test and then shove everything else under one big
__ASSEMBLY__ guard.
Build tested on all of x86 CONFIG_BUG=y, CONFIG_BUG=n, powerpc (due to
it's dependence on BUGFLAG definitions in assembly code), and sh (due to
not bringing in linux/kernel.h to satisfy the taint flag definitions used
by the generic bug code).
Hopefully that's the end of the corner cases and I can abstain from ever
having to touch this infernal header ever again.
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Tested-by: Fengguang Wu <wfg@linux.intel.com>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-generic')
| -rw-r--r-- | include/asm-generic/bug.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index 506ec19a3736..7d10f962aa13 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
| @@ -3,10 +3,18 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
| 5 | 5 | ||
| 6 | #ifdef CONFIG_GENERIC_BUG | ||
| 7 | #define BUGFLAG_WARNING (1 << 0) | ||
| 8 | #define BUGFLAG_TAINT(taint) (BUGFLAG_WARNING | ((taint) << 8)) | ||
| 9 | #define BUG_GET_TAINT(bug) ((bug)->flags >> 8) | ||
| 10 | #endif | ||
| 11 | |||
| 12 | #ifndef __ASSEMBLY__ | ||
| 13 | #include <linux/kernel.h> | ||
| 14 | |||
| 6 | #ifdef CONFIG_BUG | 15 | #ifdef CONFIG_BUG |
| 7 | 16 | ||
| 8 | #ifdef CONFIG_GENERIC_BUG | 17 | #ifdef CONFIG_GENERIC_BUG |
| 9 | #ifndef __ASSEMBLY__ | ||
| 10 | struct bug_entry { | 18 | struct bug_entry { |
| 11 | #ifndef CONFIG_GENERIC_BUG_RELATIVE_POINTERS | 19 | #ifndef CONFIG_GENERIC_BUG_RELATIVE_POINTERS |
| 12 | unsigned long bug_addr; | 20 | unsigned long bug_addr; |
| @@ -23,17 +31,8 @@ struct bug_entry { | |||
| 23 | #endif | 31 | #endif |
| 24 | unsigned short flags; | 32 | unsigned short flags; |
| 25 | }; | 33 | }; |
| 26 | #endif /* __ASSEMBLY__ */ | ||
| 27 | |||
| 28 | #define BUGFLAG_WARNING (1 << 0) | ||
| 29 | #define BUGFLAG_TAINT(taint) (BUGFLAG_WARNING | ((taint) << 8)) | ||
| 30 | #define BUG_GET_TAINT(bug) ((bug)->flags >> 8) | ||
| 31 | |||
| 32 | #endif /* CONFIG_GENERIC_BUG */ | 34 | #endif /* CONFIG_GENERIC_BUG */ |
| 33 | 35 | ||
| 34 | #ifndef __ASSEMBLY__ | ||
| 35 | #include <linux/kernel.h> | ||
| 36 | |||
| 37 | /* | 36 | /* |
| 38 | * Don't use BUG() or BUG_ON() unless there's really no way out; one | 37 | * Don't use BUG() or BUG_ON() unless there's really no way out; one |
| 39 | * example might be detecting data structure corruption in the middle | 38 | * example might be detecting data structure corruption in the middle |
