From bunk@kernel.org Thu Oct 25 11:23:27 2007 From: Adrian Bunk Date: Wed, 24 Oct 2007 18:25:00 +0200 Subject: PCI Hotplug: cpqhp_pushbutton_thread(): remove a pointless if() check To: gregkh@suse.de Cc: linux-kernel@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz Message-ID: <20071024162500.GS30533@stusta.de> Content-Disposition: inline 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 Signed-off-by: Greg Kroah-Hartman --- drivers/pci/hotplug/cpqphp_ctrl.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) --- a/drivers/pci/hotplug/cpqphp_ctrl.c +++ b/drivers/pci/hotplug/cpqphp_ctrl.c @@ -1931,16 +1931,14 @@ void cpqhp_pushbutton_thread(unsigned lo 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;