From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753708AbbG0OtA (ORCPT ); Mon, 27 Jul 2015 10:49:00 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:36001 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751412AbbG0Os7 (ORCPT ); Mon, 27 Jul 2015 10:48:59 -0400 Date: Mon, 27 Jul 2015 20:18:54 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Linux PM list , Linux Kernel Mailing List , Russell King - ARM Linux Subject: Re: [PATCH 2/7] cpufreq: Drop cpufreq_policy_restore() Message-ID: <20150727144854.GD18535@linux> References: <7868353.pEStq1MJ2a@vostro.rjw.lan> <3874727.Jpay9zgokc@vostro.rjw.lan> <1831805.k1h8RcvUky@vostro.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1831805.k1h8RcvUky@vostro.rjw.lan> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27-07-15, 16:03, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > Notice that when cpufreq_policy_restore() is called, its per-CPU > cpufreq_cpu_data variable has been already dereferenced and if that > variable is not NULL, the policy local pointer in cpufreq_add_dev() > contains its value. > > Therefore it is not necessary to dereference it again and the > policy pointer can be used directly. Moreover, if that pointer > is not NULL, the policy is inactive (or the previous check would > have made us return from cpufreq_add_dev()) so the restoration > code from cpufreq_policy_restore() can be moved to that point > in cpufreq_add_dev(). > > Do that and drop cpufreq_policy_restore(). > > Signed-off-by: Rafael J. Wysocki > --- > drivers/cpufreq/cpufreq.c | 44 +++++++++++--------------------------------- > 1 file changed, 11 insertions(+), 33 deletions(-) Acked-by: Viresh Kumar -- viresh