[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 2/3] error: Remove unnecessary local_err vari
Re: [Qemu-devel] [PATCH v3 2/3] error: Remove unnecessary local_err variables
Mon, 13 Jun 2016 17:06:05 -0600
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
On 06/13/2016 03:57 PM, Eduardo Habkost wrote:
> This patch simplifies code that uses a local_err variable just to
> immediately use it for an error_propagate() call.
> Coccinelle patch used to perform the changes added to
> Reviewed-by: Eric Blake <address@hidden>
> Acked-by: Cornelia Huck <address@hidden>
> Signed-off-by: Eduardo Habkost <address@hidden>
> Changes v1 -> v2:
> * (new patch)
> Changes v2 -> v3:
> * Remove unused metavariable from script
> * Do changes only if errp is not touched before the error_setg()
> call (so we are sure *errp is not set and error_setg() won't
> * Changes dropped from v2 due to script changes:
> * block.c:bdrv_create_co_entry()
This one still qualifies as a single use of errp, it's just that script
is now too strict to see it. Can be cleaned up in a followup, to keep
this patch as strict Coccinelle changes.
> * block.c:bdrv_create_file()
Correct to drop this one.
> * blockdev.c:qmp_blockdev_mirror()
Correct to drop this one (bdrv_lookup_bs() should never set errp when
returning non-NULL, but Coccinelle can't see that).
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Description: OpenPGP digital signature
Re: [Qemu-devel] [PATCH v3 0/3] coccinelle: Clean up error checks and return value variables, Markus Armbruster, 2016/06/14