qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [Qemu-devel] [PATCH 01/26] coccinelle: use exit(EXIT_


From: Eric Blake
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH 01/26] coccinelle: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE)
Date: Fri, 16 Sep 2016 10:35:42 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

On 09/16/2016 08:55 AM, Laurent Vivier wrote:
> Signed-off-by: Laurent Vivier <address@hidden>
> ---
>  scripts/coccinelle/exit.cocci | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>  create mode 100644 scripts/coccinelle/exit.cocci
> 

Script itself is fine. Whether to apply it throughout the tree is a
cosmetic question, but I'm in favor of it; and the script will help us
keep the tree clean. Do we need/want to update HACKING to mention our
new enforced style as well, later in the series?

Reviewed-by: Eric Blake <address@hidden>

However, Coccinelle doesn't seem to catch comments; your series has
missed at least the 'exit(1)' in the comments of include/qapi/error.h.

> diff --git a/scripts/coccinelle/exit.cocci b/scripts/coccinelle/exit.cocci
> new file mode 100644
> index 0000000..73386c0
> --- /dev/null
> +++ b/scripts/coccinelle/exit.cocci
> @@ -0,0 +1,12 @@
> +// replace exit(0) by exit(EXIT_SUCCESS)
> +//         exit(1) by exit(EXIT_FAILURE)
> +
> +@@
> +@@
> +(
> +- exit(0)
> ++ exit(EXIT_SUCCESS)
> +|
> +- exit(1)
> ++ exit(EXIT_FAILURE)
> +)
> 

-- 
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]