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

powerpc/tm: Remove msr_tm_active()

Currently msr_tm_active() is a wrapper around MSR_TM_ACTIVE() if
CONFIG_PPC_TRANSACTIONAL_MEM is set, or it is just a function that
returns false if CONFIG_PPC_TRANSACTIONAL_MEM is not set.

This function is not necessary, since MSR_TM_ACTIVE() just do the same and
could be used, removing the dualism and simplifying the code.

This patchset remove every instance of msr_tm_active() and replaced it
by MSR_TM_ACTIVE().

Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Breno Leitao and committed by
Michael Ellerman
5c784c84 62dea077

+15 -13
+6 -1
arch/powerpc/include/asm/reg.h
··· 118 118 #define MSR_TS_S __MASK(MSR_TS_S_LG) /* Transaction Suspended */ 119 119 #define MSR_TS_T __MASK(MSR_TS_T_LG) /* Transaction Transactional */ 120 120 #define MSR_TS_MASK (MSR_TS_T | MSR_TS_S) /* Transaction State bits */ 121 - #define MSR_TM_ACTIVE(x) (((x) & MSR_TS_MASK) != 0) /* Transaction active? */ 122 121 #define MSR_TM_RESV(x) (((x) & MSR_TS_MASK) == MSR_TS_MASK) /* Reserved */ 123 122 #define MSR_TM_TRANSACTIONAL(x) (((x) & MSR_TS_MASK) == MSR_TS_T) 124 123 #define MSR_TM_SUSPENDED(x) (((x) & MSR_TS_MASK) == MSR_TS_S) 124 + 125 + #ifdef CONFIG_PPC_TRANSACTIONAL_MEM 126 + #define MSR_TM_ACTIVE(x) (((x) & MSR_TS_MASK) != 0) /* Transaction active? */ 127 + #else 128 + #define MSR_TM_ACTIVE(x) 0 129 + #endif 125 130 126 131 #if defined(CONFIG_PPC_BOOK3S_64) 127 132 #define MSR_64BIT MSR_SF
+9 -12
arch/powerpc/kernel/process.c
··· 102 102 } 103 103 } 104 104 105 - static inline bool msr_tm_active(unsigned long msr) 106 - { 107 - return MSR_TM_ACTIVE(msr); 108 - } 109 - 110 105 static bool tm_active_with_fp(struct task_struct *tsk) 111 106 { 112 - return msr_tm_active(tsk->thread.regs->msr) && 107 + return MSR_TM_ACTIVE(tsk->thread.regs->msr) && 113 108 (tsk->thread.ckpt_regs.msr & MSR_FP); 114 109 } 115 110 116 111 static bool tm_active_with_altivec(struct task_struct *tsk) 117 112 { 118 - return msr_tm_active(tsk->thread.regs->msr) && 113 + return MSR_TM_ACTIVE(tsk->thread.regs->msr) && 119 114 (tsk->thread.ckpt_regs.msr & MSR_VEC); 120 115 } 121 116 #else 122 - static inline bool msr_tm_active(unsigned long msr) { return false; } 123 117 static inline void check_if_tm_restore_required(struct task_struct *tsk) { } 124 118 static inline bool tm_active_with_fp(struct task_struct *tsk) { return false; } 125 119 static inline bool tm_active_with_altivec(struct task_struct *tsk) { return false; } ··· 241 247 * giveup as this would save to the 'live' structure not the 242 248 * checkpointed structure. 243 249 */ 244 - if(!msr_tm_active(cpumsr) && msr_tm_active(current->thread.regs->msr)) 250 + if (!MSR_TM_ACTIVE(cpumsr) && 251 + MSR_TM_ACTIVE(current->thread.regs->msr)) 245 252 return; 246 253 __giveup_fpu(current); 247 254 } ··· 306 311 * giveup as this would save to the 'live' structure not the 307 312 * checkpointed structure. 308 313 */ 309 - if(!msr_tm_active(cpumsr) && msr_tm_active(current->thread.regs->msr)) 314 + if (!MSR_TM_ACTIVE(cpumsr) && 315 + MSR_TM_ACTIVE(current->thread.regs->msr)) 310 316 return; 311 317 __giveup_altivec(current); 312 318 } ··· 393 397 * giveup as this would save to the 'live' structure not the 394 398 * checkpointed structure. 395 399 */ 396 - if(!msr_tm_active(cpumsr) && msr_tm_active(current->thread.regs->msr)) 400 + if (!MSR_TM_ACTIVE(cpumsr) && 401 + MSR_TM_ACTIVE(current->thread.regs->msr)) 397 402 return; 398 403 __giveup_vsx(current); 399 404 } ··· 527 530 { 528 531 unsigned long msr; 529 532 530 - if (!msr_tm_active(regs->msr) && 533 + if (!MSR_TM_ACTIVE(regs->msr) && 531 534 !current->thread.load_fp && !loadvec(current->thread)) 532 535 return; 533 536