From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751119AbcEITWE (ORCPT ); Mon, 9 May 2016 15:22:04 -0400 Received: from mga11.intel.com ([192.55.52.93]:49482 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750978AbcEITWD (ORCPT ); Mon, 9 May 2016 15:22:03 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,601,1455004800"; d="scan'208";a="949450946" Message-ID: <1462821776.27421.85.camel@linux.intel.com> Subject: Re: [PATCH] intel_pstate: Clean up intel_pstate_get() From: Srinivas Pandruvada To: "Rafael J. Wysocki" , Linux PM list Cc: Linux Kernel Mailing List Date: Mon, 09 May 2016 12:22:56 -0700 In-Reply-To: <6744251.0XRRsX0MUN@vostro.rjw.lan> References: <6744251.0XRRsX0MUN@vostro.rjw.lan> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.2 (3.18.5.2-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 Sat, 2016-05-07 at 02:24 +0200, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > intel_pstate_get() contains a local variable that's initialized but > never used and it can be written in fewer lines of code, so clean > it up. > > Signed-off-by: Rafael J. Wysocki Acked-by: Srinivas Pandruvada > --- >  drivers/cpufreq/intel_pstate.c |    9 ++------- >  1 file changed, 2 insertions(+), 7 deletions(-) > > Index: linux-pm/drivers/cpufreq/intel_pstate.c > =================================================================== > --- linux-pm.orig/drivers/cpufreq/intel_pstate.c > +++ linux-pm/drivers/cpufreq/intel_pstate.c > @@ -1390,14 +1390,9 @@ static int intel_pstate_init_cpu(unsigne >   >  static unsigned int intel_pstate_get(unsigned int cpu_num) >  { > - struct sample *sample; > - struct cpudata *cpu; > + struct cpudata *cpu = all_cpu_data[cpu_num]; >   > - cpu = all_cpu_data[cpu_num]; > - if (!cpu) > - return 0; > - sample = &cpu->sample; > - return get_avg_frequency(cpu); > + return cpu ? get_avg_frequency(cpu) : 0; >  } >   >  static void intel_pstate_set_update_util_hook(unsigned int cpu_num) >