Re: Support for TI FlashMedia (pci id 104c:8033, 104c:803b) flash card readers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



No optimization. I just thought both 0xffffffff and -1
are ugly.

--- Mikael Pettersson <[email protected]> wrote:

> On Fri, 28 Jul 2006 06:02:11 -0700 (PDT), Alex Dubov
> wrote:
> >The exact condition is (irq_status!=0 &&
> >irq_status!=0xffffffff). I think it is not any
> better
> >that what I have.
> >
> >--- Andrey Panin <[email protected]> wrote:
> >
> >> On 208, 07 27, 2006 at 08:34:06PM -0700, Alex
> Dubov
> >> wrote:
> >> 
> >> What this strange line (in tifm_7xx1_isr
> function)
> >> is supposed to do:
> >> 
> >>         if(irq_status && (~irq_status))
> 
> If you're chasing micro-optimisations, you could
> write
> 
>     /* if irq_status is not 0 or ~0, do <blah> */
>     if (((unsigned)irq_status + 1) >= 2)
> 
> which should reduce the number of conditional
> branches
> to a single one. (And drop the cast if irq_status is
> declared as unsigned.)
> 
> But for long-term maintenance just spelling out the
> exact
> condition (irq_status != 0 && irq_status != ~0) is
> preferable.
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux