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


Groups > linux.kernel > #1190361

[PATCH 1/2] cpufreq: Rename two functions related to CPU offline

From "Rafael J. Wysocki" <rjw@rjwysocki.net>
Newsgroups linux.kernel
Subject [PATCH 1/2] cpufreq: Rename two functions related to CPU offline
Date 2015-07-23 01:40 +0200
Message-ID <pPbMf-60b-13@gated-at.bofh.it> (permalink)
References <pPbMe-60b-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Since __cpufreq_remove_dev_prepare() and __cpufreq_remove_dev_finish()
are about CPU offline rather than about CPU removal, rename them to
cpufreq_offline_prepare() and cpufreq_offline_finish(), respectively.

Also change their argument from a struct device pointer to a CPU
number, because they use the CPU number only internally anyway.

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

Index: linux-pm/drivers/cpufreq/cpufreq.c
===================================================================
--- linux-pm.orig/drivers/cpufreq/cpufreq.c
+++ linux-pm/drivers/cpufreq/cpufreq.c
@@ -1376,9 +1376,8 @@ out_release_rwsem:
 	return ret;
 }
 
-static void __cpufreq_remove_dev_prepare(struct device *dev)
+static void cpufreq_offline_prepare(unsigned int cpu)
 {
-	unsigned int cpu = dev->id;
 	struct cpufreq_policy *policy;
 
 	pr_debug("%s: unregistering CPU %u\n", __func__, cpu);
@@ -1423,9 +1422,8 @@ static void __cpufreq_remove_dev_prepare
 	}
 }
 
-static void __cpufreq_remove_dev_finish(struct device *dev)
+static void cpufreq_offline_finish(unsigned int cpu)
 {
-	unsigned int cpu = dev->id;
 	struct cpufreq_policy *policy = per_cpu(cpufreq_cpu_data, cpu);
 
 	if (!policy) {
@@ -1467,8 +1465,8 @@ static int cpufreq_remove_dev(struct dev
 		return 0;
 
 	if (cpu_online(cpu)) {
-		__cpufreq_remove_dev_prepare(dev);
-		__cpufreq_remove_dev_finish(dev);
+		cpufreq_offline_prepare(cpu);
+		cpufreq_offline_finish(cpu);
 	}
 
 	/* sysfs links are removed only on subsys callback */
@@ -2360,11 +2358,11 @@ static int cpufreq_cpu_callback(struct n
 			break;
 
 		case CPU_DOWN_PREPARE:
-			__cpufreq_remove_dev_prepare(dev);
+			cpufreq_offline_prepare(cpu);
 			break;
 
 		case CPU_POST_DEAD:
-			__cpufreq_remove_dev_finish(dev);
+			cpufreq_offline_finish(cpu);
 			break;
 
 		case CPU_DOWN_FAILED:

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

[PATCH 0/2] cpufreq: Better separation of device addition/removal and online/offline paths "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-23 01:40 +0200
  [PATCH 1/2] cpufreq: Rename two functions related to CPU offline "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-23 01:40 +0200
    Re: [PATCH 1/2] cpufreq: Rename two functions related to CPU offline Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-23 08:50 +0200
  [PATCH 1/7] cpufreq: Rework two functions related to CPU offline "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-27 15:50 +0200
    Re: [PATCH 1/7] cpufreq: Rework two functions related to CPU offline Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-27 16:50 +0200
  [PATCH 0/7] cpufreq: Better separation of device addition/removal and online/offline paths "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-27 15:50 +0200
    [PATCH 6/7] cpufreq: Pass CPU number to cpufreq_policy_alloc() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-27 15:50 +0200
      Re: [PATCH 6/7] cpufreq: Pass CPU number to cpufreq_policy_alloc() Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-27 17:00 +0200
    [PATCH 3/7] cpufreq: Drop unnecessary label from cpufreq_add_dev() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-27 15:50 +0200
      Re: [PATCH 3/7] cpufreq: Drop unnecessary label from  cpufreq_add_dev() Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-27 17:00 +0200
    [PATCH 7/7] cpufreq: Separate CPU device removal from CPU online "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-27 15:50 +0200
      Re: [PATCH 7/7] cpufreq: Separate CPU device removal from CPU online Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-27 17:10 +0200
        Re: [PATCH 7/7] cpufreq: Separate CPU device removal from CPU online "Rafael J. Wysocki" <rafael@kernel.org> - 2015-07-28 00:00 +0200
      [Update][PATCH 7/7] cpufreq: Separate CPU device registration from CPU online "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-27 23:30 +0200
        [Update 2x][PATCH 7/7] cpufreq: Separate CPU device registration from CPU online "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-29 02:40 +0200
          [PATCH] cpufreq: Replace recover_policy with new_policy in cpufreq_online() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-29 02:50 +0200
            Re: [PATCH] cpufreq: Replace recover_policy with new_policy in  cpufreq_online() Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-29 07:40 +0200
          Re: [Update 2x][PATCH 7/7] cpufreq: Separate CPU device registration  from CPU online Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-29 07:40 +0200
            Re: [Update 2x][PATCH 7/7] cpufreq: Separate CPU device registration  from CPU online Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-29 16:10 +0200
            Re: [Update 2x][PATCH 7/7] cpufreq: Separate CPU device registration  from CPU online "Rafael J. Wysocki" <rafael@kernel.org> - 2015-07-29 16:10 +0200
    [PATCH 4/7] cpufreq: Drop unused dev argument from two functions "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-27 15:50 +0200
      Re: [PATCH 4/7] cpufreq: Drop unused dev argument from two functions Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-27 17:00 +0200
    [PATCH 5/7] cpufreq: Do not update related_cpus on every policy activation "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-27 15:50 +0200
      Re: [PATCH 5/7] cpufreq: Do not update related_cpus on every policy  activation Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-27 17:00 +0200
    [PATCH 2/7] cpufreq: Drop cpufreq_policy_restore() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-07-27 15:50 +0200
      Re: [PATCH 2/7] cpufreq: Drop cpufreq_policy_restore() Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-27 16:50 +0200

csiph-web