Re: [Patch 5/23] mask v2 - Add new mask.h file

From: Matthew Dobson
Date: Fri Apr 02 2004 - 15:28:31 EST


On Thu, 2004-04-01 at 13:11, Paul Jackson wrote:
> Patch_5_of_23 - New mask ADT
> Adds new include/linux/mask.h header file
>
> ==> See this mask.h header for more extensive mask documentation <==

<snip>

> +/* Use if nbits <= BITS_PER_LONG */
> +#define MASK_ALL1(nbits) \
> +{ { \
> + [BITS_TO_LONGS(nbits)-1] = MASK_LAST_WORD(nbits) \
> +} }
> +
> +/* Use if nbits > BITS_PER_LONG */
> +#define MASK_ALL2(nbits) \
> +{ { \
> + [0 ... BITS_TO_LONGS(nbits)-2] = ~0UL, \
> + [BITS_TO_LONGS(nbits)-1] = MASK_LAST_WORD(nbits) \
> +} }

Gotta say, I'm not a bit fan of the names of these macros. They're
disappointingly short on descriptiveness. ;) Maybe
MASK_ALL_SINGLE_LONG and MASK_ALL_MULTIPLE_LONG? Something that more
explicitly shows the difference between them. So when we're reading
code later on, we're not constantly looking up the definition and
saying, "What's the difference between MASK_ALL1 & MASK_ALL2 again?"

-Matt

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