lkml.org 
[lkml]   [2006]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Support for TI FlashMedia (pci id 104c:8033, 104c:803b) flash card readers
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@donpac.ru> 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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-07-28 18:07    [W:0.033 / U:0.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site