Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

RISC-V: use RISCV_{INT,SHORT} instead of {INT,SHORT} for asm macros

INT and SHORT are used by some drivers that pull in the include files,
so prefixing helps avoid namespace conflicts. Other constructs in the
same file already uses this.

Fixes, among others, these warnings with allmodconfig:

../sound/core/pcm_misc.c:43:0: warning: "INT" redefined
#define INT __force int

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>

authored by

Olof Johansson and committed by
Palmer Dabbelt
5e6f82b0 5ddf755e

+9 -9
+6 -6
arch/riscv/include/asm/asm.h
··· 58 58 #endif 59 59 60 60 #if (__SIZEOF_INT__ == 4) 61 - #define INT __ASM_STR(.word) 62 - #define SZINT __ASM_STR(4) 63 - #define LGINT __ASM_STR(2) 61 + #define RISCV_INT __ASM_STR(.word) 62 + #define RISCV_SZINT __ASM_STR(4) 63 + #define RISCV_LGINT __ASM_STR(2) 64 64 #else 65 65 #error "Unexpected __SIZEOF_INT__" 66 66 #endif 67 67 68 68 #if (__SIZEOF_SHORT__ == 2) 69 - #define SHORT __ASM_STR(.half) 70 - #define SZSHORT __ASM_STR(2) 71 - #define LGSHORT __ASM_STR(1) 69 + #define RISCV_SHORT __ASM_STR(.half) 70 + #define RISCV_SZSHORT __ASM_STR(2) 71 + #define RISCV_LGSHORT __ASM_STR(1) 72 72 #else 73 73 #error "Unexpected __SIZEOF_SHORT__" 74 74 #endif
+3 -3
arch/riscv/include/asm/bug.h
··· 27 27 typedef u32 bug_insn_t; 28 28 29 29 #ifdef CONFIG_GENERIC_BUG_RELATIVE_POINTERS 30 - #define __BUG_ENTRY_ADDR INT " 1b - 2b" 31 - #define __BUG_ENTRY_FILE INT " %0 - 2b" 30 + #define __BUG_ENTRY_ADDR RISCV_INT " 1b - 2b" 31 + #define __BUG_ENTRY_FILE RISCV_INT " %0 - 2b" 32 32 #else 33 33 #define __BUG_ENTRY_ADDR RISCV_PTR " 1b" 34 34 #define __BUG_ENTRY_FILE RISCV_PTR " %0" ··· 38 38 #define __BUG_ENTRY \ 39 39 __BUG_ENTRY_ADDR "\n\t" \ 40 40 __BUG_ENTRY_FILE "\n\t" \ 41 - SHORT " %1" 41 + RISCV_SHORT " %1" 42 42 #else 43 43 #define __BUG_ENTRY \ 44 44 __BUG_ENTRY_ADDR