Skip to content

Commit 905259e

Browse files
haokexinmpe
authored andcommitted
powerpc: Remove mfvtb()
This function is only used by get_vtb(). They are almost the same except the reading from the real register. Move the mfspr() to get_vtb() and kill the function mfvtb(). With this, we can eliminate the use of cpu_has_feature() in very core header file like reg.h. This is a preparation for the use of jump label for cpu_has_feature(). Signed-off-by: Kevin Hao <haokexin@gmail.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 309b315 commit 905259e

2 files changed

Lines changed: 1 addition & 10 deletions

File tree

‎arch/powerpc/include/asm/reg.h‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,15 +1256,6 @@ static inline void msr_check_and_clear(unsigned long bits)
12561256
__msr_check_and_clear(bits);
12571257
}
12581258

1259-
static inline unsigned long mfvtb (void)
1260-
{
1261-
#ifdef CONFIG_PPC_BOOK3S_64
1262-
if (cpu_has_feature(CPU_FTR_ARCH_207S))
1263-
return mfspr(SPRN_VTB);
1264-
#endif
1265-
return 0;
1266-
}
1267-
12681259
#ifdef __powerpc64__
12691260
#if defined(CONFIG_PPC_CELL) || defined(CONFIG_PPC_FSL_BOOK3E)
12701261
#define mftb() ({unsigned long rval; \

‎arch/powerpc/include/asm/time.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static inline u64 get_vtb(void)
103103
{
104104
#ifdef CONFIG_PPC_BOOK3S_64
105105
if (cpu_has_feature(CPU_FTR_ARCH_207S))
106-
return mfvtb();
106+
return mfspr(SPRN_VTB);
107107
#endif
108108
return 0;
109109
}

0 commit comments

Comments
 (0)