Re: [Qemu-devel] [PATCH v2 1/2] Use error_fatal to simplify obvious fatal errors

2015-12-14 Thread Markus Armbruster
Eduardo Habkost 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 > > You can rewrite the semantic patch as: > > @@ > type T; > identifier FUN, RET; > exp

Re: [Qemu-devel] [PATCH v2 1/2] Use error_fatal to simplify obvious fatal errors

2015-12-14 Thread Eduardo Habkost
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 You can rewrite the semantic patch as: @@ type T; identifier FUN, RET; expression list ARGS; expression ERR, EC;

[Qemu-devel] [PATCH v2 1/2] Use error_fatal to simplify obvious fatal errors

2015-12-10 Thread Markus Armbruster
Done with this admittedly crude Coccinelle semantic patch: @@ identifier FUN; expression ERR, EC; @@ -FUN(&ERR); -if (ERR != NULL) { -error_report_err(ERR); -exit(EC); -} +FUN(&error_fatal); @@ identifier FUN; expr