From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v2 5/5] libxl: Add explicit cast to libxl_psr_cat_set_cbm Date: Tue, 19 Jan 2016 09:34:36 +0100 Message-ID: <1453192476.11427.105.camel@citrix.com> References: <1451925649.13361.193.camel@citrix.com> <1453183100-50700-1-git-send-email-czylin@uwaterloo.ca> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3116210099175034103==" Return-path: In-Reply-To: <1453183100-50700-1-git-send-email-czylin@uwaterloo.ca> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Chester Lin , xen-devel@lists.xen.org Cc: ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, george.dunlap@eu.citrix.com, ian.jackson@eu.citrix.com, jtotto@uwaterloo.ca, hjarmstr@uwaterloo.ca List-Id: xen-devel@lists.xenproject.org --===============3116210099175034103== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-WmjXFW3HQXkWrmVbl5+4" --=-WmjXFW3HQXkWrmVbl5+4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2016-01-19 at 00:58 -0500, Chester Lin wrote: > Fixes Coverity CID 1343299. The call to xc_psr_cat_set_domain_data() > expects type xc_psr_cat_type but is provided libxl_psr_cbm_type which > is defined in IDL. >=20 > The two enums are deliberately identical and IDL only exists so that > libxl clients don't need to include libxc headers directly. >=20 I see... > --- a/tools/libxl/libxl_psr.c > +++ b/tools/libxl/libxl_psr.c > @@ -310,7 +310,9 @@ int libxl_psr_cat_set_cbm(libxl_ctx *ctx, > uint32_t domid, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0libxl_for_each_set_bit(socketid, *target_ma= p) { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (socketid >=3D n= r_sockets) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0break; > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (xc_psr_cat_set_domai= n_data(ctx->xch, domid, type, > socketid, cbm)) { > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0r =3D xc_psr_cat_set_dom= ain_data(ctx->xch, domid, > (xc_psr_cat_type) type, > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0socketid, cbm); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (r) { > Is the cast in the function call better than a local variable of xc_psr_cat_type initialized with 'type'? Or would Coverity keep complaining in such a case? If yes to either of the questions, this patch is: Reviewed-by: Dario Faggioli Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-WmjXFW3HQXkWrmVbl5+4 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 v1 iEYEABECAAYFAlad9RwACgkQk4XaBE3IOsRY1QCfZxDrnXtwQABIqavHoELyk1yU VhUAniVL1d2sL0dxNnzQRYp2+UXFnwsB =VKTX -----END PGP SIGNATURE----- --=-WmjXFW3HQXkWrmVbl5+4-- --===============3116210099175034103== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============3116210099175034103==--