Message ID | 1466007277-17525-2-git-send-email-lvivier@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 06/15/2016 10:14 AM, Laurent Vivier wrote: > Script from LKML. Link to a particular message? > > Signed-off-by: Laurent Vivier <lvivier@redhat.com> > --- > scripts/coccinelle/typecast.cocci | 7 +++++++ > 1 file changed, 7 insertions(+) > create mode 100644 scripts/coccinelle/typecast.cocci > > diff --git a/scripts/coccinelle/typecast.cocci b/scripts/coccinelle/typecast.cocci > new file mode 100644 > index 0000000..be2183e > --- /dev/null > +++ b/scripts/coccinelle/typecast.cocci > @@ -0,0 +1,7 @@ > +// Remove useless casts > +@@ > +type T; > +T v; > +@@ > +- (T *)&v > ++ &v Since we're using C for the most part, do we also want to remove useless casts in and out of void*? But even if we do that, it could be separate. This patch looks good on its own: Reviewed-by: Eric Blake <eblake@redhat.com>
diff --git a/scripts/coccinelle/typecast.cocci b/scripts/coccinelle/typecast.cocci new file mode 100644 index 0000000..be2183e --- /dev/null +++ b/scripts/coccinelle/typecast.cocci @@ -0,0 +1,7 @@ +// Remove useless casts +@@ +type T; +T v; +@@ +- (T *)&v ++ &v
Script from LKML. Signed-off-by: Laurent Vivier <lvivier@redhat.com> --- scripts/coccinelle/typecast.cocci | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 scripts/coccinelle/typecast.cocci