From kristen.c.accardi@intel.com Fri Apr 13 15:34:20 2007 From: Linas Vepstas Date: Fri, 13 Apr 2007 15:34:19 -0700 Subject: [patch 13/21] PCI: rpaphp: refactor tail call to rpaphp_register_slot() To: gregkh@suse.de Message-ID: <20070413223420.497569109@intel.com> Content-Disposition: inline; filename=pci-rpaphp-refactor-tail-call-to-rpaphp_register_slot From: Linas Vepstas Eliminate the tail call to rpaphp_register_slot() by placing it in the caller. This will help later dis-entanglement. Signed-off-by: Linas Vepstas Cc: John Rose Signed-off-by: Kristen Carlson Accardi Signed-off-by: Greg Kroah-Hartman --- drivers/pci/hotplug/rpaphp_core.c | 3 +++ drivers/pci/hotplug/rpaphp_pci.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) --- a/drivers/pci/hotplug/rpaphp_core.c +++ b/drivers/pci/hotplug/rpaphp_core.c @@ -319,6 +319,9 @@ int rpaphp_add_slot(struct device_node * indexes[i + 1], name, type); retval = rpaphp_register_pci_slot(slot); + if (!retval) + retval = rpaphp_register_slot(slot); + if (retval) dealloc_slot_struct(slot); --- a/drivers/pci/hotplug/rpaphp_pci.c +++ b/drivers/pci/hotplug/rpaphp_pci.c @@ -136,6 +136,6 @@ int rpaphp_register_pci_slot(struct slot } } - return rpaphp_register_slot(slot); + return 0; }