Skip to content

Commit 9686e43

Browse files
chleroympe
authored andcommitted
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
1 parent 1156a62 commit 9686e43

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

  • arch/powerpc/include/asm

arch/powerpc/include/asm/time.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,13 @@ static inline u64 get_vtb(void)
5353
return 0;
5454
}
5555

56-
#ifdef CONFIG_PPC64
57-
static inline u64 get_tb(void)
58-
{
59-
return mftb();
60-
}
61-
#else /* CONFIG_PPC64 */
6256
static inline u64 get_tb(void)
6357
{
6458
unsigned int tbhi, tblo, tbhi2;
6559

60+
if (IS_ENABLED(CONFIG_PPC64))
61+
return mftb();
62+
6663
do {
6764
tbhi = mftbu();
6865
tblo = mftb();
@@ -71,7 +68,6 @@ static inline u64 get_tb(void)
7168

7269
return ((u64)tbhi << 32) | tblo;
7370
}
74-
#endif /* !CONFIG_PPC64 */
7571

7672
static inline void set_tb(unsigned int upper, unsigned int lower)
7773
{

0 commit comments

Comments
 (0)