ChangeSet 1.1587.12.53, 2004/04/30 14:49:55-07:00, eike-hotplug@sf-tec.de

[PATCH] Compaq PCI Hotplug: remove useless NULL checks from cpqphp_ctrl.c

Remove useless NULL checks from cpqphp_ctrl.c. Under normal circumstances
there is no chance for any of this functions to get called with a NULL
argument. If we are in such trouble that we get a NULL pointer don't hide it,
just oops.


 drivers/pci/hotplug/cpqphp_ctrl.c |   21 +--------------------
 1 files changed, 1 insertion(+), 20 deletions(-)


diff -Nru a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c
--- a/drivers/pci/hotplug/cpqphp_ctrl.c	Mon May 17 17:00:34 2004
+++ b/drivers/pci/hotplug/cpqphp_ctrl.c	Mon May 17 17:00:34 2004
@@ -478,15 +478,14 @@
 	/* Now unlink it */
 	if (*head == node) {
 		*head = node->next;
-		node->next = NULL;
 	} else {
 		prevnode = *head;
 		while (prevnode->next != node)
 			prevnode = prevnode->next;
 
 		prevnode->next = node->next;
-		node->next = NULL;
 	}
+	node->next = NULL;
 
 	return node;
 }
@@ -503,9 +502,6 @@
 	u32 rc;
 	u32 temp_dword;
 
-	if (!(*head))
-		return NULL;
-
 	rc = cpqhp_resource_sort_and_combine(head);
 
 	if (rc)
@@ -654,9 +650,6 @@
 	struct pci_resource *split_node;
 	u32 temp_dword;
 
-	if (!(*head))
-		return NULL;
-
 	if (cpqhp_resource_sort_and_combine(head))
 		return NULL;
 
@@ -751,9 +744,6 @@
 	struct pci_resource *split_node;
 	u32 temp_dword;
 
-	if (!(*head))
-		return NULL;
-
 	if (cpqhp_resource_sort_and_combine(head))
 		return NULL;
 
@@ -1062,9 +1052,6 @@
 	u8 tempBus;
 	struct pci_func *next;
 
-	if (bridge == NULL)
-		return 1;
-
 	secondaryBus = (bridge->config_space[0x06] >> 8) & 0xFF;
 	subordinateBus = (bridge->config_space[0x06] >> 16) & 0xFF;
 
@@ -1700,9 +1687,6 @@
 	struct resource_lists res_lists;
 	struct pci_func *temp_func;
 
-	if (func == NULL)
-		return 1;
-
 	if (cpqhp_unconfigure_device(func))
 		return 1;
 
@@ -2080,9 +2064,6 @@
 	int rc;
 	struct slot* p_slot;
 	int physical_slot = 0;
-
-	if (!ctrl)
-		return 1;
 
 	tempdword = 0;
 
