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

elf_fdpic: fix unused variable warning

The elf_fdpic code shows a harmless warning when built with MMU disabled,
I ran into this now that fdpic is available on ARM randconfig builds
since commit 50b2b2e691cd ("ARM: add ELF_FDPIC support").

fs/binfmt_elf_fdpic.c: In function 'elf_fdpic_dump_segments':
fs/binfmt_elf_fdpic.c:1501:17: error: unused variable 'addr' [-Werror=unused-variable]

This adds another #ifdef around the variable declaration to shut up
the warning.

Fixes: e6c1baa9b562 ("convert the rest of binfmt_elf_fdpic to dump_emit()")
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

authored by

Arnd Bergmann and committed by
Al Viro
11e3e8d6 c645b930

+2
+2
fs/binfmt_elf_fdpic.c
··· 1489 1489 struct vm_area_struct *vma; 1490 1490 1491 1491 for (vma = current->mm->mmap; vma; vma = vma->vm_next) { 1492 + #ifdef CONFIG_MMU 1492 1493 unsigned long addr; 1494 + #endif 1493 1495 1494 1496 if (!maydump(vma, cprm->mm_flags)) 1495 1497 continue;