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] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 9 Sep 2011 16:09:25 -0700
From:	Greg KH <greg@...ah.com>
To:	Nitin Gupta <ngupta@...are.org>
Cc:	Jerome Marchand <jmarchan@...hat.com>,
	Pekka Enberg <penberg@...helsinki.fi>,
	Robert Jennings <rcj@...ux.vnet.ibm.com>,
	Linux Driver Project <devel@...uxdriverproject.org>,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/5] zram: Kernel config option for number of devices

On Fri, Sep 09, 2011 at 07:01:01PM -0400, Nitin Gupta wrote:
> Allows configuring default number of zram devices
> as kernel config option. User can override this
> value using 'num_devices' module parameter.

Ick, another config value, is this really needed?  Why can't we rely on
the module parameter instead?


> 
> Signed-off-by: Nitin Gupta <ngupta@...are.org>
> ---
>  drivers/staging/zram/Kconfig    |    9 +++++++++
>  drivers/staging/zram/zram_drv.c |   13 ++++++++-----
>  2 files changed, 17 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/zram/Kconfig b/drivers/staging/zram/Kconfig
> index 3bec4db..ca31cb3 100644
> --- a/drivers/staging/zram/Kconfig
> +++ b/drivers/staging/zram/Kconfig
> @@ -21,6 +21,15 @@ config ZRAM
>  	  See zram.txt for more information.
>  	  Project home: http://compcache.googlecode.com/
>  
> +config ZRAM_NUM_DEVICES
> +	int "Default number of zram devices"
> +	depends on ZRAM
> +	range 1 32
> +	default 1
> +	help
> +	  Select default number of zram devices. You can override this value
> +	  using 'num_devices' module parameter.
> +
>  config ZRAM_DEBUG
>  	bool "Compressed RAM block device debug support"
>  	depends on ZRAM
> diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
> index 03ec5a2..55f2c0e 100644
> --- a/drivers/staging/zram/zram_drv.c
> +++ b/drivers/staging/zram/zram_drv.c
> @@ -781,6 +781,14 @@ static int __init zram_init(void)
>  {
>  	int ret, dev_id;
>  
> +	/*
> +	 * Module parameter not specified by user. Use default
> +	 * value as defined during kernel config.
> +	 */
> +	if (num_devices == 0) {
> +		num_devices = CONFIG_ZRAM_NUM_DEVICES;
> +	}

Wrong coding style, which, for some odd reason, checkpatch doesn't
catch.  Please remove the braces.

thanks,

greg k-h
--
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