has_valid_limit(9)
π 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 thepower_limitsstructure 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
limitsisNULLπ (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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms