Re: [PATCH] bitops: Introduce BITS_PER_TYPE

Andrew Morton
2018-07-06T21:58:26Z

On Fri, 6 Jul 2018 10:44:58 +0100 Chris Wilson <chris@chris-wilson.co.uk> wrote:

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

A bit of grepping shows that there's quite a lot of code which does
sizeof(blah)*BITS_PER_BYTE. Fun newbie project.