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

From: Mikael Pettersson
Date: Fri Jul 28 2006 - 12:03:12 EST


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 <pazke@xxxxxxxxx> 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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/