[PATCH] PCI: Reduce nr of ptr derefs in drivers/pci/hotplug/rpaphp_pci.c
Here's a small patch to reduce the nr. of pointer dereferences in drivers/pci/hotplug/rpaphp_pci.c Benefits: - micro speed optimization due to fewer pointer derefs - generated code should be slightly smaller - better readability note: due to lack of both hardware and cross-compile tools this patch is, unfortunately, completely untested. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
efbf62e9f4
commit
f5c99dfc11
@@ -336,13 +336,14 @@ EXPORT_SYMBOL_GPL(rpaphp_unconfig_pci_adapter);
|
|||||||
|
|
||||||
static int setup_pci_hotplug_slot_info(struct slot *slot)
|
static int setup_pci_hotplug_slot_info(struct slot *slot)
|
||||||
{
|
{
|
||||||
|
struct hotplug_slot_info *hotplug_slot_info = slot->hotplug_slot->info;
|
||||||
|
|
||||||
dbg("%s Initilize the PCI slot's hotplug->info structure ...\n",
|
dbg("%s Initilize the PCI slot's hotplug->info structure ...\n",
|
||||||
__FUNCTION__);
|
__FUNCTION__);
|
||||||
rpaphp_get_power_status(slot, &slot->hotplug_slot->info->power_status);
|
rpaphp_get_power_status(slot, &hotplug_slot_info->power_status);
|
||||||
rpaphp_get_pci_adapter_status(slot, 1,
|
rpaphp_get_pci_adapter_status(slot, 1,
|
||||||
&slot->hotplug_slot->info->
|
&hotplug_slot_info->adapter_status);
|
||||||
adapter_status);
|
if (hotplug_slot_info->adapter_status == NOT_VALID) {
|
||||||
if (slot->hotplug_slot->info->adapter_status == NOT_VALID) {
|
|
||||||
err("%s: NOT_VALID: skip dn->full_name=%s\n",
|
err("%s: NOT_VALID: skip dn->full_name=%s\n",
|
||||||
__FUNCTION__, slot->dn->full_name);
|
__FUNCTION__, slot->dn->full_name);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
Reference in New Issue
Block a user