ChangeSet 1.1587.12.89, 2004/05/11 14:50:43-07:00, lcapitulino@prefeitura.sp.gov.br

[PATCH] PCI Hotplug: fix wrong var used in hotplug/shpchp_ctrl.c.

Zhenmin's checker tool <zli4@cs.uiuc.edu> detected this:

 9. /drivers/pci/hotplug/shpchp_ctrl.c, Line 1575:
 err("%s: Failed to disable slot, error code(%d)\n", __FUNCTION__, rc);

 Maybe change to:
 err("%s: Failed to disable slot, error code(%d)\n", __FUNCTION__,
 retval);

 I think it is right because at line 1564, the slot is turned off, and
in this line (1575) is checked the status to see if we got an error; if
so, the error number is shown. This number is in 'retval', not in 'rc'
('rc' does have the return of configure_new_device()).

 The patch bellow fixes that:


 drivers/pci/hotplug/shpchp_ctrl.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


diff -Nru a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c
--- a/drivers/pci/hotplug/shpchp_ctrl.c	Mon May 17 16:56:46 2004
+++ b/drivers/pci/hotplug/shpchp_ctrl.c	Mon May 17 16:56:46 2004
@@ -1573,7 +1573,7 @@
 
 			retval = p_slot->hpc_ops->check_cmd_status(ctrl);
 			if (retval) {
-				err("%s: Failed to disable slot, error code(%d)\n", __FUNCTION__, rc);
+				err("%s: Failed to disable slot, error code(%d)\n", __FUNCTION__, retval);
 				/* Done with exclusive hardware access */
 				up(&ctrl->crit_sect);
 				return retval;  
