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

Re: [Xen-devel] [PATCH] libxl: fix handling returns in libxl_get_version_info()



On Thu, 2016-02-11 at 10:48 +0100, Dario Faggioli wrote:
> I think it would be better if you make the patch in such a way that the
> final code would look like this:
> 
> Â Â r = xc_version(ctx->xch, XENVER_extraversion, &u.xen_extra);
> Â Â if ( r < 0 )
> Â Â Â Â goto out;
> Â Â info->xen_version_extra = libxl__strdup(NOGC, u.xen_extra);

That is, each "paragraph" consists of:

    call a variant of xc_version
    check for errors in that call
    propagate results of that call to info->... as necessary

and I agree. FWIW CODING_STYLE also allows (but doesn't mandate) for
    if ( r < 0 ) goto out;
i.e. on a single line, which Harmandeep might prefer here for brevity.

Ian

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.