Re: [PATCH] bitops: Introduce BITS_PER_TYPE

From: Andrew Morton
Date: Fri Jul 06 2018 - 17:58:26 EST


On Fri, 6 Jul 2018 10:44:58 +0100 Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> 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.