Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1472964

[PATCH] cpufreq: Drop unnecessary check from cpufreq_policy_alloc()

From "Rafael J. Wysocki" <rjw@rjwysocki.net>
Newsgroups linux.kernel
Subject [PATCH] cpufreq: Drop unnecessary check from cpufreq_policy_alloc()
Date 2016-08-31 03:10 +0200
Message-ID <sc2cq-44s-9@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Since cpufreq_policy_alloc() doesn't use its dev variable for
anything useful, drop that variable from there along with the
NULL check against it.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/cpufreq/cpufreq.c |    4 ----
 1 file changed, 4 deletions(-)

Index: linux-pm/drivers/cpufreq/cpufreq.c
===================================================================
--- linux-pm.orig/drivers/cpufreq/cpufreq.c
+++ linux-pm/drivers/cpufreq/cpufreq.c
@@ -1073,13 +1073,9 @@ static void handle_update(struct work_st
 
 static struct cpufreq_policy *cpufreq_policy_alloc(unsigned int cpu)
 {
-	struct device *dev = get_cpu_device(cpu);
 	struct cpufreq_policy *policy;
 	int ret;
 
-	if (WARN_ON(!dev))
-		return NULL;
-
 	policy = kzalloc(sizeof(*policy), GFP_KERNEL);
 	if (!policy)
 		return NULL;

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] cpufreq: Drop unnecessary check from cpufreq_policy_alloc() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-08-31 03:10 +0200
  Re: [PATCH] cpufreq: Drop unnecessary check from  cpufreq_policy_alloc() Viresh Kumar <viresh.kumar@linaro.org> - 2016-08-31 06:00 +0200

csiph-web