powerpc/process: Remove useless #ifdef CONFIG_PPC_FPU
Add a stub for __giveup_fpu() when CONFIG_PPC_FPU is not selected, as done for CONFIG_SPE and CONFIG_ALTIVEC. This allows to remove some #ifdef CONFIG_PPC_FPU. Also change one to IS_ENABLED(). Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/69c8b7954ceeccc6b849e52e1fa41b3a0f10f6c1.1597643221.git.christophe.leroy@csgroup.eu
This commit is contained in:
committed by
Michael Ellerman
parent
532ed1900d
commit
c83c192a6f
@@ -229,6 +229,8 @@ void enable_kernel_fp(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(enable_kernel_fp);
|
EXPORT_SYMBOL(enable_kernel_fp);
|
||||||
|
#else
|
||||||
|
static inline void __giveup_fpu(struct task_struct *tsk) { }
|
||||||
#endif /* CONFIG_PPC_FPU */
|
#endif /* CONFIG_PPC_FPU */
|
||||||
|
|
||||||
#ifdef CONFIG_ALTIVEC
|
#ifdef CONFIG_ALTIVEC
|
||||||
@@ -406,9 +408,8 @@ static unsigned long msr_all_available;
|
|||||||
|
|
||||||
static int __init init_msr_all_available(void)
|
static int __init init_msr_all_available(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_PPC_FPU
|
if (IS_ENABLED(CONFIG_PPC_FPU))
|
||||||
msr_all_available |= MSR_FP;
|
msr_all_available |= MSR_FP;
|
||||||
#endif
|
|
||||||
if (cpu_has_feature(CPU_FTR_ALTIVEC))
|
if (cpu_has_feature(CPU_FTR_ALTIVEC))
|
||||||
msr_all_available |= MSR_VEC;
|
msr_all_available |= MSR_VEC;
|
||||||
if (cpu_has_feature(CPU_FTR_VSX))
|
if (cpu_has_feature(CPU_FTR_VSX))
|
||||||
@@ -438,10 +439,8 @@ void giveup_all(struct task_struct *tsk)
|
|||||||
|
|
||||||
WARN_ON((usermsr & MSR_VSX) && !((usermsr & MSR_FP) && (usermsr & MSR_VEC)));
|
WARN_ON((usermsr & MSR_VSX) && !((usermsr & MSR_FP) && (usermsr & MSR_VEC)));
|
||||||
|
|
||||||
#ifdef CONFIG_PPC_FPU
|
|
||||||
if (usermsr & MSR_FP)
|
if (usermsr & MSR_FP)
|
||||||
__giveup_fpu(tsk);
|
__giveup_fpu(tsk);
|
||||||
#endif
|
|
||||||
if (usermsr & MSR_VEC)
|
if (usermsr & MSR_VEC)
|
||||||
__giveup_altivec(tsk);
|
__giveup_altivec(tsk);
|
||||||
if (usermsr & MSR_SPE)
|
if (usermsr & MSR_SPE)
|
||||||
|
|||||||
Reference in New Issue
Block a user