Re: [PATCH] scripts/coccinelle: check for redeclaration

2019-01-05 Thread Masahiro Yamada
On Sat, Dec 29, 2018 at 10:32 AM Julia Lawall  wrote:
>
> Avoid reporting on the use of an iterator index variable when
> the variable is redeclared.
>
> Signed-off-by: Julia Lawall 
>
> ---


Applied to linux-kbuild. Thanks!


>  scripts/coccinelle/iterators/use_after_iter.cocci |3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/scripts/coccinelle/iterators/use_after_iter.cocci 
> b/scripts/coccinelle/iterators/use_after_iter.cocci
> index ce8cc9c..66a1140 100644
> --- a/scripts/coccinelle/iterators/use_after_iter.cocci
> +++ b/scripts/coccinelle/iterators/use_after_iter.cocci
> @@ -35,6 +35,7 @@ iterator name hlist_for_each_entry_from;
>  iterator name hlist_for_each_entry_safe;
>  statement S;
>  position p1,p2;
> +type T;
>  @@
>
>  (
> @@ -125,6 +126,8 @@ sizeof(<+...c...+>)
>  |
>   >member
>  |
> +T c;
> +|
>  c = E
>  |
>  *c@p2
>


-- 
Best Regards
Masahiro Yamada


[PATCH] scripts/coccinelle: check for redeclaration

2018-12-28 Thread Julia Lawall
Avoid reporting on the use of an iterator index variable when
the variable is redeclared.

Signed-off-by: Julia Lawall 

---
 scripts/coccinelle/iterators/use_after_iter.cocci |3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/coccinelle/iterators/use_after_iter.cocci 
b/scripts/coccinelle/iterators/use_after_iter.cocci
index ce8cc9c..66a1140 100644
--- a/scripts/coccinelle/iterators/use_after_iter.cocci
+++ b/scripts/coccinelle/iterators/use_after_iter.cocci
@@ -35,6 +35,7 @@ iterator name hlist_for_each_entry_from;
 iterator name hlist_for_each_entry_safe;
 statement S;
 position p1,p2;
+type T;
 @@
 
 (
@@ -125,6 +126,8 @@ sizeof(<+...c...+>)
 |
  >member
 |
+T c;
+|
 c = E
 |
 *c@p2