]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
PCI: ibmphp: Remove unused assignments
authorBjorn Helgaas <bhelgaas@google.com>
Sun, 13 Mar 2022 19:29:33 +0000 (14:29 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 22 Mar 2022 16:24:48 +0000 (11:24 -0500)
Remove variables and assignments that are never used.

Found by Krzysztof using cppcheck, e.g.:

  $ cppcheck --enable=all --force
  unreadVariable drivers/pci/hotplug/ibmphp_res.c:1958 Variable 'bus_sec' is assigned a value that is never used.

Reported-by: Krzysztof WilczyƄski <kw@linux.com>
Link: https://lore.kernel.org/r/20220313192933.434746-6-helgaas@kernel.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/hotplug/ibmphp_hpc.c
drivers/pci/hotplug/ibmphp_res.c

index 508a62a6b5f9da4088e1dd963e619f717c8cc645..a5720d12e573237cb8cae77af8f1c0163837fbbb 100644 (file)
@@ -325,11 +325,9 @@ static u8 i2c_ctrl_write(struct controller *ctlr_ptr, void __iomem *WPGBbar, u8
 static u8 isa_ctrl_read(struct controller *ctlr_ptr, u8 offset)
 {
        u16 start_address;
-       u16 end_address;
        u8 data;
 
        start_address = ctlr_ptr->u.isa_ctlr.io_start;
-       end_address = ctlr_ptr->u.isa_ctlr.io_end;
        data = inb(start_address + offset);
        return data;
 }
index ae9acc77d14f1def561e80112a4b414f1c9af1b8..4a72ade2cddb4c351bc5b86b72dec114859fad50 100644 (file)
@@ -1955,7 +1955,7 @@ static int __init update_bridge_ranges(struct bus_node **bus)
                                                bus_sec = find_bus_wprev(sec_busno, NULL, 0);
                                                /* this bus structure doesn't exist yet, PPB was configured during previous loading of ibmphp */
                                                if (!bus_sec) {
-                                                       bus_sec = alloc_error_bus(NULL, sec_busno, 1);
+                                                       alloc_error_bus(NULL, sec_busno, 1);
                                                        /* the rest will be populated during NVRAM call */
                                                        return 0;
                                                }
@@ -2114,6 +2114,5 @@ static int __init update_bridge_ranges(struct bus_node **bus)
                }       /* end for function */
        }       /* end for device */
 
-       bus = &bus_cur;
        return 0;
 }