qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [Qemu-devel] [PATCH 1/7] coccinelle: add a script to


From: Eric Blake
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH 1/7] coccinelle: add a script to remove useless casts
Date: Fri, 24 Jun 2016 11:21:01 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 06/15/2016 10:14 AM, Laurent Vivier wrote:
> Script from LKML.

Link to a particular message?

> 
> Signed-off-by: Laurent Vivier <address@hidden>
> ---
>  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 <address@hidden>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]