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]
Message-ID: <20170509053255.GA17481@vireshk-i7>
Date:   Tue, 9 May 2017 11:02:55 +0530
From:   Viresh Kumar <viresh.kumar@...aro.org>
To:     karthik@...hveda.org
Cc:     rmfrfs@...il.com, johan@...nel.org, elder@...nel.org,
        gregkh@...uxfoundation.org, devel@...verdev.osuosl.org,
        greybus-dev@...ts.linaro.org, sunil.m@...hveda.org,
        linux-kernel@...r.kernel.org
Subject: Re: [greybus-dev] [PATCH v2] Staging: greybus: light: Prefer kcalloc
 over kzalloc

On 08-05-17, 18:05, karthik@...hveda.org wrote:
> From: Karthik Tummala <karthik@...hveda.org>
> 
> Fixed following checkpatch.pl warning:
>  * WARNING: Prefer kcalloc over kzalloc with multiply
> 
> Instead of specifying no.of bytes * size as argument
> in kzalloc, prefer kcalloc.
> 
> Signed-off-by: Karthik Tummala <karthik@...hveda.org>
> Reviewed-by: Rui Miguel Silva <rmfrfs@...il.com>
> ---
> Changes for v2:
> - Changed subject line & fixed typo as suggested by
>   Rui Miguel Silva
> ---
>  drivers/staging/greybus/light.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c
> index 1681362..861a249 100644
> --- a/drivers/staging/greybus/light.c
> +++ b/drivers/staging/greybus/light.c
> @@ -1030,7 +1030,7 @@ static int gb_lights_light_config(struct gb_lights *glights, u8 id)
>  	light->channels_count = conf.channel_count;
>  	light->name = kstrndup(conf.name, NAMES_MAX, GFP_KERNEL);
>  
> -	light->channels = kzalloc(light->channels_count *
> +	light->channels = kcalloc(light->channels_count,
>  				  sizeof(struct gb_channel), GFP_KERNEL);
>  	if (!light->channels)
>  		return -ENOMEM;
> @@ -1167,7 +1167,7 @@ static int gb_lights_create_all(struct gb_lights *glights)
>  	if (ret < 0)
>  		goto out;
>  
> -	glights->lights = kzalloc(glights->lights_count *
> +	glights->lights = kcalloc(glights->lights_count,
>  				  sizeof(struct gb_light), GFP_KERNEL);
>  	if (!glights->lights) {
>  		ret = -ENOMEM;

Acked-by: Viresh Kumar <viresh.kumar@...aro.org>

-- 
viresh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ