Re: [ 57/72] genirq: Unmask oneshot irqs when thread was not woken

From: Linus Torvalds
Date: Tue Mar 06 2012 - 16:47:38 EST


On Tue, Mar 6, 2012 at 1:40 PM, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> (*) "1 << ffz(a)" can be written as
>
>   a = ~a;        /* Turn the zero bits into 1 bits */
>   a &= -a;      /* .. and find the first one. */
>
> without ever doing any insane bit scanning.

Alternatively, wite it directly as "(a+1) &~a", which is the same
expression just written differently (due to "-a == ~a+1")

Yeah, I've been playing too much with the bitwise optimizations of the
dentry cache name comparisons lately.

Linus
--
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/