lkml.org 
[lkml]   [2004]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [Patch 5/23] mask v2 - Add new mask.h file
From
Date
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@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: 2005-03-22 14:02    [W:0.283 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site