Browse Source

PCI Hotplug: cpqhp_pushbutton_thread(): remove a pointless if() check

The Coverity checker spotted that we'd have already oops'ed if "ctrl"
was NULL.

Additionally, "func" had just been checked for not being NULL.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Adrian Bunk 17 năm trước cách đây
mục cha
commit
0039541088
1 tập tin đã thay đổi với 7 bổ sung9 xóa
  1. 7 9
      drivers/pci/hotplug/cpqphp_ctrl.c

+ 7 - 9
drivers/pci/hotplug/cpqphp_ctrl.c

@@ -1931,16 +1931,14 @@ void cpqhp_pushbutton_thread(unsigned long slot)
 			return ;
 			return ;
 		}
 		}
 
 
-		if (func != NULL && ctrl != NULL) {
-			if (cpqhp_process_SS(ctrl, func) != 0) {
-				amber_LED_on (ctrl, hp_slot);
-				green_LED_on (ctrl, hp_slot);
-				
-				set_SOGO(ctrl);
+		if (cpqhp_process_SS(ctrl, func) != 0) {
+			amber_LED_on(ctrl, hp_slot);
+			green_LED_on(ctrl, hp_slot);
 
 
-				/* Wait for SOBS to be unset */
-				wait_for_ctrl_irq (ctrl);
-			}
+			set_SOGO(ctrl);
+
+			/* Wait for SOBS to be unset */
+			wait_for_ctrl_irq(ctrl);
 		}
 		}
 
 
 		p_slot->state = STATIC_STATE;
 		p_slot->state = STATIC_STATE;