module_param_named(9)
π 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
- 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