From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH 0/5] use mask operations instead of test_bit() Date: Fri, 2 Oct 2015 11:33:42 +0200 Message-ID: <1443778422.14525.49.camel@citrix.com> References: <1443760830-29095-1-git-send-email-jgross@suse.com> <1443776609.14525.41.camel@citrix.com> <560E49FB.2020406@suse.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8539701127587883859==" Return-path: In-Reply-To: <560E49FB.2020406@suse.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Juergen Gross Cc: george.dunlap@eu.citrix.com, andrew.cooper3@citrix.com, keir@xen.org, jbeulich@suse.com, xen-devel List-Id: xen-devel@lists.xenproject.org --===============8539701127587883859== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-aRQgdCc7xHmAckH3InJw" --=-aRQgdCc7xHmAckH3InJw Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2015-10-02 at 11:10 +0200, Juergen Gross wrote: > On 10/02/2015 11:03 AM, Dario Faggioli wrote: > > That's a good idea, I think. >=20 > It's a fallout from a cleanup patch: >=20 > http://lists.xen.org/archives/html/xen-devel/2015-09/msg03184.html >=20 > > One question, can we introduce a __test_bit() macro/inline > > function, > > like Jan did with __set_bit? >=20 > In the thread mentioned above you'll find a discussion about exactly > this idea between Jan and me. >=20 Ah, I see. Sorry, I missed it. > > I've quickly-&-dirtily tested this: > >=20 > > #define __test_bit(nr, addr) ({ \ > > unsigned _flags =3D 1 << nr; \ > > addr & _flags; \ > > }) > >=20 > > and the result (I've checked a couple of cases) seems the same to > > me. >=20 > The problem is the limited scope where this scheme is really working > and > is a better solution at the same time (nr must be a constant less > than > the numbers of bits of *addr). >=20 Right, so we could only use __test_bit() in a subset of the cases, i.e., we won't gain that much more consistency... I see it now. Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-aRQgdCc7xHmAckH3InJw 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 iEYEABECAAYFAlYOT3YACgkQk4XaBE3IOsTnNACgoeAj8mQaiHzIq0PS/0qqd8/z 7s8An1JL/LPZB8ekYyFBewxiPSWHLQk5 =VIxx -----END PGP SIGNATURE----- --=-aRQgdCc7xHmAckH3InJw-- --===============8539701127587883859== 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 --===============8539701127587883859==--