ktime_compare_safe(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ktime_compare_safe β€” from the Kernel API Manual, bestie ✨

Okay so picture this: you're out here comparing two ktime structures, right? And like... what if they overflow? 😭 That's literally the whole plot of this macro. It's the glow-up version of the standard ktime_compare() function β€” same energy, but it also attempts to handle ktime overflows. Not me being obsessed with a safety net, but here we are 🫢


✨ SYNOPSIS ✨

ktime_compare_safe (A , B );

That's it. Two little arguments and you're seated πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • A β€” the first ktime value, aka the main character πŸ‘‘
  • B β€” the second ktime value, the costar of this little comparison πŸ¦‹

πŸ”₯ RETURN πŸ”₯

The vibe check results are in, and there are exactly three outcomes:

  • -1 if A < B
  • 0 if A == B
  • 1 if A > B

No in-between, no "it's complicated" β€” iconic behavior honestly πŸ’€


🌸 SEE ALSO 🌸


Quick reminder bestie: this one attempts to also handle ktime overflows β€” that word "attempts" is doing a lot of work so like, don't @ me, just know what you're getting into 😌

and that's the whole page, bestie πŸ’– straight from ./drivers/gpu/drm/msm/disp/dpu1, dated October 2026 β€” slay, ate, periodt πŸŽ€βœ¨

πŸ“¦ where this page comes from