module_param_named(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… module_param_named(9) β€” the Kernel API Manual, bestie edition ✨

okay so this page is from the Kernel API Manual, section 9, and the whole vibe is: making a module/cmdline parameter show up under a different name than the variable it lives in. iconic behavior tbh πŸŽ€


🌸 NAME 🌸

module_param_named β€” a typesafe helper for a renamed module/cmdline parameter. fr fr, typesafe and renamed, we love a multitasker πŸ’–


✨ SYNOPSIS ✨

module_param_named (name , value , type , perm );

that's the whole incantation, bestie β€” four args, no cap πŸ‘‘


🫢 ARGUMENTS 🫢

  • name β€” a valid C identifier which is the parameter name. yes, valid C identifier, the compiler is watching πŸ‘€
  • value β€” the actual lvalue to alter. the real thing, the main character, the variable in question πŸ’…
  • type β€” the type of the parameter. gotta say what it is, iykyk πŸ”₯
  • perm β€” visibility in sysfs. this is how visible you want to be, which honestly same 🌈

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so listen. usually it's a good idea to have variable names and user-exposed names the same β€” like, matching names, cute, consistent, we stan πŸ₯°

but that gets harder if the variable must be non-static, or if it's inside a structure. structures are not it, they play too much 😭

so this little helper allows exposure under a different name. that's the whole point. rename the vibe, keep the variable. periodt πŸ’…βœ¨


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/linux/moduleparam.h β€” the source of truth, the mothership, go read it 🧚

then the whole friend group:

module_param(9), module_param_unsafe(9), module_param_named_unsafe(9), module_param_cb(9), core_param_cb(9), postcore_param_cb(9), arch_param_cb(9), subsys_param_cb(9), fs_param_cb(9), device_param_cb(9), late_param_cb(9), core_param(9), core_param_unsafe(9), __core_param_cb(9), module_param_string(9), parameq(9), parameqn(9), module_param_array(9), module_param_array_named(9), module_param_hw_named(9), module_param_hw_array(9)

like i said β€” the whole squad, no one left behind πŸ«ΆπŸ’œ


🌸 that's the page!! huge shoutout to ./include/linux for hosting all this, dated October 2026, and to the Kernel API Manual for the home. stay typesafe, stay renamed, mwah πŸ’‹πŸŽ€πŸ’–

πŸ“¦ where this page comes from