linear_range..._value_array(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… linear_range..._value_array(9) πŸ’…

okay so welcome to the Kernel API Manual, bestie β€” this is the page for linear_range_get_value_array, and honestly? it's giving "small function, big main character energy" ✨


🌸 NAME 🌸

linear_range_get_value_array β€” fetch a value from array of ranges πŸŽ€

like, you hand it a selector and it goes digging through a whole array of linear ranges to find the matching value. no cap. πŸ’–


✨ SYNOPSIS ✨

int linear_range_get_value_array (const struct linear_range *r , int
ranges , unsigned int selector , unsigned int *val );

look at her. four params, one int coming back at you. iconic. πŸ‘‘


🫢 ARGUMENTS 🫢

  • r β€” pointer to array of linear ranges where value is looked from πŸ” (yes bestie, it's the array β€” the whole squad of ranges, not just one)
  • ranges β€” amount of ranges in an array πŸ”’ (you gotta tell her how many are in the group chat or she's just guessing)
  • selector β€” selector for which the value is searched 🎯 (this is the thing you're matching against)
  • val β€” address where found value is updated πŸ“¬ (she writes the answer here, so pls give her a real address, not a vibe)

πŸ’œ DESCRIPTION πŸ’œ

Search through an array of ranges for value which matches given selector. πŸ•΅οΈβ€β™€οΈβœ¨

that's it, that's the whole gig. she walks the array, checks each range, and if the selector lines up she hands you back the value. simple, clean, slays. πŸ’…


πŸ”₯ RETURN πŸ”₯

  • 0 on success πŸŽ‰ β€” we love a zero, zero means we ate
  • -EINVAL given selector is not found from any of the ranges 😭 β€” yeah, if the selector isn't in any of the ranges, that's the error you get. not found = -EINVAL, periodt. πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./lib/linear_ranges.c πŸ‘€ β€” go read the source, iykyk

and her whole friend group, fr fr:

ngl that's a lot of siblings but they're all valid 🌈⭐


and that's the page!! this one lives over in ./lib and it's dated October 2026 πŸŒΈπŸ¦‹ so yeah β€” lib directory legend, October 2026 edition, linear_range..._value_array(9), signing off πŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from