All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Juergen Gross <jgross@suse.com>
Cc: george.dunlap@eu.citrix.com, andrew.cooper3@citrix.com,
	keir@xen.org, jbeulich@suse.com,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH 0/5] use mask operations instead of test_bit()
Date: Fri, 2 Oct 2015 11:33:42 +0200	[thread overview]
Message-ID: <1443778422.14525.49.camel@citrix.com> (raw)
In-Reply-To: <560E49FB.2020406@suse.com>


[-- Attachment #1.1: Type: text/plain, Size: 1387 bytes --]

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.
> 
> It's a fallout from a cleanup patch:
> 
> http://lists.xen.org/archives/html/xen-devel/2015-09/msg03184.html
> 

> > One question, can we introduce a __test_bit() macro/inline
> > function,
> > like Jan did with __set_bit?
> 
> In the thread mentioned above you'll find a discussion about exactly
> this idea between Jan and me.
> 
Ah, I see. Sorry, I missed it.

> > I've quickly-&-dirtily tested this:
> > 
> > #define __test_bit(nr, addr) ({  \
> >      unsigned _flags = 1 << nr;   \
> >      addr & _flags; \
> > })
> > 
> > and the result (I've checked a couple of cases) seems the same to
> > me.
> 
> 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).
> 
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
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

  reply	other threads:[~2015-10-02  9:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-02  4:40 [PATCH 0/5] use mask operations instead of test_bit() Juergen Gross
2015-10-02  4:40 ` [PATCH 1/5] xen: use masking operation instead of test_bit for RTDS bits Juergen Gross
2015-10-02 10:21   ` Dario Faggioli
2015-10-05 13:30   ` George Dunlap
2015-10-02  4:40 ` [PATCH 2/5] xen: use masking operation instead of test_bit for CSFLAG bits Juergen Gross
2015-10-02 10:45   ` Dario Faggioli
2015-10-05 13:30   ` George Dunlap
2015-10-02  4:40 ` [PATCH 3/5] xen: use masking operation instead of test_bit for VGCF bits Juergen Gross
2015-10-02  4:40 ` [PATCH 4/5] xen: use masking operation instead of test_bit for VPF bits Juergen Gross
2015-10-05 13:18   ` George Dunlap
2015-10-05 13:36     ` Jan Beulich
2015-10-05 13:45       ` George Dunlap
2015-10-05 14:05         ` Jan Beulich
2015-10-05 14:31           ` George Dunlap
2015-10-05 13:39     ` Juergen Gross
2015-10-05 13:24   ` George Dunlap
2015-10-05 13:40     ` Jan Beulich
2015-10-02  4:40 ` [PATCH 5/5] xen: use masking operation instead of test_bit for MCSF bits Juergen Gross
2015-10-02  9:03 ` [PATCH 0/5] use mask operations instead of test_bit() Dario Faggioli
2015-10-02  9:10   ` Juergen Gross
2015-10-02  9:33     ` Dario Faggioli [this message]
2015-10-02  9:44 ` Jan Beulich
2015-10-02  9:47 ` Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1443778422.14525.49.camel@citrix.com \
    --to=dario.faggioli@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.