From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v3 7/7] libxl: libxl_tmem functions improving coding style Date: Wed, 27 Apr 2016 18:53:35 +0200 Message-ID: <1461776015.3525.149.camel@citrix.com> References: <1461139444-12342-1-git-send-email-paulinaszubarczyk@gmail.com> <1461139444-12342-8-git-send-email-paulinaszubarczyk@gmail.com> <20160420210406.GE9937@gmail.com> <20160427143121.GO20763@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5672905168597805711==" Return-path: Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1avSk7-0007Qx-Db for xen-devel@lists.xenproject.org; Wed, 27 Apr 2016 16:55:15 +0000 In-Reply-To: <20160427143121.GO20763@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Wei Liu , Olaf Hering Cc: ian.campbell@citrix.com, George.Dunlap@eu.citrix.com, ian.jackson@eu.citrix.com, Paulina Szubarczyk , xen-devel@lists.xenproject.org, roger.pau@citrix.com List-Id: xen-devel@lists.xenproject.org --===============5672905168597805711== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-st9tKVpO52DijfLTUoMP" --=-st9tKVpO52DijfLTUoMP Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2016-04-27 at 15:31 +0100, Wei Liu wrote: > On Wed, Apr 20, 2016 at 11:04:06PM +0200, Olaf Hering wrote: > >=20 > > On Wed, Apr 20, Paulina Szubarczyk wrote: > >=20 > > >=20 > > > In accordance with CODING_SYTLE: > > > =C2=A0- Use 'r' for return values to functions whose return values ar= e > > > a > > > =C2=A0=C2=A0=C2=A0different error space (like xc_tmem_control, xc_tme= m_auth) > > >=20 > > > libxc functions are supposed to, on failure, set errno and alwas > > > return -1=C2=A0 > > > which is the value stored in 'r', therfore use LOG() instead > > > LOGEV()=C2=A0 > > > with the 'r' value since the error code is always -1. > > Shouldnt in this case 'LOGEV' be replaced with 'LOGE' to get errno > > printed? Plain 'LOG' does not seem to print errno. > >=20 > Agreed.=C2=A0=C2=A0We should use LOGEV here. >=20 You mean LOGE, don't you? :-) I think it was me that suggested dropping LOGEV in favour of LOG, and I agree that I should have suggested LOGE. Sorry for that. TBF, I seem to find both cases in libxl source code (i.e., we use both LOG and LOGE to log error after an xc_* call), but I agree that, since libxc sets errno, LOGE is the better, and we should try to converge to always using that one. Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-st9tKVpO52DijfLTUoMP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEABECAAYFAlcg7o8ACgkQk4XaBE3IOsRAMACfW25WjNQygWDaqLiANOo2pjsj tdEAniT2zhtcF+LoSJYMer3jKKzrqb42 =+eZ2 -----END PGP SIGNATURE----- --=-st9tKVpO52DijfLTUoMP-- --===============5672905168597805711== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9y Zy94ZW4tZGV2ZWwK --===============5672905168597805711==--