linux-stable-rt/drivers/pci/hotplug
Julia Lawall b8d9cb2a22 PCI hotplug: remove redundant test in cpq hotplug
func is checked not to be NULL a few lines before.

A simplified version of the semantic patch that makes this change is as
follows: (http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
expression E;
position p1,p2;
@@

if (x@p1 == NULL || ...) { ... when forall
   return ...; }
... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\)
(
x@p2 == NULL
|
x@p2 != NULL
)

// another path to the test that is not through p1?
@s exists@
local idexpression r.x;
position r.p1,r.p2;
@@

... when != x@p1
(
x@p2 == NULL
|
x@p2 != NULL
)

@fix depends on !s@
position r.p1,r.p2;
expression x,E;
statement S1,S2;
@@

(
- if ((x@p2 != NULL) || ...)
  S1
|
- if ((x@p2 == NULL) && ...) S1
|
- BUG_ON(x@p2 == NULL);
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:22 -08:00
..
Kconfig
Makefile PCI: pciehp: add ACPI based slot detection 2009-01-07 11:13:10 -08:00
acpi_pcihp.c PCI hotplug: introduce functions for ACPI slot detection 2009-01-07 11:13:11 -08:00
acpiphp.h PCI hotplug: acpiphp whitespace cleanup 2009-01-07 11:12:42 -08:00
acpiphp_core.c
acpiphp_glue.c PCI hotplug: introduce functions for ACPI slot detection 2009-01-07 11:13:11 -08:00
acpiphp_ibm.c
cpci_hotplug.h
cpci_hotplug_core.c
cpci_hotplug_pci.c
cpcihp_generic.c
cpcihp_zt5550.c
cpcihp_zt5550.h
cpqphp.h
cpqphp_core.c
cpqphp_ctrl.c PCI hotplug: remove redundant test in cpq hotplug 2009-01-07 11:13:22 -08:00
cpqphp_nvram.c
cpqphp_nvram.h
cpqphp_pci.c PCI hotplug: cpqphp: use config space PCI interrupt pin encoding 2009-01-07 11:12:47 -08:00
cpqphp_sysfs.c
fakephp.c drivers/pci/hotplug: Add missing pci_dev_get 2009-01-07 11:12:33 -08:00
ibmphp.h
ibmphp_core.c
ibmphp_ebda.c
ibmphp_hpc.c
ibmphp_pci.c
ibmphp_res.c
pci_hotplug_core.c
pciehp.h PCI: pciehp: add ACPI based slot detection 2009-01-07 11:13:10 -08:00
pciehp_acpi.c PCI hotplug: introduce functions for ACPI slot detection 2009-01-07 11:13:11 -08:00
pciehp_core.c PCI: pciehp: add ACPI based slot detection 2009-01-07 11:13:10 -08:00
pciehp_ctrl.c
pciehp_hpc.c PCI: pciehp: cleanup register and field definitions 2009-01-07 11:13:22 -08:00
pciehp_pci.c
pcihp_skeleton.c
rpadlpar.h
rpadlpar_core.c
rpadlpar_sysfs.c
rpaphp.h
rpaphp_core.c
rpaphp_pci.c
rpaphp_slot.c
sgi_hotplug.c
shpchp.h
shpchp_core.c
shpchp_ctrl.c
shpchp_hpc.c
shpchp_pci.c
shpchp_sysfs.c