From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752033AbcBEHJW (ORCPT ); Fri, 5 Feb 2016 02:09:22 -0500 Received: from mail-pa0-f42.google.com ([209.85.220.42]:35221 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750846AbcBEHJU (ORCPT ); Fri, 5 Feb 2016 02:09:20 -0500 Date: Fri, 5 Feb 2016 12:39:17 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Linux PM list , Linux Kernel Mailing List , Srinivas Pandruvada , Juri Lelli , Steve Muckle , Saravana Kannan Subject: Re: [PATCH v2 3/10] cpufreq: governor: Avoid passing dbs_data pointers around unnecessarily Message-ID: <20160205070917.GF21792@vireshk> References: <3705929.bslqXH980s@vostro.rjw.lan> <9008098.QDD8C89zDx@vostro.rjw.lan> <2409601.HbxMdSfn4m@vostro.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2409601.HbxMdSfn4m@vostro.rjw.lan> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05-02-16, 03:15, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > Do not pass struct dbs_data pointers to the family of functions > implementing governor operations in cpufreq_governor.c as they can > take that pointer from policy->governor by themselves. > > The cpufreq_governor_init() case is slightly more complicated, since > policy->governor may be NULL when it is invoked, but then it can reach > the pointer in question via its cdata argument just fine. > > While at it, rework cpufreq_governor_dbs() to avoid a pointless > policy_governor check in the CPUFREQ_GOV_POLICY_INIT case. > > Signed-off-by: Rafael J. Wysocki > --- > drivers/cpufreq/cpufreq_governor.c | 68 ++++++++++++++----------------------- > 1 file changed, 27 insertions(+), 41 deletions(-) Took some time to review, but it looks nice cleanup :) Acked-by: Viresh Kumar -- viresh