[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150421152136.GC9455@htj.duckdns.org>
Date: Tue, 21 Apr 2015 11:21:36 -0400
From: Tejun Heo <tj@...nel.org>
To: "Luis R. Rodriguez" <mcgrof@...not-panic.com>
Cc: rusty@...tcorp.com.au, linux-kernel@...r.kernel.org,
linux-wireless@...r.kernel.org, keescook@...omium.org,
casey@...aufler-ca.com, cocci@...teme.lip6.fr,
"Luis R. Rodriguez" <mcgrof@...e.com>,
Jani Nikula <jani.nikula@...el.com>,
Christoph Hellwig <hch@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Hannes Reinecke <hare@...e.de>, Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH v1 4/6] moduleparam.h: add module_param_config_*() helpers
On Mon, Apr 20, 2015 at 04:30:35PM -0700, Luis R. Rodriguez wrote:
> /**
> + * module_param_config_on_off - bool parameter with run time override
> + * @name: a valid C identifier which is the parameter name.
> + * @value: the actual lvalue to alter.
> + * @perm: visibility in sysfs.
> + * @config: kernel parameter which will enable this option if this
> + * kernel configuration option has been enabled.
> + *
> + * This lets you define a bool module paramter which by default will be
> + * set to true if the config option has been set on your kernel's
> + * configuration, otherwise it is set to false.
> + */
> +#define module_param_config_on_off(name, var, perm, config) \
> + static bool var = IS_ENABLED(config); \
> + module_param_named(name, var, bool, perm);
Maybe we want to make @config just a boolean initializer?
e.g. something like
#define module_param_config_on_off(name, var, perm, on_off) \
static bool var = on_off; \
module_param_named(name, var, bool, perm);
so that the caller does IS_ENABLED() or whatever that's necessary? It
just seems a bit too restricted.
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists