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

selftests/powerpc: Fix uninitialized variable warning

Patch fixes uninitialized variable warning in bad_accesses test
which causes the selftests build to fail in older distibutions

bad_accesses.c: In function ‘bad_access’:
bad_accesses.c:52:9: error: ‘x’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
printf("Bad - no SEGV! (%c)\n", x);
^
cc1: all warnings being treated as errors

Signed-off-by: Harish <harish@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201201092403.238182-1-harish@linux.ibm.com

authored by

Harish and committed by
Michael Ellerman
c9344769 f0812f6c

+1 -1
+1 -1
tools/testing/selftests/powerpc/mm/bad_accesses.c
··· 38 38 39 39 int bad_access(char *p, bool write) 40 40 { 41 - char x; 41 + char x = 0; 42 42 43 43 fault_code = 0; 44 44 fault_addr = 0;