[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1408818808-18850-1-git-send-email-Julia.Lawall@lip6.fr>
Date: Sat, 23 Aug 2014 20:33:21 +0200
From: Julia Lawall <Julia.Lawall@...6.fr>
To: linux-mips@...ux-mips.org
Cc: joe@...ches.com, kernel-janitors@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-fbdev@...r.kernel.org,
linux-serial@...r.kernel.org, linux-usb@...r.kernel.org
Subject: [PATCH 0/7] delete double assignment
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@.....+>);
)
(
(<+...\(j++\|++j\|j--\|--j\|f(...)\)...+>) = ...;
|
*i@p2 = ...;
)
// </smpl>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists