diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2021-02-22 21:21:03 -0800 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2021-02-22 21:21:03 -0800 |
| commit | 415e915fdfc775ad0c6675fde1008f6f43dd6251 (patch) | |
| tree | 429851187c0e85daa78f5d2bb6853959a1f5545b /include/linux/log2.h | |
| parent | e64123949e6c9581c97fc14594f1cf34bf1d87a8 (diff) | |
| parent | f40ddce88593482919761f74910f42f4b84c004b (diff) | |
Merge tag 'v5.11' into next
Merge with mainline to get latest APIs and device tree bindings.
Diffstat (limited to 'include/linux/log2.h')
| -rw-r--r-- | include/linux/log2.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/log2.h b/include/linux/log2.h index c619ec6eff4a..df0b155c2141 100644 --- a/include/linux/log2.h +++ b/include/linux/log2.h @@ -156,7 +156,8 @@ unsigned long __rounddown_pow_of_two(unsigned long n) #define ilog2(n) \ ( \ __builtin_constant_p(n) ? \ - const_ilog2(n) : \ + ((n) < 2 ? 0 : \ + 63 - __builtin_clzll(n)) : \ (sizeof(n) <= 4) ? \ __ilog2_u32(n) : \ __ilog2_u64(n) \ |
