From: Julia Lawall <hidden> Date: 2010-08-03 21:35:20
From: Julia Lawall <redacted>
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 <redacted>
---
arch/powerpc/kernel/pci_of_scan.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
The intention was probably to check "child" instead of "dev".
pci_device_to_OF_node() can return NULL. On the other hand the code
has been this way for a year and no one has complained...
regards,
dan carpenter
The intention was probably to check "child" instead of "dev".
pci_device_to_OF_node() can return NULL. =A0On the other hand the code
has been this way for a year and no one has complained...
Still, it should be fixed. It is likely that I'll be generalizing
this code for other architectures in the near future. I'll spin a
patch.
g.