From 22c28e0f6aa6aa66828e575b552baf8fb23c3b82 Mon Sep 17 00:00:00 2001 From: Lee Leahy Date: Tue, 7 Mar 2017 15:47:44 -0800 Subject: src/include: Move storage class to beginning of declaration Fix the following warning detected by checkpatch.pl: WARNING: storage class should be at the beginning of the declaration The following storage class attribute is not detected by checkpatch.py: static cbmem_init_hook_t init_fn_ ## _ptr_ __attribute__((used, \ section(".rodata.cbmem_init_hooks"))) = init_fn_; The following lines generates a false positive: (pound)define STATIC static src/include/cpu/amd/common/cbtypes.h:60: WARNING: storage class should be at the beginning of the declaration typedef asmlinkage void (*smm_handler_t)(void *); src/include/cpu/x86/smm.h:514: WARNING: storage class should be at the beginning of the declaration (pound)define MAYBE_STATIC static src/include/stddef.h:34: WARNING: storage class should be at the beginning of the declaration TEST=Build and run on Galileo Gen2 Change-Id: Ie087d38e6171b549b90e0b831050ac44746a1e14 Signed-off-by: Lee Leahy Reviewed-on: https://review.coreboot.org/18657 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- src/include/cbmem.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src/include/cbmem.h') diff --git a/src/include/cbmem.h b/src/include/cbmem.h index 71e44d384d..0fe25c1741 100644 --- a/src/include/cbmem.h +++ b/src/include/cbmem.h @@ -112,36 +112,36 @@ void cbmem_list(void); void cbmem_add_records_to_cbtable(struct lb_header *header); #if ENV_RAMSTAGE -#define ROMSTAGE_CBMEM_INIT_HOOK(init_fn_) static cbmem_init_hook_t \ - init_fn_ ## _unused_ __attribute__((unused)) = init_fn_; +#define ROMSTAGE_CBMEM_INIT_HOOK(init_fn_) __attribute__((unused)) \ + static cbmem_init_hook_t init_fn_ ## _unused_ = init_fn_; #define RAMSTAGE_CBMEM_INIT_HOOK(init_fn_) \ static cbmem_init_hook_t init_fn_ ## _ptr_ __attribute__((used, \ section(".rodata.cbmem_init_hooks"))) = init_fn_; -#define POSTCAR_CBMEM_INIT_HOOK(init_fn_) static cbmem_init_hook_t \ - init_fn_ ## _unused2_ __attribute__((unused)) = init_fn_; +#define POSTCAR_CBMEM_INIT_HOOK(init_fn_) __attribute__((unused)) \ + static cbmem_init_hook_t init_fn_ ## _unused2_ = init_fn_; #elif ENV_ROMSTAGE #define ROMSTAGE_CBMEM_INIT_HOOK(init_fn_) \ static cbmem_init_hook_t init_fn_ ## _ptr_ __attribute__((used, \ section(".rodata.cbmem_init_hooks"))) = init_fn_; -#define RAMSTAGE_CBMEM_INIT_HOOK(init_fn_) static cbmem_init_hook_t \ - init_fn_ ## _unused_ __attribute__((unused)) = init_fn_; -#define POSTCAR_CBMEM_INIT_HOOK(init_fn_) static cbmem_init_hook_t \ - init_fn_ ## _unused2_ __attribute__((unused)) = init_fn_; +#define RAMSTAGE_CBMEM_INIT_HOOK(init_fn_) __attribute__((unused)) \ + static cbmem_init_hook_t init_fn_ ## _unused_ = init_fn_; +#define POSTCAR_CBMEM_INIT_HOOK(init_fn_) __attribute__((unused)) \ + static cbmem_init_hook_t init_fn_ ## _unused2_ = init_fn_; #elif ENV_POSTCAR -#define ROMSTAGE_CBMEM_INIT_HOOK(init_fn_) static cbmem_init_hook_t \ - init_fn_ ## _unused2_ __attribute__((unused)) = init_fn_; -#define RAMSTAGE_CBMEM_INIT_HOOK(init_fn_) static cbmem_init_hook_t \ - init_fn_ ## _unused_ __attribute__((unused)) = init_fn_; +#define ROMSTAGE_CBMEM_INIT_HOOK(init_fn_) __attribute__((unused)) \ + static cbmem_init_hook_t init_fn_ ## _unused2_ = init_fn_; +#define RAMSTAGE_CBMEM_INIT_HOOK(init_fn_) __attribute__((unused)) \ + static cbmem_init_hook_t init_fn_ ## _unused_ = init_fn_; #define POSTCAR_CBMEM_INIT_HOOK(init_fn_) \ static cbmem_init_hook_t init_fn_ ## _ptr_ __attribute__((used, \ section(".rodata.cbmem_init_hooks"))) = init_fn_; #else -#define ROMSTAGE_CBMEM_INIT_HOOK(init_fn_) static cbmem_init_hook_t \ - init_fn_ ## _unused_ __attribute__((unused)) = init_fn_; -#define RAMSTAGE_CBMEM_INIT_HOOK(init_fn_) static cbmem_init_hook_t \ - init_fn_ ## _unused2_ __attribute__((unused)) = init_fn_; -#define POSTCAR_CBMEM_INIT_HOOK(init_fn_) static cbmem_init_hook_t \ - init_fn_ ## _unused3_ __attribute__((unused)) = init_fn_; +#define ROMSTAGE_CBMEM_INIT_HOOK(init_fn_) __attribute__((unused)) \ + static cbmem_init_hook_t init_fn_ ## _unused_ = init_fn_; +#define RAMSTAGE_CBMEM_INIT_HOOK(init_fn_) __attribute__((unused)) \ + static cbmem_init_hook_t init_fn_ ## _unused2_ = init_fn_; +#define POSTCAR_CBMEM_INIT_HOOK(init_fn_) __attribute__((unused)) \ + static cbmem_init_hook_t init_fn_ ## _unused3_ = init_fn_; #endif /* ENV_RAMSTAGE */ -- cgit v1.2.3