public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] delete double assignment
@ 2014-08-23 18:33 Julia Lawall
  2014-08-23 18:33 ` [PATCH 1/7] video: fbdev: riva: " Julia Lawall
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Julia Lawall @ 2014-08-23 18:33 UTC (permalink / raw)
  To: linux-mips
  Cc: joe, kernel-janitors, linux-kernel, linux-fbdev, linux-serial,
	linux-usb

These patches fix cases where there are two adjacent assignments to the
same location.  In practice, many such occurrences appear to be
intentional, eg to initialize volatile memory, but these cases do not seem
to fall into that category.

The complete semantic match that finds these problems is as follows:

// <smpl>
@r@
expression i,f;
position p1,p2;
@@

(
 i = <+...f(...)...+>;
|
 i |= <+...f(...)...+>;
|
 i &= <+...f(...)...+>;
|
 i += <+...f(...)...+>;
|
 i -= <+...f(...)...+>;
|
 i *= <+...f(...)...+>;
|
 i /= <+...f(...)...+>;
|
 i %= <+...f(...)...+>;
|
 i ^= <+...f(...)...+>;
|
 i <<= <+...f(...)...+>;
|
 i >>= <+...f(...)...+>;
|
 i@p1 = ...;
|
 i@p1 |= ...;
|
 i@p1 &= ...;
|
 i@p1 += ...;
|
 i@p1 -= ...;
|
 i@p1 *= ...;
|
 i@p1 /= ...;
|
 i@p1 %= ...;
|
 i@p1 ^= ...;
|
 i@p1 <<= ...;
|
 i@p1 >>= ...;
|
 i@p1 ++;
|
 ++i@p1;
|
 i@p1 --;
|
 --i@p1;
)
(
 i = <+...i...+>;
|
 i = <+...f(...)...+>;
|
 i@p2 = ...;
)

@@
expression i,j,f;
position r.p1,r.p2;
@@

(
 (<+...i@p1...+>);
)
(
 (<+...\(j++\|++j\|j--\|--j\|f(...)\)...+>) = ...;
|
*i@p2 = ...;
)
// </smpl>


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

end of thread, other threads:[~2014-08-26 10:56 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-23 18:33 [PATCH 0/7] delete double assignment Julia Lawall
2014-08-23 18:33 ` [PATCH 1/7] video: fbdev: riva: " Julia Lawall
2014-08-23 18:33 ` [PATCH 2/7] video: fbdev: intelfb: " Julia Lawall
2014-08-26 10:56   ` Tomi Valkeinen
2014-08-23 18:33 ` [PATCH 3/7] serial: vr41xx_siu: " Julia Lawall
2014-08-23 18:33 ` [PATCH 4/7] MIPS: BCM63xx: " Julia Lawall
2014-08-25 11:27   ` Ralf Baechle
2014-08-25 19:09     ` Jonas Gorski
2014-08-23 18:33 ` [PATCH 5/7] wusb: " Julia Lawall
2014-08-23 18:33 ` [PATCH 6/7] video: fbdev: sis: " Julia Lawall
2014-08-24 18:21   ` Geert Uytterhoeven
2014-08-24 18:40     ` Julia Lawall
2014-08-25 11:36       ` Geert Uytterhoeven
2014-08-26 10:51     ` Tomi Valkeinen
2014-08-23 18:33 ` [PATCH 7/7] MIPS: Alchemy: au1200fb: " Julia Lawall

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