The patch titled Subject: include/linux/bitmap.h: add comment on BITMAP_LAST_WORD_MASK has been added to the -mm tree. Its filename is linux-bitmaph-comments-on-bitmap_last_word_mask.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/linux-bitmaph-comments-on-bitmap_last_word_mask.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/linux-bitmaph-comments-on-bitmap_last_word_mask.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Wei Wang <wei.w.wang@xxxxxxxxx> Subject: include/linux/bitmap.h: add comment on BITMAP_LAST_WORD_MASK When "nbits = 0" which means no bits to mask, this macro is expected to return 0, instead of 0xffffffff. Currently, the "nbits = 0" case is avoided by the callers themselves (e.g.__bitmap_intersects, __bitmap_weight). This corner case should be explicitly noted. Add a comment above the macro as a note to users about the corner case. Link: http://lkml.kernel.org/r/1532678611-9136-1-git-send-email-wei.w.wang@xxxxxxxxx Signed-off-by: Wei Wang <wei.w.wang@xxxxxxxxx> Cc: Andy Shevchenko <andy.shevchenko@xxxxxxxxx> Cc: Yury Norov <ynorov@xxxxxxxxxxxxxxxxxx> Cc: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- diff -puN include/linux/bitmap.h~linux-bitmaph-comments-on-bitmap_last_word_mask include/linux/bitmap.h --- a/include/linux/bitmap.h~linux-bitmaph-comments-on-bitmap_last_word_mask +++ a/include/linux/bitmap.h @@ -194,6 +194,7 @@ extern int bitmap_print_to_pagebuf(bool const unsigned long *maskp, int nmaskbits); #define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) & (BITS_PER_LONG - 1))) +/* "nbits = 0" is not applicable to this macro. Callers should avoid that. */ #define BITMAP_LAST_WORD_MASK(nbits) (~0UL >> (-(nbits) & (BITS_PER_LONG - 1))) #define small_const_nbits(nbits) \ _ Patches currently in -mm which might be from wei.w.wang@xxxxxxxxx are linux-bitmaph-comments-on-bitmap_last_word_mask.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html