The patch titled Subject: include/linux/bitops.h: introduce BITS_PER_TYPE has been added to the -mm tree. Its filename is bitops-introduce-bits_per_type.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/bitops-introduce-bits_per_type.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/bitops-introduce-bits_per_type.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: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> Subject: include/linux/bitops.h: introduce BITS_PER_TYPE net_dim.h has a rather useful extension to BITS_PER_BYTE to compute the number of bits in a type (BITS_PER_BYTE * sizeof(T)), so promote the macro to bitops.h, alongside BITS_PER_BYTE, for wider usage. Link: http://lkml.kernel.org/r/20180706094458.14116-1-chris@xxxxxxxxxxxxxxxxxx Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> Reviewed-by: Jani Nikula <jani.nikula@xxxxxxxxx> Cc: Randy Dunlap <rdunlap@xxxxxxxxxxxxx> Cc: Andy Gospodarek <gospo@xxxxxxxxxxxx> Cc: David S. Miller <davem@xxxxxxxxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/bitops.h | 3 ++- include/linux/net_dim.h | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff -puN include/linux/bitops.h~bitops-introduce-bits_per_type include/linux/bitops.h --- a/include/linux/bitops.h~bitops-introduce-bits_per_type +++ a/include/linux/bitops.h @@ -11,7 +11,8 @@ #define BIT_ULL_MASK(nr) (1ULL << ((nr) % BITS_PER_LONG_LONG)) #define BIT_ULL_WORD(nr) ((nr) / BITS_PER_LONG_LONG) #define BITS_PER_BYTE 8 -#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) +#define BITS_PER_TYPE(type) (sizeof(type) * BITS_PER_BYTE) +#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_TYPE(long)) #endif /* diff -puN include/linux/net_dim.h~bitops-introduce-bits_per_type include/linux/net_dim.h --- a/include/linux/net_dim.h~bitops-introduce-bits_per_type +++ a/include/linux/net_dim.h @@ -363,7 +363,6 @@ static inline void net_dim_sample(u16 ev } #define NET_DIM_NEVENTS 64 -#define BITS_PER_TYPE(type) (sizeof(type) * BITS_PER_BYTE) #define BIT_GAP(bits, end, start) ((((end) - (start)) + BIT_ULL(bits)) & (BIT_ULL(bits) - 1)) static inline void net_dim_calc_stats(struct net_dim_sample *start, _ Patches currently in -mm which might be from chris@xxxxxxxxxxxxxxxxxx are bitops-introduce-bits_per_type.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