Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932349AbcK2GJ3 (ORCPT ); Tue, 29 Nov 2016 01:09:29 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:54342 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932669AbcK2GJY (ORCPT ); Tue, 29 Nov 2016 01:09:24 -0500 X-IMSS-HAND-OFF-DIRECTIVE: 127.0.0.1:10026 Date: Tue, 29 Nov 2016 11:39:11 +0530 From: Gautham R Shenoy To: Michael Ellerman Cc: "Gautham R. Shenoy" , Benjamin Herrenschmidt , Paul Mackerras , "Rafael J. Wysocki" , Daniel Lezcano , Michael Neuling , Vaidyanathan Srinivasan , "Shreyas B. Prabhu" , Shilpasri G Bhat , Stewart Smith , Balbir Singh , "Oliver O'Halloran" , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, skiboot@lists.ozlabs.org Subject: Re: [PATCH v3 2/3] cpuidle:powernv: Add helper function to populate powernv idle states. Reply-To: ego@linux.vnet.ibm.com References: <9c2b5cae68b54ec5dcb2651f352f740f1d09051c.1478760806.git.ego@linux.vnet.ibm.com> <87vavettkb.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87vavettkb.fsf@concordia.ellerman.id.au> User-Agent: Mutt/1.5.23 (2014-03-12) X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16112906-0056-0000-0000-0000021087C2 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006161; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000193; SDB=6.00786738; UDB=6.00380480; IPR=6.00564426; BA=6.00004923; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013476; XFM=3.00000011; UTC=2016-11-29 06:09:21 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16112906-0057-0000-0000-0000064391D2 Message-Id: <20161129060911.GA30454@in.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-29_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611290104 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1283 Lines: 45 Hi Michael, On Wed, Nov 23, 2016 at 08:49:08PM +1100, Michael Ellerman wrote: > "Gautham R. Shenoy" writes: > > > diff --git a/drivers/cpuidle/cpuidle-powernv.c b/drivers/cpuidle/cpuidle-powernv.c > > index 7fe442c..9240e08 100644 > > --- a/drivers/cpuidle/cpuidle-powernv.c > > +++ b/drivers/cpuidle/cpuidle-powernv.c > > @@ -243,28 +262,31 @@ static int powernv_add_idle_states(void) > > */ > > if (latency_ns[i] > POWERNV_THRESHOLD_LATENCY_NS) > > continue; > > + /* > > + * Firmware passes residency and latency values in ns. > > + * cpuidle expects it in us. > > + */ > > + exit_latency = ((unsigned int)latency_ns[i]) / 1000; > > + target_residency = (!rc) ? ((unsigned int)residency_ns[i]) : 0; > > + target_residency /= 1000; > > Urk. > > Can you just do it normally: > > if (rc == 0) > target_residency = (unsigned int)residency_ns[i] / 1000; Wrote this in a non-standard manner since the normal way would exceed 80 chars. > > I also don't see why you need the cast? It is a remnant from the previous code. But I see your point, the cast is redundant, and removing it will make it possible to implement this in the normal manner without checkpatch warning about it. > > cheers > -- Thanks and Regards gautham.