Re: bit twiddling

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

  • Next message: Richard B. Johnson: "Re: Open file in kernel Mode..."

    > #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 24 2000 - 11:44:09 EDT