Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1529740
| From | Chanwoo Choi <cw00.choi@samsung.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/6] PM / devfreq: Fix the checkpatch warnings |
| Date | 2016-11-25 00:40 +0100 |
| Message-ID | <sHbMt-1dA-5@gated-at.bofh.it> (permalink) |
| References | (1 earlier) <sGUsi-6pb-27@gated-at.bofh.it> <sGZLk-1wb-11@gated-at.bofh.it> <sGZrY-1oP-47@gated-at.bofh.it> <sGZLk-1wb-9@gated-at.bofh.it> <sGZUZ-1zn-5@gated-at.bofh.it> |
| Organization | Samsung Electronics |
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
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 0/6] PM / devfreq: Modify devfreq/devfreq-event for improvement Chanwoo Choi <cw00.choi@samsung.com> - 2016-11-24 06:10 +0100
[PATCH 6/6] PM / devfreq: event: exynos-ppmu: Add the completion log of device registration Chanwoo Choi <cw00.choi@samsung.com> - 2016-11-24 06:10 +0100
[PATCH 2/6] PM / devfreq: Modify the device name as devfreq[X] for sysfs Chanwoo Choi <cw00.choi@samsung.com> - 2016-11-24 06:10 +0100
[PATCH 1/6] PM / devfreq: Fix the checkpatch warnings Chanwoo Choi <cw00.choi@samsung.com> - 2016-11-24 06:10 +0100
Re: [PATCH 1/6] PM / devfreq: Fix the checkpatch warnings Joe Perches <joe@perches.com> - 2016-11-24 11:30 +0100
Re: [PATCH 1/6] PM / devfreq: Fix the checkpatch warnings Chanwoo Choi <cw00.choi@samsung.com> - 2016-11-24 11:50 +0100
Re: [PATCH 1/6] PM / devfreq: Fix the checkpatch warnings Joe Perches <joe@perches.com> - 2016-11-24 12:00 +0100
Re: [PATCH 1/6] PM / devfreq: Fix the checkpatch warnings Chanwoo Choi <cw00.choi@samsung.com> - 2016-11-25 00:40 +0100
csiph-web