From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938966AbcKXKwo (ORCPT ); Thu, 24 Nov 2016 05:52:44 -0500 Received: from smtprelay0066.hostedemail.com ([216.40.44.66]:38980 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935138AbcKXKwm (ORCPT ); Thu, 24 Nov 2016 05:52:42 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:152:355:379:541:599:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3352:3622:3865:3866:4321:5007:6119:7774:7901:8603:10004:10400:10848:11026:11232:11658:11914:12296:12740:13069:13311:13357:13894:14096:14097:14659:14721:21080:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: food91_6e95556f5d725 X-Filterd-Recvd-Size: 2230 Message-ID: <1479984758.19726.7.camel@perches.com> Subject: Re: [PATCH 1/6] PM / devfreq: Fix the checkpatch warnings From: Joe Perches To: Chanwoo Choi , 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 Date: Thu, 24 Nov 2016 02:52:38 -0800 In-Reply-To: <5836C4F9.2010509@samsung.com> References: <1479963668-22845-1-git-send-email-cw00.choi@samsung.com> <1479963668-22845-2-git-send-email-cw00.choi@samsung.com> <1479982838.19726.3.camel@perches.com> <5836C4F9.2010509@samsung.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.1-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.