All of lore.kernel.org
 help / color / mirror / Atom feed
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Linux PM list <linux-pm@vger.kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] intel_pstate: Clean up intel_pstate_get()
Date: Mon, 09 May 2016 12:22:56 -0700	[thread overview]
Message-ID: <1462821776.27421.85.camel@linux.intel.com> (raw)
In-Reply-To: <6744251.0XRRsX0MUN@vostro.rjw.lan>

On Sat, 2016-05-07 at 02:24 +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> 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 <rafael.j.wysocki@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

> ---
>  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)
> 

      reply	other threads:[~2016-05-09 19:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-07  0:24 [PATCH] intel_pstate: Clean up intel_pstate_get() Rafael J. Wysocki
2016-05-09 19:22 ` Srinivas Pandruvada [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1462821776.27421.85.camel@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.