linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Rafael Wysocki <rjw@rjwysocki.net>
Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org,
	prarit@redhat.com, skannan@codeaurora.org,
	Viresh Kumar <viresh.kumar@linaro.org>
Subject: [PATCH 10/17] cpufreq: get rid of CONFIG_{HOTPLUG_CPU|SMP} mess
Date: Fri,  2 Jan 2015 12:34:31 +0530	[thread overview]
Message-ID: <dda29d27d5ed0c47cacbb2f599c55bf095f1d693.1420181916.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1420181916.git.viresh.kumar@linaro.org>
In-Reply-To: <cover.1420181916.git.viresh.kumar@linaro.org>

These are messing up more than the benefit they provide. It isn't a lot of code
anyway, that we will compile without them.

Kill them.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/cpufreq.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 9595107477a6..3893c87739d1 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -957,7 +957,6 @@ static void cpufreq_init_policy(struct cpufreq_policy *policy)
 	}
 }
 
-#ifdef CONFIG_HOTPLUG_CPU
 static int cpufreq_add_policy_cpu(struct cpufreq_policy *policy,
 				  unsigned int cpu, struct device *dev)
 {
@@ -995,7 +994,6 @@ static int cpufreq_add_policy_cpu(struct cpufreq_policy *policy,
 
 	return sysfs_create_link(&dev->kobj, &policy->kobj, "cpufreq");
 }
-#endif
 
 static struct cpufreq_policy *cpufreq_policy_restore(unsigned int cpu)
 {
@@ -1100,19 +1098,15 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif)
 {
 	unsigned int j, cpu = dev->id;
 	int ret = -ENOMEM;
-	struct cpufreq_policy *policy;
+	struct cpufreq_policy *policy, *tpolicy;
 	unsigned long flags;
 	bool recover_policy = cpufreq_suspended;
-#ifdef CONFIG_HOTPLUG_CPU
-	struct cpufreq_policy *tpolicy;
-#endif
 
 	if (cpu_is_offline(cpu))
 		return 0;
 
 	pr_debug("adding CPU %u\n", cpu);
 
-#ifdef CONFIG_SMP
 	/* check whether a different CPU already registered this
 	 * CPU because it is in the same boat. */
 	policy = cpufreq_cpu_get(cpu);
@@ -1120,12 +1114,10 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif)
 		cpufreq_cpu_put(policy);
 		return 0;
 	}
-#endif
 
 	if (!down_read_trylock(&cpufreq_rwsem))
 		return 0;
 
-#ifdef CONFIG_HOTPLUG_CPU
 	/* Check if this cpu was hot-unplugged earlier and has siblings */
 	read_lock_irqsave(&cpufreq_driver_lock, flags);
 	list_for_each_entry(tpolicy, &cpufreq_policy_list, policy_list) {
@@ -1137,7 +1129,6 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif)
 		}
 	}
 	read_unlock_irqrestore(&cpufreq_driver_lock, flags);
-#endif
 
 	/*
 	 * Restore the saved policy when doing light-weight init and fall back
-- 
2.2.0


  parent reply	other threads:[~2015-01-02  7:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-02  7:04 [PATCH 00/17] cpufreq: trivial cleanups Viresh Kumar
2015-01-02  7:04 ` [PATCH 01/17] cpufreq: remove dangling comment Viresh Kumar
2015-01-02  7:04 ` [PATCH 02/17] cpufreq: remove extra parenthesis Viresh Kumar
2015-01-02  7:04 ` [PATCH 03/17] cpufreq: don't need line break in show_scaling_cur_freq() Viresh Kumar
2015-01-02  7:04 ` [PATCH 04/17] cpufreq: merge 'if' blocks in __cpufreq_remove_dev_prepare() Viresh Kumar
2015-01-02  7:04 ` [PATCH 05/17] cpufreq: s/__find_governor/find_governor Viresh Kumar
2015-01-02  7:04 ` [PATCH 06/17] cpufreq: No need to check for has_target() Viresh Kumar
2015-01-02  7:04 ` [PATCH 07/17] cpufreq: pass policy to cpufreq_out_of_sync Viresh Kumar
2015-01-02  7:04 ` [PATCH 08/17] cpufreq: pass policy to __cpufreq_get() Viresh Kumar
2015-01-02  7:04 ` [PATCH 09/17] cpufreq: update driver_data->flags only if we are registering driver Viresh Kumar
2015-01-02  7:04 ` Viresh Kumar [this message]
2015-01-02  7:04 ` [PATCH 11/17] cpufreq: get rid of 'tpolicy' from __cpufreq_add_dev() Viresh Kumar
2015-01-02  7:04 ` [PATCH 12/17] cpufreq: use light-weight cpufreq_cpu_get_raw() in __cpufreq_add_dev Viresh Kumar
2015-01-02  7:04 ` [PATCH 13/17] cpufreq: limit the scope of l_p_j variables Viresh Kumar
2015-01-02  7:04 ` [PATCH 14/17] cpufreq: check cpufreq_policy_list instead of scanning policies for all CPUs Viresh Kumar
2015-01-02  7:04 ` [PATCH 15/17] cpufreq: don't check if cpu > nr_cpu_ids Viresh Kumar
2015-01-02  7:04 ` [PATCH 16/17] cpufreq: remove check for cpufreq_disabled() from cpufreq_cpu_{get|put}() Viresh Kumar
2015-01-25 13:24   ` Viresh Kumar
2015-01-26  0:39     ` Rafael J. Wysocki
2015-01-27  3:47       ` Viresh Kumar
2015-01-02  7:04 ` [PATCH 17/17] cpufreq: move some initialization stuff to cpufreq_policy_alloc() Viresh Kumar
2015-01-12  6:11 ` [PATCH 00/17] cpufreq: trivial cleanups Viresh Kumar

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=dda29d27d5ed0c47cacbb2f599c55bf095f1d693.1420181916.git.viresh.kumar@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=prarit@redhat.com \
    --cc=rjw@rjwysocki.net \
    --cc=skannan@codeaurora.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).