lkml.org 
[lkml]   [2015]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 4/8] moduleparam.h: add module_param_config_*() helpers
Date
"Luis R. Rodriguez" <mcgrof@do-not-panic.com> writes:
> From: "Luis R. Rodriguez" <mcgrof@suse.com>
>
> This adds a couple of bool module_param_config_*() helpers
> which are designed to let us easily associate a boolean
> module parameter with an associated kernel configuration
> option.

OK.

> Folks can use this to avoid what typically would
> be #ifdef eyesores around module parameter declarations.

Really? So you use this in two patches:

/* see the comment above the definition of WQ_POWER_EFFICIENT */
-static bool wq_power_efficient = IS_ENABLED(CONFIG_WQ_POWER_EFFICIENT_DEFAULT);
-module_param_named(power_efficient, wq_power_efficient, bool, 0444);
+module_param_config_on_off(power_efficient, wq_power_efficient, 0444, CONFIG_WQ_POWER_EFFICIENT_DEFAULT);

And:

static bool sig_enforce = IS_ENABLED(CONFIG_MODULE_SIG_FORCE);
#ifndef CONFIG_MODULE_SIG_FORCE
-module_param(sig_enforce, bool_enable_only, 0644);
+module_param_config_on(sig_enforce, sig_enforce, 0644, CONFIG_MODULE_SIG_FORCE);
#endif /* !CONFIG_MODULE_SIG_FORCE */

But neither actually, y'know, cleans up any #ifdefs.

Simplicity is a major virtue. Readability is a major virtue. Brevity
is only a minor virtue.

So I have applied the following patches:

[PATCH v2 1/8] kernel/params: constify struct kernel_param_ops uses
[PATCH v2 2/8] kernel/module.c: use generic module param operaters for sig_enforce
[PATCH v2 3/8] kernel/params.c: generalize bool_enable_only
[PATCH v2 5/8] kernel/workqueue.c: remove ifdefs over wq_power_efficient
[PATCH v2 7/8] kernel/module.c: avoid ifdefs for sig_enforce declaration

Thanks,
Rusty.


\
 
 \ /
  Last update: 2015-04-23 05:41    [W:0.059 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site