lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 22 Apr 2015 17:42:08 +0200
From:	"Luis R. Rodriguez" <mcgrof@...e.com>
To:	Rusty Russell <rusty@...tcorp.com.au>
Cc:	"Luis R. Rodriguez" <mcgrof@...not-panic.com>,
	linux-kernel@...r.kernel.org, linux-wireless@...r.kernel.org,
	keescook@...omium.org, casey@...aufler-ca.com,
	cocci@...teme.lip6.fr, 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>, Tejun Heo <tj@...nel.org>,
	Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH v1 4/6] moduleparam.h: add module_param_config_*() helpers

On Wed, Apr 22, 2015 at 04:45:04PM +0930, Rusty Russell wrote:
> "Luis R. Rodriguez" <mcgrof@...not-panic.com> writes:
> > From: "Luis R. Rodriguez" <mcgrof@...e.com>
> >
> > This adds a couple of bool module_param_config_*() helpers
> > which are designed to let us easily associate a booloean
> > module parameter with an associated kernel configuration
> > option, and to help us remove #ifdef'ery eyesores.
> 
> But they don't.  And I had to read the descriptions twice to understand
> what you're doing.
> 
> eg you use it like this:
> 
>  -#ifdef CONFIG_WQ_POWER_EFFICIENT_DEFAULT
>  -static bool wq_power_efficient = true;
>  -#else
>  -static bool wq_power_efficient;
>  -#endif
>  -
>  -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);
> 
> It would be much clearer to do this:
> 
>  -#ifdef CONFIG_WQ_POWER_EFFICIENT_DEFAULT
>  -static bool wq_power_efficient = true;
>  -#else
>  -static bool wq_power_efficient;
>  -#endif
>  +static bool wq_power_efficient = IS_ENABLED(CONFIG_WQ_POWER_EFFICIENT_DEFAULT);
> 
> I know exactly what that does without having to notice the difference
> between module_param_config_on_off() and module_param_config_on().

You're right, I forgot a small step patch in between to make the change
clearer. I can add that in my next respin, anything else or do the other
changes  look OK?

 Luis
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ