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

powerpc/time: Make get_tb() common to PPC32 and PPC64

mftbu() is always defined now, so the #ifdef can be removed
and replaced by an IS_ENABLED(CONFIG_PPC64) inside the
PPC32 version of get_tb().

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

authored by

Christophe Leroy and committed by
Michael Ellerman
9686e431 1156a628

+3 -7
+3 -7
arch/powerpc/include/asm/time.h
··· 53 53 return 0; 54 54 } 55 55 56 - #ifdef CONFIG_PPC64 57 - static inline u64 get_tb(void) 58 - { 59 - return mftb(); 60 - } 61 - #else /* CONFIG_PPC64 */ 62 56 static inline u64 get_tb(void) 63 57 { 64 58 unsigned int tbhi, tblo, tbhi2; 59 + 60 + if (IS_ENABLED(CONFIG_PPC64)) 61 + return mftb(); 65 62 66 63 do { 67 64 tbhi = mftbu(); ··· 68 71 69 72 return ((u64)tbhi << 32) | tblo; 70 73 } 71 - #endif /* !CONFIG_PPC64 */ 72 74 73 75 static inline void set_tb(unsigned int upper, unsigned int lower) 74 76 {