bits_per(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME πŸ’…

Okay so this is the bits_per(9) page from the Kernel API Manual, and its whole job is to calculate the number of bits required for the argument. That’s the name, that’s the vibe. ✨


πŸ“Ž SYNOPSIS πŸ“Ž

bits_per (n );

🌸 ARGUMENTS 🌸

  • n β€” the parameter. That’s it. That’s the argument, bestie. 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

This one is constant-capable, no cap β€” it can be used for compile-time initializations, e.g bitfields. πŸ”₯

The first few values calculated by this routine are:

  • bf(0) = 1
  • bf(1) = 1
  • bf(2) = 2
  • bf(3) = 2
  • bf(4) = 3
  • ... and so on.

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/linux/log2.h is right here, plus the whole icon squad:

πŸ’– Cute little sign-off: source/version is ./include/linux, the date is October 2026, and the page is bits_per(9). Stay slay, bestie. πŸŽ€

πŸ“¦ where this page comes from