public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drivers/pci/hotplug/cpqphp_ctrl.c: Convert && to ||
@ 2008-10-14 15:59 Julia Lawall
  2008-10-14 16:25 ` Re : " Frédéric Weisbecker
  2008-10-14 18:51 ` Matthew Wilcox
  0 siblings, 2 replies; 3+ messages in thread
From: Julia Lawall @ 2008-10-14 15:59 UTC (permalink / raw)
  To: kristen.c.accardi, linux-pci, linux-kernel, kernel-janitors

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;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-10-14 18:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-14 15:59 [PATCH 1/2] drivers/pci/hotplug/cpqphp_ctrl.c: Convert && to || Julia Lawall
2008-10-14 16:25 ` Re : " Frédéric Weisbecker
2008-10-14 18:51 ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox