]> git.baikalelectronics.ru Git - kernel.git/commitdiff
powerpc/32s: Change mfsrin() into a static inline function
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Sat, 6 Feb 2021 11:47:26 +0000 (11:47 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 8 Feb 2021 14:10:15 +0000 (01:10 +1100)
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
arch/powerpc/include/asm/reg.h
arch/powerpc/kvm/book3s_emulate.c

index e40a921d78f96e82a6897712c2e822f07fbf06a6..c006f33f68ada97cbdc25656f6fe23dbec8fac22 100644 (file)
@@ -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)
 {
index b08cc15f31c7b546c238cfc906f049a52275baf6..fdb57be71aa659542d5e4195e3904bc66ec52a92 100644 (file)
 #define SPRN_GQR6              918
 #define SPRN_GQR7              919
 
-/* Book3S_32 defines mfsrin(v) - but that messes up our abstract
- * function pointers, so let's just disable the define. */
-#undef mfsrin
-
 enum priv_level {
        PRIV_PROBLEM = 0,
        PRIV_SUPER = 1,