All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: Joe Perches <joe@perches.com>,
	myungjoo.ham@samsung.com, kyungmin.park@samsung.com
Cc: rjw@rjwysocki.net, chanwoo@kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/6] PM / devfreq: Fix the checkpatch warnings
Date: Fri, 25 Nov 2016 08:37:40 +0900	[thread overview]
Message-ID: <583779C4.9070707@samsung.com> (raw)
In-Reply-To: <1479984758.19726.7.camel@perches.com>

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


  reply	other threads:[~2016-11-24 23:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20161124050125epcas1p466fc832e77cfe122454b8d40d0f6744e@epcas1p4.samsung.com>
2016-11-24  5:01 ` [PATCH 0/6] PM / devfreq: Modify devfreq/devfreq-event for improvement Chanwoo Choi
2016-11-24  5:01   ` [PATCH 1/6] PM / devfreq: Fix the checkpatch warnings Chanwoo Choi
2016-11-24 10:20     ` Joe Perches
2016-11-24 10:46       ` Chanwoo Choi
2016-11-24 10:52         ` Joe Perches
2016-11-24 23:37           ` Chanwoo Choi [this message]
2016-11-24  5:01   ` [PATCH 2/6] PM / devfreq: Modify the device name as devfreq[X] for sysfs Chanwoo Choi
2016-11-24  5:01   ` [PATCH 3/6] PM / devfreq: event: Simplify the sysfs name of devfreq-event device Chanwoo Choi
2016-11-24  5:01   ` [PATCH 4/6] PM / devfreq: Remove the duplicate sysfs entry for current frequency Chanwoo Choi
2016-11-24  5:01   ` [PATCH 5/6] PM / devfreq: event: exynos-ppmu: Use the regmap interface to handle the registers Chanwoo Choi
2016-11-24  5:01   ` [PATCH 6/6] PM / devfreq: event: exynos-ppmu: Add the completion log of device registration Chanwoo Choi
2016-12-15  9:56   ` [PATCH 0/6] PM / devfreq: Modify devfreq/devfreq-event for improvement Chanwoo Choi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=583779C4.9070707@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=chanwoo@kernel.org \
    --cc=joe@perches.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.