Re: bit twiddling

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Wed May 24 2000 - 10:21:23 EST


> #define BFINS(lhs, rhs, offset, bitcount) \
> (((lhs) & ~(((1 << (bitcount)) - 1)) << (offset)) | \
> (((rhs) & ((1 << (bitcount)) - 1)) << (offset)))
>
> They were fun to write, but surely this wheel has been invented?

Why not use constants and cpu_to_le16 and friends ?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:11 EST