Quantcast
Channel: lkml.org : Shesha Sreenivasamurthy
Viewing all articles
Browse latest Browse all 1267

Re: [PATCH v3 1/6] ilog2: create truly constant version for sparse

$
0
0
Linus Torvalds writes: (Summary) wrote:

[...]

__ilog2_32() and __ilog2_64(),
If sparse warns about it, then presumably gcc with -Wvla warns about it too? So I suspect that what you'd want is
So I suspect that what you'd want is
#define ilog2(n) \
__builtin_choose_expr(__is_constexpr(n), \
const_ilog2(n), \
__builtin_choose_expr(sizeof(n) <= 4, \
__ilog2_u32(n), \
__ilog2_u64(n)))
__ilog2_u64(n)))
or something.

Viewing all articles
Browse latest Browse all 1267

Trending Articles