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

powerpc/32s: Change mfsrin() into a static inline function

mfsrin() is a macro.

Change in into an inline function to avoid conflicts in KVM
and make it more evolutive.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/72c7b9879e2e2e6f5c27dadda6486386c2b50f23.1612612022.git.christophe.leroy@csgroup.eu

authored by

Christophe Leroy and committed by
Michael Ellerman
fd659e8f 8524e2e7

+8 -7
+8 -3
arch/powerpc/include/asm/reg.h
··· 1413 1413 } 1414 1414 1415 1415 #ifdef CONFIG_PPC32 1416 - #define mfsrin(v) ({unsigned int rval; \ 1417 - asm volatile("mfsrin %0,%1" : "=r" (rval) : "r" (v)); \ 1418 - rval;}) 1416 + static inline u32 mfsrin(u32 idx) 1417 + { 1418 + u32 val; 1419 + 1420 + asm volatile("mfsrin %0, %1" : "=r" (val): "r" (idx)); 1421 + 1422 + return val; 1423 + } 1419 1424 1420 1425 static inline void mtsrin(u32 val, u32 idx) 1421 1426 {
-4
arch/powerpc/kvm/book3s_emulate.c
··· 61 61 #define SPRN_GQR6 918 62 62 #define SPRN_GQR7 919 63 63 64 - /* Book3S_32 defines mfsrin(v) - but that messes up our abstract 65 - * function pointers, so let's just disable the define. */ 66 - #undef mfsrin 67 - 68 64 enum priv_level { 69 65 PRIV_PROBLEM = 0, 70 66 PRIV_SUPER = 1,