ChangeSet 1.1587.12.73, 2004/04/30 15:24:15-07:00, eike-hotplug@sf-tec.de [PATCH] SHPC PCI Hotplug: kill useless NULL checks drivers/pci/hotplug/shpchp_core.c | 35 +++-------------------------------- 1 files changed, 3 insertions(+), 32 deletions(-) diff -Nru a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c --- a/drivers/pci/hotplug/shpchp_core.c Mon May 17 16:58:17 2004 +++ b/drivers/pci/hotplug/shpchp_core.c Mon May 17 16:58:17 2004 @@ -240,15 +240,11 @@ { struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); - if (slot == NULL) - return -ENODEV; - dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); hotplug_slot->info->attention_status = status; slot->hpc_ops->set_attention_status(slot, status); - return 0; } @@ -256,9 +252,6 @@ static int enable_slot (struct hotplug_slot *hotplug_slot) { struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); - - if (slot == NULL) - return -ENODEV; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); @@ -269,9 +262,6 @@ static int disable_slot (struct hotplug_slot *hotplug_slot) { struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); - - if (slot == NULL) - return -ENODEV; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); @@ -282,10 +272,7 @@ { struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); int retval; - - if (slot == NULL) - return -ENODEV; - + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); retval = slot->hpc_ops->get_power_status(slot, value); @@ -299,10 +286,7 @@ { struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); int retval; - - if (slot == NULL) - return -ENODEV; - + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); retval = slot->hpc_ops->get_attention_status(slot, value); @@ -316,10 +300,7 @@ { struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); int retval; - - if (slot == NULL) - return -ENODEV; - + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); retval = slot->hpc_ops->get_latch_status(slot, value); @@ -333,14 +314,10 @@ { struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); int retval; - - if (slot == NULL) - return -ENODEV; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); retval = slot->hpc_ops->get_adapter_status(slot, value); - if (retval < 0) *value = hotplug_slot->info->adapter_status; @@ -351,9 +328,6 @@ { struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); int retval; - - if (slot == NULL) - return -ENODEV; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); @@ -368,9 +342,6 @@ { struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); int retval; - - if (slot == NULL) - return -ENODEV; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);