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, 25 Nov 2016 08:37:40 +0900
From:   Chanwoo Choi <cw00.choi@...sung.com>
To:     Joe Perches <joe@...ches.com>, myungjoo.ham@...sung.com,
        kyungmin.park@...sung.com
Cc:     rjw@...ysocki.net, chanwoo@...nel.org, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/6] PM / devfreq: Fix the checkpatch warnings

On 2016년 11월 24일 19:52, Joe Perches wrote:
> On Thu, 2016-11-24 at 19:46 +0900, Chanwoo Choi wrote:
>> On 2016년 11월 24일 19:20, Joe Perches wrote:
>>> On Thu, 2016-11-24 at 14:01 +0900, Chanwoo Choi wrote:
>>>> This patch just fixes the checkpatch warnings.
>>>
>>> unrelated trivia:
>>>
>>>> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> []
>>>> @@ -576,11 +575,13 @@ struct devfreq *devfreq_add_device(struct device *dev,
>>>>  		goto err_out;
>>>>  	}
>>>>  
>>>> -	devfreq->trans_table =	devm_kzalloc(&devfreq->dev, sizeof(unsigned int) *
>>>> +	devfreq->trans_table =	devm_kzalloc(&devfreq->dev,
>>>> +						sizeof(unsigned int) *
>>>>  						devfreq->profile->max_state *
>>>>  						devfreq->profile->max_state,
>>>>  						GFP_KERNEL);
>>>> -	devfreq->time_in_state = devm_kzalloc(&devfreq->dev, sizeof(unsigned long) *
>>>> +	devfreq->time_in_state = devm_kzalloc(&devfreq->dev,
>>>> +						sizeof(unsigned long) *
>>>>  						devfreq->profile->max_state,
>>>>  						GFP_KERNEL);
>>>
>>> Maybe these should be devm_kcalloc calls
>>
>> Why should devfreq use the devm_kcalloc?
> 
> Because these are allocating zeroed arrays of a specific size.

kzalloc is already set to zero.

[1]https://www.kernel.org/doc/htmldocs/kernel-api/API-kzalloc.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ