Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753352AbYJNQAG (ORCPT ); Tue, 14 Oct 2008 12:00:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751703AbYJNP7z (ORCPT ); Tue, 14 Oct 2008 11:59:55 -0400 Received: from mgw1.diku.dk ([130.225.96.91]:54507 "EHLO mgw1.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751664AbYJNP7y (ORCPT ); Tue, 14 Oct 2008 11:59:54 -0400 Date: Tue, 14 Oct 2008 17:59:50 +0200 (CEST) From: Julia Lawall To: kristen.c.accardi@intel.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 1/2] drivers/pci/hotplug/cpqphp_ctrl.c: Convert && to || Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1347 Lines: 42 From: Julia Lawall The pattern !E && !E->fld is nonsensical. The patch below updates this according to the assumption that && should be ||. But perhaps another solution was intended. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @disable and_comm@ expression E; identifier fld; @@ - !E && !E->fld + !E || !E->fld // Signed-off-by: Julia Lawall --- drivers/pci/hotplug/cpqphp_ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -u -p a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c --- a/drivers/pci/hotplug/cpqphp_ctrl.c +++ b/drivers/pci/hotplug/cpqphp_ctrl.c @@ -1139,7 +1139,7 @@ static u8 set_controller_speed(struct co for(slot = ctrl->slot; slot; slot = slot->next) { if (slot->device == (hp_slot + ctrl->slot_device_offset)) continue; - if (!slot->hotplug_slot && !slot->hotplug_slot->info) + if (!slot->hotplug_slot || !slot->hotplug_slot->info) continue; if (slot->hotplug_slot->info->adapter_status == 0) continue; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/