diff options
author | Christophe Leroy <christophe.leroy@csgroup.eu> | 2021-02-06 14:47:26 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2021-02-08 17:10:15 +0300 |
commit | fd659e8f2c6d1e1e96fd5bdb515518801cd02012 (patch) | |
tree | 409286e0746647456ad86677f3eaee1176b81230 /arch/powerpc/include/asm/reg.h | |
parent | 8524e2e76441fc615a3b5c1415823e051cc79eae (diff) | |
download | linux-fd659e8f2c6d1e1e96fd5bdb515518801cd02012.tar.xz |
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
Diffstat (limited to 'arch/powerpc/include/asm/reg.h')
-rw-r--r-- | arch/powerpc/include/asm/reg.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index e40a921d78f9..c006f33f68ad 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h @@ -1413,9 +1413,14 @@ static inline void msr_check_and_clear(unsigned long bits) } #ifdef CONFIG_PPC32 -#define mfsrin(v) ({unsigned int rval; \ - asm volatile("mfsrin %0,%1" : "=r" (rval) : "r" (v)); \ - rval;}) +static inline u32 mfsrin(u32 idx) +{ + u32 val; + + asm volatile("mfsrin %0, %1" : "=r" (val): "r" (idx)); + + return val; +} static inline void mtsrin(u32 val, u32 idx) { |