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

Configure Feed

Select the types of activity you want to include in your feed.

powerpc: mark more local variables as volatile

A while ago I created a2305e3de8193 ("powerpc: mark local variables
around longjmp as volatile") in order to allow building powerpc with
-Wextra enabled on gcc-11.

I tried this again with gcc-13 and found two more of the same issues,
presumably based on slightly different optimization paths being taken
here:

arch/powerpc/xmon/xmon.c:3306:27: error: variable 'mm' might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered]
arch/powerpc/kexec/crash.c:353:22: error: variable 'i' might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered]

I checked a bunch of randconfigs and found only these two, so just
address them the same way as the others.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230809131024.2039647-1-arnd@kernel.org

authored by

Arnd Bergmann and committed by
Michael Ellerman
0f7ce21a 0b5e06e9

+2 -2
+1 -1
arch/powerpc/kexec/crash.c
··· 350 350 351 351 void default_machine_crash_shutdown(struct pt_regs *regs) 352 352 { 353 - unsigned int i; 353 + volatile unsigned int i; 354 354 int (*old_handler)(struct pt_regs *regs); 355 355 356 356 if (TRAP(regs) == INTERRUPT_SYSTEM_RESET)
+1 -1
arch/powerpc/xmon/xmon.c
··· 3303 3303 { 3304 3304 unsigned long tskv = 0; 3305 3305 struct task_struct *volatile tsk = NULL; 3306 - struct mm_struct *mm; 3306 + struct mm_struct *volatile mm; 3307 3307 pgd_t *pgdp; 3308 3308 p4d_t *p4dp; 3309 3309 pud_t *pudp;