* [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* Re : [PATCH 1/2] drivers/pci/hotplug/cpqphp_ctrl.c: Convert && to ||
2008-10-14 15:59 [PATCH 1/2] drivers/pci/hotplug/cpqphp_ctrl.c: Convert && to || Julia Lawall
@ 2008-10-14 16:25 ` Frédéric Weisbecker
2008-10-14 18:51 ` Matthew Wilcox
1 sibling, 0 replies; 3+ messages in thread
From: Frédéric Weisbecker @ 2008-10-14 16:25 UTC (permalink / raw)
To: Julia Lawall; +Cc: kristen.c.accardi, linux-pci, linux-kernel, kernel-janitors
2008/10/14, Julia Lawall <julia@diku.dk>:
> From: Julia Lawall <julia@diku.dk>
> 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>
>
What a great tool. :)
I guess you gathered a lot of precious patterns since the creation of
coccinelle!
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] drivers/pci/hotplug/cpqphp_ctrl.c: Convert && to ||
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
1 sibling, 0 replies; 3+ messages in thread
From: Matthew Wilcox @ 2008-10-14 18:51 UTC (permalink / raw)
To: Julia Lawall; +Cc: kristen.c.accardi, linux-pci, linux-kernel, kernel-janitors
On Tue, Oct 14, 2008 at 05:59:50PM +0200, Julia Lawall wrote:
> 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.
>
> Signed-off-by: Julia Lawall <julia@diku.dk>
I think that's the right solution for this case.
Reviewed-by: Matthew Wilcox <willy@linux.intel.com>
--
Matthew Wilcox Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
^ 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