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: Remove variable ‘path’ since not used

In commit eab00a208eb6 ("powerpc: Move `path` variable inside
DEBUG_PROM") DEBUG_PROM sentinels were added to silence a warning
(treated as error with W=1):

arch/powerpc/kernel/prom_init.c:1388:8: error: variable ‘path’ set but not used [-Werror=unused-but-set-variable]

Rework the original patch and simplify the code, by removing the
variable ‘path’ completely. Fix line over 90 characters.

Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Mathieu Malaterre <malat@debian.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Mathieu Malaterre and committed by
Michael Ellerman
c806a6fd 89d87bcb

+4 -9
+4 -9
arch/powerpc/kernel/prom_init.c
··· 1566 1566 static void __init prom_init_mem(void) 1567 1567 { 1568 1568 phandle node; 1569 - #ifdef DEBUG_PROM 1570 - char *path; 1571 - #endif 1572 1569 char type[64]; 1573 1570 unsigned int plen; 1574 1571 cell_t *p, *endp; ··· 1587 1590 prom_debug("root_size_cells: %x\n", rsc); 1588 1591 1589 1592 prom_debug("scanning memory:\n"); 1590 - #ifdef DEBUG_PROM 1591 - path = prom_scratch; 1592 - #endif 1593 1593 1594 1594 for (node = 0; prom_next_node(&node); ) { 1595 1595 type[0] = 0; ··· 1611 1617 endp = p + (plen / sizeof(cell_t)); 1612 1618 1613 1619 #ifdef DEBUG_PROM 1614 - memset(path, 0, sizeof(prom_scratch)); 1615 - call_prom("package-to-path", 3, 1, node, path, sizeof(prom_scratch) - 1); 1616 - prom_debug(" node %s :\n", path); 1620 + memset(prom_scratch, 0, sizeof(prom_scratch)); 1621 + call_prom("package-to-path", 3, 1, node, prom_scratch, 1622 + sizeof(prom_scratch) - 1); 1623 + prom_debug(" node %s :\n", prom_scratch); 1617 1624 #endif /* DEBUG_PROM */ 1618 1625 1619 1626 while ((endp - p) >= (rac + rsc)) {