Skip to content

Commit da9bef6

Browse files
Julia Lawallozbenh
Julia Lawall
authored andcommitted
powerpc/pci: Drop unnecessary null test
list_for_each_entry binds its first argument to a non-null value, and thus any null test on the value of that argument is superfluous. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ iterator I; expression x,E,E1,E2; statement S,S1,S2; @@ I(x,...) { <... - if (x != NULL || ...) S ...> } // </smpl> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
1 parent 5fba610 commit da9bef6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/powerpc/kernel/pci_of_scan.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,7 @@ static void __devinit __of_scan_bus(struct device_node *node,
336336
if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
337337
dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) {
338338
struct device_node *child = pci_device_to_OF_node(dev);
339-
if (dev)
340-
of_scan_pci_bridge(child, dev);
339+
of_scan_pci_bridge(child, dev);
341340
}
342341
}
343342
}

0 commit comments

Comments
 (0)