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

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

+6 -1
+4
arch/powerpc/include/asm/switch_to.h
··· 48 48 #else 49 49 static inline void save_fpu(struct task_struct *t) { } 50 50 static inline void flush_fp_to_thread(struct task_struct *t) { } 51 + static inline void enable_kernel_fp(void) 52 + { 53 + BUILD_BUG(); 54 + } 51 55 #endif 52 56 53 57 #ifdef CONFIG_ALTIVEC
+2 -1
arch/powerpc/platforms/83xx/suspend.c
··· 206 206 out_be32(&pmc_regs->config1, 207 207 in_be32(&pmc_regs->config1) | PMCCR1_POWER_OFF); 208 208 209 - enable_kernel_fp(); 209 + if (IS_ENABLED(CONFIG_PPC_FPU)) 210 + enable_kernel_fp(); 210 211 211 212 mpc83xx_enter_deep_sleep(immrbase); 212 213