diff options
author | Masahiro Yamada <yamada.m@jp.panasonic.com> | 2014-06-12 12:26:15 +0900 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2014-06-23 15:37:24 -0600 |
commit | 1638d98052e0d03e46d504b21ec1b88ecfcd87aa (patch) | |
tree | 1c97382ff025ad729bfc7a160974f16be3c5c6cc /arch/sandbox/include/asm/system.h | |
parent | 9c38c070085b566e2fc3f7696cdd4362c2759285 (diff) |
sandbox: change local_irq_save() to macro
local_irq_save() should be a macro, not a function
because local_irq_save() saves flag to the given argument.
GCC is silent about this issue, but Clang warns:
In file included from lib/asm-offsets.c:15:
In file included from include/common.h:20:
In file included from include/linux/bitops.h:110:
arch/sandbox/include/asm/bitops.h:59:17:
warning: variable 'flags' is uninitialized when used here
[-Wuninitialized]
local_irq_save(flags);
^~~~~
That change causes another warning:
In file included from include/linux/bitops.h:110:0,
from include/common.h:20,
from lib/asm-offsets.c:15:
arch/sandbox/include/asm/bitops.h: In function ‘test_and_set_bit’:
arch/sandbox/include/asm/bitops.h:56:16: warning: unused variable ‘flags’ [-Wunused-variable]
So, flags should be set to __always_unused.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Jeroen Hofstee <jeroen@myspectrum.nl>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Jeroen Hofstee <jeroen@myspectrum.nl>
Diffstat (limited to 'arch/sandbox/include/asm/system.h')
-rw-r--r-- | arch/sandbox/include/asm/system.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/sandbox/include/asm/system.h b/arch/sandbox/include/asm/system.h index 066acc53fd..02beed35a7 100644 --- a/arch/sandbox/include/asm/system.h +++ b/arch/sandbox/include/asm/system.h @@ -8,10 +8,7 @@ #define __ASM_SANDBOX_SYSTEM_H /* Define this as nops for sandbox architecture */ -static inline void local_irq_save(unsigned flags __attribute__((unused))) -{ -} - +#define local_irq_save(x) #define local_irq_enable() #define local_irq_disable() #define local_save_flags(x) |