in_circular_range(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« in_circular_range πŸ’«

okay bestie, gather round, because today we're looking at a little kernel helper called in_circular_range β€” it's a helper function to check if a value is within the range of two numbers (circular range) ✨ and honestly? it's giving "tiny function, big responsibility." this one lives in the Kernel API Manual (section 9, for all my fellow kernel-girlies πŸŽ€) and she's here to do exactly one thing and do it well.


✨ SYNOPSIS ✨

bool in_circular_range (uint32_t start , uint32_t end , uint32_t value
);

yes ma'am, that's the whole signature πŸ’… three uint32_t args in, one bool out. simple. iconic. no cap.


🌸 ARGUMENTS 🌸

ngl the original docs were a little shy here, so let me give you exactly what they give us β€” nothing more, nothing less, fr fr:

  • start β€” -- undescribed -- πŸ™ˆ
  • end β€” -- undescribed -- πŸ™ˆ
  • value β€” -- undescribed -- πŸ™ˆ
not me pointing out that all three are literally marked -- undescribed -- 😭 the manpage said "figure it out babes." iykyk.

πŸ¦‹ RETURN πŸ¦‹

she returns True if value is within the range of [start, end], where start and end can be a circular range (i.e., start > end) πŸ”₯ β€” that's the whole plot twist, bestie, the range wraps around!

and then, no joke, the original page hits you with this legendary line of asterisks, which we are preserving in all its chaotic glory:

***********************************************************************************************************

main character energy honestly. πŸ’€


πŸ‘‘ SEE ALSO πŸ‘‘

🧚 Kernel file

lowkey the actual source file path is a whole journey:

./drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_standalone_libraries/alternate_pstate_shared_lib.c

she's long, she's specific, she's that girl. 🌈

these are the siblings/cousins/group-chat members you should also go read:

like, the entire swath-lore extended universe 🫢 go read them, they're obsessed with you too.


aaaand that's the page, bestie! πŸ“ this lil cutie comes to you from the source file ./drivers/gpu/drm/amd/display/... (yes, the ... is doing a lot of heavy lifting there πŸ’…) and she's dated October 2026, all wrapped up under in_circular_range(9). slay, no notes, periodt. πŸ’–βœ¨

πŸ“¦ where this page comes from