const_ilog2(9)
π const_ilog2(9) β bestie edition π
okay so welcome to the Kernel API Manual page for const_ilog2(9), aka the little log-base-2 constant queen. No cap, she's here for that constant-expression energy. β¨
πΈ NAME πΈ
const_ilog2 β log base 2 of 32-bit or a 64-bit constant unsigned value. That's the whole name, and she ate. π
π SYNOPSIS π
const_ilog2 (n );
π¦ ARGUMENTS π¦
nβ parameter. Yep, that's the entire argument description, bestie; the manpage is keeping it mysterious. π
β DESCRIPTION β
Use this where sparse expects a true constant expression, e.g. for array indices. That's the vibe: constant expression zone, and the exact use case the page gives us is array indices. periodt.
π₯ SEE ALSO π₯
- Kernel file
./include/linux/log2.h is_power_of_2(9)__roundup_pow_of_two(9)__rounddown_pow_of_two(9)ilog2(9)roundup_pow_of_two(9)rounddown_pow_of_two(9)order_base_2(9)bits_per(9)max_pow_of_two_factor(9)
cute sign-off time π«Ά this page's source/version is ./include/linux, the date on it is October 2026, and the manpage header is of course const_ilog2(9). bye bestie, go be iconic with your constants π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms