[PATCH 05/18] Fix 64bit arch issue in synaptics eventcomm.c

Takashi Iwai tiwai at suse.de
Mon Oct 11 23:02:25 PDT 2010


At Tue, 12 Oct 2010 15:38:24 +1000,
Peter Hutterer wrote:
> 
> On Fri, Oct 08, 2010 at 07:22:29PM +0200, Takashi Iwai wrote:
> > Signed-off-by: Takashi Iwai <tiwai at suse.de>
> > ---
> >  src/eventcomm.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/src/eventcomm.c b/src/eventcomm.c
> > index 1fc41ef..8a77788 100644
> > --- a/src/eventcomm.c
> > +++ b/src/eventcomm.c
> > @@ -49,7 +49,7 @@
> >  #define NBITS(x) (((x) + LONG_BITS - 1) / LONG_BITS)
> >  #define OFF(x)   ((x) % LONG_BITS)
> >  #define LONG(x)  ((x) / LONG_BITS)
> > -#define TEST_BIT(bit, array) (array[LONG(bit)] & (1 << OFF(bit)))
> > +#define TEST_BIT(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1)
> >  
> >  #define SYNAPTICS_LED_SYS_FILE	"/sys/class/leds/psmouse::synaptics/brightness"
> >  
> > -- 
> > 1.7.3.1
> 
> I'd prefer the (1UL << OFF(bit)) notation with a != 0, but either way.

I'm fine with it; the compiler should be clever enough.

> Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
> 
> Please add the explanation in your first reply to Mark to the commit message
> though.

Yes, this patch is basically independent from the rest, so safe to
apply alone.  I'll repost later with a proper changelog.


thanks,

Takashi


More information about the xorg-devel mailing list