vli_num_bits(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… vli_num_bits(9) β€” the Kernel API Manual, bestie edition

Okay so real talk: this is a page from the Kernel API Manual, and the star of the show is vli_num_bits(9). If you've ever wondered "how many bits do I actually need to hold this vli," this function is literally the answer. No cap. ✨


🌸 NAME 🌸

vli_num_bits β€” Counts the number of bits required for vli.

That's it. That's the whole job. It counts bits. It's giving "small but mighty" energy and honestly? Iconic. πŸ‘‘


✨ SYNOPSIS ✨

unsigned int vli_num_bits (const u64 *vli , unsigned int ndigits );

Look at that signature. Clean. Precise. unsigned int going in, unsigned int coming out, const u64 * holding it down in the middle. Periodt. πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

Here's what you're feeding it, bestie:

  • vli β€” vli to check. This is the thing you're asking about. The main character, if you will. 🫢
  • ndigits β€” Length of the vli. Because a pointer alone isn't gonna tell us how long the thing is β€” we need the digits count too. Important detail, don't skip it. πŸ’–

πŸ”₯ RETURN πŸ”₯

The number of bits required to represent vli.

That's the whole return value β€” a single unsigned int telling you exactly how many bits you need. No struct, no error code, no out-params, just a nice tidy number. Slay. ⭐


🌈 SEE ALSO 🌈

Alright, gather round, because there's a whole friend group here and they all live in the kernel file ./include/crypto/internal/ecc.h:

That's the whole squad β€” ECC key stuff, point math, the other vli_* besties, all of it. Go say hi. πŸ’œ


Heads up: this page comes from ./include/crypto/internal, and the version you're reading is dated October 2026. Make sure you're looking at the right one, k? πŸ’€

And that's the page!! Sending you off with a big sparkly goodbye from the Kernel API Manual gang β€” ./include/crypto/internal, October 2026, mwah πŸ’‹πŸ§šβ€β™€οΈπŸŒΈ

πŸ“¦ where this page comes from