Skip to content

Commit c2e5d70

Browse files
committed
powerpc/83xx: Fix build failure with FPU=n
Building eg. 83xx/mpc832x_rdb_defconfig with FPU=n, fails with: arch/powerpc/platforms/83xx/suspend.c: In function 'mpc83xx_suspend_enter': arch/powerpc/platforms/83xx/suspend.c:209:17: error: implicit declaration of function 'enable_kernel_fp' 209 | enable_kernel_fp(); Fix it by providing an enable_kernel_fp() stub for FPU=n builds, which allows using IS_ENABLED(CONFIG_PPC_FPU) around the call to enable_kernel_fp(). Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20240306125853.3714578-2-mpe@ellerman.id.au
1 parent 329105c commit c2e5d70

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

arch/powerpc/include/asm/switch_to.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ static inline void disable_kernel_fp(void)
4848
#else
4949
static inline void save_fpu(struct task_struct *t) { }
5050
static inline void flush_fp_to_thread(struct task_struct *t) { }
51+
static inline void enable_kernel_fp(void)
52+
{
53+
BUILD_BUG();
54+
}
5155
#endif
5256

5357
#ifdef CONFIG_ALTIVEC

arch/powerpc/platforms/83xx/suspend.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ static int mpc83xx_suspend_enter(suspend_state_t state)
206206
out_be32(&pmc_regs->config1,
207207
in_be32(&pmc_regs->config1) | PMCCR1_POWER_OFF);
208208

209-
enable_kernel_fp();
209+
if (IS_ENABLED(CONFIG_PPC_FPU))
210+
enable_kernel_fp();
210211

211212
mpc83xx_enter_deep_sleep(immrbase);
212213

0 commit comments

Comments
 (0)