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 > scripts/coccinelle/remove_local_err.cocci. > > Reviewed-by: Eric Blake <ebl...@redhat.com> > Acked-by: Cornelia Huck <cornelia.h...@de.ibm.com> > Signed-off-by: Eduardo Habkost <ehabk...@redhat.com> > --- > 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 > abort) > * 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
signature.asc
Description: OpenPGP digital signature