powerpc/time: Rename mftbl() to mftb()
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Thu, 1 Oct 2020 12:42:39 +0000 (12:42 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 8 Oct 2020 10:17:15 +0000 (21:17 +1100)
On PPC64, we have mftb().
On PPC32, we have mftbl() and an #define mftb() mftbl().

mftb() and mftbl() are equivalent, their purpose is to read the
content of SPRN_TRBL, as returned by 'mftb' simplified instruction.

binutils seems to define 'mftbl' instruction as an equivalent
of 'mftb'.

However in both 32 bits and 64 bits documentation, only 'mftb' is
defined, and when performing a disassembly with objdump, the displayed
instruction is 'mftb'

No need to have two ways to do the same thing with different
names, rename mftbl() to have only mftb().

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/94dc68d3d9ef9eb549796d4b938b6ba0305a049b.1601556145.git.christophe.leroy@csgroup.eu
arch/powerpc/include/asm/reg.h
arch/powerpc/include/asm/time.h

index 788058af1d44c0c3e724e2a39cfe59c864c69529..c66dcdb47c44015f6f8951da4b05d0ae7f283b78 100644 (file)
@@ -1439,19 +1439,18 @@ static inline void msr_check_and_clear(unsigned long bits)
 #else /* __powerpc64__ */
 
 #if defined(CONFIG_PPC_8xx)
-#define mftbl()                ({unsigned long rval;   \
+#define mftb()         ({unsigned long rval;   \
                        asm volatile("mftbl %0" : "=r" (rval)); rval;})
 #define mftbu()                ({unsigned long rval;   \
                        asm volatile("mftbu %0" : "=r" (rval)); rval;})
 #else
-#define mftbl()                ({unsigned long rval;   \
+#define mftb()         ({unsigned long rval;   \
                        asm volatile("mfspr %0, %1" : "=r" (rval) : \
                                "i" (SPRN_TBRL)); rval;})
 #define mftbu()                ({unsigned long rval;   \
                        asm volatile("mfspr %0, %1" : "=r" (rval) : \
                                "i" (SPRN_TBRU)); rval;})
 #endif
-#define mftb()         mftbl()
 #endif /* !__powerpc64__ */
 
 #define mttbl(v)       asm volatile("mttbl %0":: "r"(v))
index a0c8ae4cb27cd0e64099e2c4aee50209d68fff0b..6e681160981b1895f1c2bfd9a953ce86decb0f97 100644 (file)
@@ -47,7 +47,7 @@ struct div_result {
 
 static inline unsigned long get_tbl(void)
 {
-       return mftbl();
+       return mftb();
 }
 
 static inline unsigned int get_tbu(void)