Commit eab00a20 authored by Mathieu Malaterre's avatar Mathieu Malaterre Committed by Michael Ellerman

powerpc: Move `path` variable inside DEBUG_PROM

Add gcc attribute unused for two variables. Fix warnings treated as errors
with W=1:

  arch/powerpc/kernel/prom_init.c:1388:8: error: variable ‘path’ set but not used [-Werror=unused-but-set-variable]
Suggested-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 618a89d7
...@@ -628,7 +628,7 @@ static void __init early_cmdline_parse(void) ...@@ -628,7 +628,7 @@ static void __init early_cmdline_parse(void)
const char *opt; const char *opt;
char *p; char *p;
int l = 0; int l __maybe_unused = 0;
prom_cmd_line[0] = 0; prom_cmd_line[0] = 0;
p = prom_cmd_line; p = prom_cmd_line;
...@@ -1421,7 +1421,10 @@ static void __init reserve_mem(u64 base, u64 size) ...@@ -1421,7 +1421,10 @@ static void __init reserve_mem(u64 base, u64 size)
static void __init prom_init_mem(void) static void __init prom_init_mem(void)
{ {
phandle node; phandle node;
char *path, type[64]; #ifdef DEBUG_PROM
char *path;
#endif
char type[64];
unsigned int plen; unsigned int plen;
cell_t *p, *endp; cell_t *p, *endp;
__be32 val; __be32 val;
...@@ -1442,7 +1445,9 @@ static void __init prom_init_mem(void) ...@@ -1442,7 +1445,9 @@ static void __init prom_init_mem(void)
prom_debug("root_size_cells: %x\n", rsc); prom_debug("root_size_cells: %x\n", rsc);
prom_debug("scanning memory:\n"); prom_debug("scanning memory:\n");
#ifdef DEBUG_PROM
path = prom_scratch; path = prom_scratch;
#endif
for (node = 0; prom_next_node(&node); ) { for (node = 0; prom_next_node(&node); ) {
type[0] = 0; type[0] = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment