attr_current_value_store(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay bestie, meet attr_current_value_store(9) from the Kernel API Manual β€” its whole job is setting the current value of the attribute you point it at. iconic behavior, honestly πŸ’…

✨ SYNOPSIS ✨

ssize_t attr_current_value_store (struct kobject *kobj , struct
       kobj_attribute *kattr , const char *buf , size_t count , struct
       tunable_attr_01 *tunable_attr );

πŸŽ€ ARGUMENTS πŸŽ€

  • kobj β€” pointer to the driver object. main character pointer energy ✨
  • kattr β€” pointer to the attribute that's calling this function. it's giving self-awareness πŸͺž
  • buf β€” the buffer we read from; it gets parsed to int type. numbers go in, numbers come out πŸ”’
  • count β€” required by the sysfs attribute macros; you pass it in from the callee attr. mandatory lil paperwork πŸ“‹
  • tunable_attr β€” the attribute that's actually being stored. the one we're setting, periodt πŸ’–

🌸 DESCRIPTION 🌸

Okay so here's the vibe: this function sets the value of the given attribute, but only when you're operating under the "custom" smartfan profile. custom only, bestie 🌈

The current smartfan profile gets retrieved from the lenovo-wmi-gamezone driver, and if the result is not "custom", an error is returned. no custom profile, no storing 😭

It's designed to be generic on purpose, so it can be called from any integer attribute's "_store" function. reusable king πŸ‘‘ The integer that's headed to the WMI method gets range checked, and if it's out of range, an error code is returned. stay in your lane, number 🚧

And if the value is valid and WMI is a success? Then the sysfs attribute is notified. slay, notification delivered πŸŽ€

πŸ’… RETURN πŸ’…

Either count, or an error code. simple, clean, no cap ✨

🌈 SEE ALSO 🌈

Kernel file: ./drivers/platform/x86/lenovo/wmi-other.c go read it, iykyk πŸ’™


byeee 🫢 this page comes from ./drivers/platform/x86/lenovo, dated October 2026, and yes the title stays attr_current_value_store(9) ✨

πŸ“¦ where this page comes from