All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/14] adjust duplicate test
@ 2013-01-21 13:02 ` Julia Lawall
  0 siblings, 0 replies; 65+ messages in thread
From: Julia Lawall @ 2013-01-21 12:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: kernel-janitors

These patches fix cases where a value is tested that was previously
tested.  Often the problem is that the tested value has not been updated
properly.  Sometimes the test is simply duplicated.  These problems were
found using the following semantic match (http://coccinelle.lip6.fr/):

// <smpl>
@r exists@
expression e1,e2;
identifier f,g;
position p1,p2;
@@

if@p1 ( \(e1->f = NULL\|IS_ERR(e1->f)\) ) { ... when forall
   return ...; }
... when != \(e1->f = e2\|e1->f += e2\|e1->f -= e2\|e1->f |= e2\|e1->f &= e2\|e1->f++\|e1->f--\|g(...,e1,...)\)
if@p2 ( \(e1->f = NULL\|IS_ERR(e1->f)\) ) { ... when forall
   return ...; }

@rsame exists@
expression e;
position r.p1,r.p2;
statement S1,S2;
@@

if@p1 ( e ) S1
... when any
if@p2 ( e ) S2

@rok depends on rsame exists@
expression e1,e2;
identifier f;
position r.p1,r.p2;
statement S1,S2;
@@

if@p1 ( \(e1->f = NULL\|IS_ERR(e1->f)\) ) S1
... when any
 \(e1->f = e2\|e1->f += e2\|e1->f -= e2\|e1->f |= e2\|e1->f &= e2\|e1->f++\|e1->f--\|g(...,e1,...)\)
... when any
if@p2 ( ... ) S2

@rother depends on rsame exists@
position r.p1,r.p2;
statement S;
@@

... when != if@p1 (...) S
if@p2 ( ... ) { ... return ...; }

@script:python depends on rsame && !rok && !rother@
p1 << r.p1;
p2 << r.p2;
@@

if (p1[0].line != p2[0].line):
  cocci.print_main("",p1)
  cocci.print_secs("",p2)

@s exists@
local idexpression y;
expression e;
position p1,p2;
@@


if@p1 ( \(y = NULL\|IS_ERR(y)\|y != 0\) ) { ... when forall
   return ...; }
... when != \(y = e\|y += e\|y -= e\|y |= e\|y &= e\|y++\|y--\|&y\|XT_GETPAGE(...,y)\|WMI_CMD_BUF(...)\)
if@p2 ( \(y = NULL\|IS_ERR(y)\|y != 0\) ) { ... when forall
   return ...; }

@ssame exists@
expression e;
position s.p1,s.p2;
statement S1,S2;
@@

if@p1 ( e ) S1
... when any
if@p2 ( e ) S2

@sok depends on ssame exists@
local idexpression y;
expression e;
position s.p1,s.p2;
statement S1,S2;
@@

if@p1 ( \(y = NULL\|IS_ERR(y)\|y != 0\) ) S1
... when any
 \(y = e\|y += e\|y -= e\|y |= e\|y &= e\|y++\|y--\|&y\|XT_GETPAGE(...,y)\|WMI_CMD_BUF(...)\)
... when any
if@p2 ( ... ) S2

@sother depends on ssame exists@
position s.p1,s.p2;
statement S;
@@

... when != if@p1 (...) S
if@p2 ( ... ) { ... return ...; }

@script:python depends on ssame && !sok && !sother@
p1 << s.p1;
p2 << s.p2;
@@

if (p1[0].line != p2[0].line):
  cocci.print_main("",p1)
  cocci.print_secs("",p2)

// </smpl>


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

end of thread, other threads:[~2013-02-15 20:03 UTC | newest]

Thread overview: 65+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-21 12:03 [PATCH 0/14] adjust duplicate test Julia Lawall
2013-01-21 13:02 ` Julia Lawall
2013-01-21 12:03 ` [PATCH 11/15] tools/lib/traceevent/event-parse.c: " Julia Lawall
2013-01-21 13:02   ` Julia Lawall
2013-01-23 14:42   ` Steven Rostedt
2013-01-23 14:42     ` Steven Rostedt
2013-01-23 21:56     ` Arnaldo Carvalho de Melo
2013-01-23 21:56       ` Arnaldo Carvalho de Melo
2013-01-21 12:12 ` [PATCH 5/15] drivers/scsi/bnx2fc/bnx2fc_io.c: " Julia Lawall
2013-01-21 13:02   ` Julia Lawall
2013-01-21 23:05   ` Bhanu Prakash Gollapudi
2013-01-21 23:05     ` Bhanu Prakash Gollapudi
2013-01-21 12:12 ` [PATCH 4/15] drivers/net/ethernet/sfc/ptp.c: " Julia Lawall
2013-01-21 13:02   ` Julia Lawall
2013-01-21 19:47   ` Ben Hutchings
2013-01-21 19:47     ` Ben Hutchings
2013-01-21 20:45   ` David Miller
2013-01-21 20:45     ` David Miller
2013-01-21 12:13 ` [PATCH 7/15] drivers/crypto/atmel-aes.c: " Julia Lawall
2013-01-21 13:02   ` Julia Lawall
2013-01-21 13:02   ` Julia Lawall
2013-01-21 18:19   ` David Miller
2013-01-21 18:19     ` David Miller
2013-01-21 18:19     ` David Miller
2013-02-04 13:21     ` Herbert Xu
2013-02-04 13:21       ` Herbert Xu
2013-02-04 13:21       ` Herbert Xu
2013-01-21 12:13 ` [PATCH 8/15] arch/powerpc/platforms/85xx/p1022_ds.c: " Julia Lawall
2013-01-21 13:02   ` Julia Lawall
2013-01-21 13:02   ` Julia Lawall
2013-02-15 20:02   ` Kumar Gala
2013-02-15 20:02     ` Kumar Gala
2013-02-15 20:02     ` Kumar Gala
2013-01-21 12:13 ` [PATCH 12/15] fs/hostfs/hostfs_kern.c: " Julia Lawall
2013-01-21 13:02   ` Julia Lawall
2013-01-21 12:13 ` [PATCH 10/15] drivers/scsi/csiostor/csio_lnode.c: " Julia Lawall
2013-01-21 13:02   ` Julia Lawall
2013-01-23  3:59   ` Naresh Kumar Inna
2013-01-23  4:11     ` Naresh Kumar Inna
2013-01-21 12:13 ` [PATCH 9/14] drivers/ipack/devices/ipoctal.c: " Julia Lawall
2013-01-21 13:02   ` Julia Lawall
2013-01-21 12:14 ` [PATCH 13/15] drivers/usb/musb/omap2430.c: " Julia Lawall
2013-01-21 13:02   ` Julia Lawall
2013-01-21 12:28   ` Felipe Balbi
2013-01-21 12:28     ` Felipe Balbi
2013-01-21 12:28     ` Felipe Balbi
2013-01-21 21:45   ` Sergei Shtylyov
2013-01-21 21:45     ` Sergei Shtylyov
2013-01-21 12:14 ` [PATCH 14/15] drivers/infiniband/hw/mlx4/sysfs.c: " Julia Lawall
2013-01-21 13:02   ` Julia Lawall
2013-01-21 12:15 ` [PATCH 6/15] drivers/net/wireless/iwlegacy/4965-mac.c: " Julia Lawall
2013-01-21 13:02   ` Julia Lawall
2013-01-21 12:07   ` Stanislaw Gruszka
2013-01-21 12:07     ` Stanislaw Gruszka
2013-01-21 12:16 ` [PATCH 2/15] drivers/usb/chipidea/core.c: " Julia Lawall
2013-01-21 13:02   ` Julia Lawall
2013-01-21 23:44   ` Peter Chen
2013-01-21 23:44     ` Peter Chen
2013-01-21 12:16 ` [PATCH 3/15] drivers/staging/omap-thermal/omap-bandgap.c: " Julia Lawall
2013-01-21 13:02   ` Julia Lawall
2013-01-21 12:24   ` walter harms
2013-01-21 12:57   ` Dan Carpenter
2013-01-21 12:59   ` Julia Lawall
2013-01-21 12:16 ` [PATCH 1/15] drivers/sh/intc/of_intc.c: " Julia Lawall
2013-01-21 13:02   ` Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.