has_valid_limit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… has_valid_limit β€” a kernel API manual, but make it cute ✨

okay so real talk: this page lives in the Kernel API Manual (section 9, the kernel-API girlies 🧚), and today we're doing a vibe check on has_valid_limit. yes bestie, that's literally the whole function name, and yes it's exactly as iconic as it sounds πŸŽ€


✨ NAME ✨

has_valid_limit β€” checks if a power-related attribute has a valid limit value πŸ”₯

like, does this thing actually have a real limit, or is it giving nothing? we find out πŸ‘‘


🌸 SYNOPSIS 🌸

bool has_valid_limit (const char *name , const struct power_limits *limits );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • name β€” the name of the attribute to check. that's the string, the label, the little nametag 🏷️
  • limits β€” pointer to the power_limits structure containing limit values. this is where the actual numbers live πŸ’–

πŸ’œ DESCRIPTION πŸ’œ

okay so here's the tea β˜•: this function checks if a power-related attribute has a valid limit value. that's it, that's the job, and she does it flawlessly.

it returns false in two very specific situations, and only these two, no cap:

  • if limits is NULL 😭 (girl is not there, can't check a ghost)
  • if the corresponding limit value is zero πŸ’€

basically zero and NULL both fail the vibe check. everything else slays through as valid 🫢


⭐ RETURN ⭐

true if the attribute has a valid limit value, false otherwise 🌈

two outcomes. binary. clean. she ate πŸ’…


πŸŽ€ SEE ALSO πŸŽ€

kernel file ./drivers/platform/x86/asus-armoury.c β€” like, the actual source, go read her

honestly the whole friend group is worth a look:


lowkey a reminder bestie: false is not a bad thing here, it's just information πŸ’– don't take it personally

and that's the page!! πŸ¦‹πŸ’– sign-off time: this little baddie comes to you from ./drivers/platform/x86, and the date on the tag says October 2026 πŸ—“οΈβœ¨ ily, go check your limits, mwah πŸ’…πŸŽ€

πŸ“¦ where this page comes from