[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: |
Vladimir Sementsov-Ogievskiy |
Subject: |
Re: [RFC v2 6/9] scripts: add coccinelle script to use auto propagated errp |
Date: |
Tue, 24 Sep 2019 10:35:56 +0000 |
24.09.2019 0:29, Eric Blake wrote:
> 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();
>> ...
>> }
No, we need exactly this to match not only empty functions. But with ... it
matches
empty functions as well.
>
> Also untested:
>
> fn(..., Error **errp, ...)
> {
> (
> |
> ERRP_FUNCTION_BEGIN();
> ...
> |
> + ERRP_FUNCTION_BEGIN()
> ...
> )
> }
Seems, that doesn't work..
It says:
12: no available token to attach to
where 12 is line "+ ERRP_FUNCTION_BEGIN()"
So, I tend to just add chunk to remove duplicated invocation :)
>
>
>> 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().
>
--
Best regards,
Vladimir
- Re: [RFC v2 2/9] qapi/error: add (Error **errp) cleaning APIs, (continued)
- [RFC v2 1/9] error: auto propagated local_err, Vladimir Sementsov-Ogievskiy, 2019/09/23
- [RFC v2 3/9] errp: rename errp to errp_in where it is IN-argument, Vladimir Sementsov-Ogievskiy, 2019/09/23
- [RFC v2 9/9] fix-compilation: includes, Vladimir Sementsov-Ogievskiy, 2019/09/23
- [RFC v2 8/9] fix-compilation: empty goto, Vladimir Sementsov-Ogievskiy, 2019/09/23
- [RFC v2 6/9] scripts: add coccinelle script to use auto propagated errp, Vladimir Sementsov-Ogievskiy, 2019/09/23
- [RFC v2 4/9] hw/core/loader-fit: fix freeing errp in fit_load_fdt, Vladimir Sementsov-Ogievskiy, 2019/09/23
- Re: [RFC v2 0/9] error: auto propagated local_err, Eric Blake, 2019/09/23
- Re: [RFC v2 0/9] error: auto propagated local_err, Vladimir Sementsov-Ogievskiy, 2019/09/24
- Re: [RFC v2 0/9] error: auto propagated local_err, Eric Blake, 2019/09/24
- Re: [RFC v2 0/9] error: auto propagated local_err, Vladimir Sementsov-Ogievskiy, 2019/09/24
- Re: [RFC v2 0/9] error: auto propagated local_err, Vladimir Sementsov-Ogievskiy, 2019/09/24
- Re: [RFC v2 0/9] error: auto propagated local_err, Vladimir Sementsov-Ogievskiy, 2019/09/24
- Re: [RFC v2 0/9] error: auto propagated local_err, Vladimir Sementsov-Ogievskiy, 2019/09/24