qemu-riscv
[Top][All Lists]
Advanced

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

Re: [RFC v2 6/9] scripts: add coccinelle script to use auto propagated e


From: Eric Blake
Subject: Re: [RFC v2 6/9] scripts: add coccinelle script to use auto propagated errp
Date: Mon, 23 Sep 2019 16:29:59 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 9/23/19 3:05 PM, Eric Blake wrote:

> Does running this Coccinelle script 2 times in a row add a second
> ERRP_FUNCTION_BEGIN() line?  We want it to be idempotent (no changes on
> a second run).  (Admittedly, I did not actually test that yet).  Also, I
> don't know if this can be tweaked to avoid adding the line to a function
> with an empty body, maybe:
> 
>  fn(..., Error **errp, ...)
>  {
> +    ERRP_FUNCTION_BEGIN();
>      ...
>  }

Also untested:

 fn(..., Error **errp, ...)
 {
(
|
     ERRP_FUNCTION_BEGIN();
     ...
|
+    ERRP_FUNCTION_BEGIN()
     ...
)
 }


> Overall, the script makes sense in my reading (but no idea if it
> actually catches everything we want, or if it missed something).

Having spot-checked 7, it definitely misses cases where it was supposed
to add ERRP_FUNCTION_BEGIN().

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



reply via email to

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