qemu-arm
[Top][All Lists]
Advanced

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

Re: [Qemu-arm] [Qemu-devel] [PATCH v2 1/2] Use error_fatal to simplify o


From: Markus Armbruster
Subject: Re: [Qemu-arm] [Qemu-devel] [PATCH v2 1/2] Use error_fatal to simplify obvious fatal errors
Date: Mon, 14 Dec 2015 20:25:36 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Eduardo Habkost <address@hidden> writes:

> On Thu, Dec 10, 2015 at 05:29:14PM +0100, Markus Armbruster wrote:
>> Done with this admittedly crude Coccinelle semantic patch:
>> 
>
> Reviewed-by: Eduardo Habkost <address@hidden>
>
> You can rewrite the semantic patch as:
>
>     @@
>     type T;
>     identifier FUN, RET;
>     expression list ARGS;
>     expression ERR, EC;
>     @@
>     (
>     -    T RET = FUN(ARGS, &ERR);
>     +    T RET = FUN(ARGS, &error_fatal);
>     |
>     -    RET = FUN(ARGS, &ERR);
>     +    RET = FUN(ARGS, &error_fatal);
>     |
>     -    FUN(ARGS, &ERR);
>     +    FUN(ARGS, &error_fatal);
>     )
>     -    if (ERR != NULL) {
>     -        error_report_err(ERR);
>     -        exit(EC);
>     -    }
>
>
> Coccinelle seems to have some magic to make "LIST," also match
> with an empty list.

Same output as my script, except it doesn't mess up zynq_init().  Sold!



reply via email to

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