lkml.org 
[lkml]   [2008]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateTue, 14 Oct 2008 17:59:50 +0200 (CEST)
FromJulia Lawall <>
Subject[PATCH 1/2] drivers/pci/hotplug/cpqphp_ctrl.c: Convert && to ||
From: Julia Lawall <julia@diku.dk>

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/)

// <smpl>
@disable and_comm@
expression E;
identifier fld;
@@

- !E && !E->fld
+ !E || !E->fld
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>

---
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;

\
 
 \ /
  Last update: 2008-10-14 18:03    [from the cache]
©2003-2010