From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752761AbcEMAge (ORCPT ); Thu, 12 May 2016 20:36:34 -0400 Received: from mga04.intel.com ([192.55.52.120]:58862 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751249AbcEMAgd (ORCPT ); Thu, 12 May 2016 20:36:33 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,611,1455004800"; d="scan'208";a="979142933" Message-ID: <1463099765.991.26.camel@linux.intel.com> Subject: Re: [PATCH] intel_pstate: Simplify conditional in intel_pstate_set_policy() From: Srinivas Pandruvada To: "Rafael J. Wysocki" , Linux PM list Cc: Linux Kernel Mailing List Date: Thu, 12 May 2016 17:36:05 -0700 In-Reply-To: <3708662.2e5qAbF2Fs@vostro.rjw.lan> References: <3708662.2e5qAbF2Fs@vostro.rjw.lan> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.3 (3.18.3-1.fc23) 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-05-12 at 00:46 +0200, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > One of the if () statements in intel_pstate_set_policy() causes > another if () to be evaluated if the condition is true and it > doesn't do anything else, so merge the two if () statements into > one. > > No functional changes. > > Signed-off-by: Rafael J. Wysocki     Acked-by: Srinivas Pandruvada > --- >  drivers/cpufreq/intel_pstate.c |   11 +++++------ >  1 file changed, 5 insertions(+), 6 deletions(-) > > Index: linux-pm/drivers/cpufreq/intel_pstate.c > =================================================================== > --- linux-pm.orig/drivers/cpufreq/intel_pstate.c > +++ linux-pm/drivers/cpufreq/intel_pstate.c > @@ -1449,12 +1449,11 @@ static int intel_pstate_set_policy(struc >   intel_pstate_clear_update_util_hook(policy->cpu); >   >   cpu = all_cpu_data[0]; > - if (cpu->pstate.max_pstate_physical > cpu- > >pstate.max_pstate) { > - if (policy->max < policy->cpuinfo.max_freq && > -     policy->max > cpu->pstate.max_pstate * cpu- > >pstate.scaling) { > - pr_debug("policy->max > max non turbo > frequency\n"); > - policy->max = policy->cpuinfo.max_freq; > - } > + if (cpu->pstate.max_pstate_physical > cpu->pstate.max_pstate > && > +     policy->max < policy->cpuinfo.max_freq && > +     policy->max > cpu->pstate.max_pstate * cpu- > >pstate.scaling) { > + pr_debug("policy->max > max non turbo frequency\n"); > + policy->max = policy->cpuinfo.max_freq; >   } >   >   if (policy->policy == CPUFREQ_POLICY_PERFORMANCE) { > > -- > To unsubscribe from this list: send the line "unsubscribe linux-pm" > in > the body of a message to majordomo@vger.kernel.org > More majordomo info at  http://vger.kernel.org/majordomo-info.html