Skip to contentSkip to conversation

cpufreq: intel_pstate: Remove duplicate CPU ID check

PATCH NAK Stratos Karafotis 4 participants 4 messages Jun 9, 2014 – Jun 11, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/7 cpufreq: intel_pstate: Remove duplicate CPU ID check

We check the CPU ID during driver init. There is no need to do it again per logical CPU initialization.

So, remove the duplicate check.

---
 drivers/cpufreq/intel_pstate.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/cpufreq/intel_pstate.c +0 -6
index aebd457..4e7f492 100644
@@ -691,14 +691,8 @@ MODULE_DEVICE_TABLE(x86cpu, intel_pstate_cpu_ids);
 
 static int intel_pstate_init_cpu(unsigned int cpunum)
 {
-
-	const struct x86_cpu_id *id;
 	struct cpudata *cpu;
 
-	id = x86_match_cpu(intel_pstate_cpu_ids);
-	if (!id)
-		return -ENODEV;
-
 	all_cpu_data[cpunum] = kzalloc(sizeof(struct cpudata), GFP_KERNEL);
 	if (!all_cpu_data[cpunum])
 		return -ENOMEM;
Signature · 1 line
1.9.3
maintainer Acked-by on v1 1/7
#1 lore raw
Quoted 19 lines · Stratos Karafotis

We check the CPU ID during driver init. There is no need to do it again per logical CPU initialization.

So, remove the duplicate check.

---
 drivers/cpufreq/intel_pstate.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/cpufreq/intel_pstate.c +0 -1
index aebd457..4e7f492 100644
@@ -691,14 +691,8 @@ MODULE_DEVICE_TABLE(x86cpu, intel_pstate_cpu_ids);
 
 static int intel_pstate_init_cpu(unsigned int cpunum)
 {
-

drivers/cpufreq/intel_pstate.c MODULE_DEVICE_TABLE(x86cpu, intel_pstate_cpu_ids); · line 698

Quoted 10 lines
drivers/cpufreq/intel_pstate.c +0 -5
-       const struct x86_cpu_id *id;
        struct cpudata *cpu;
 
-       id = x86_match_cpu(intel_pstate_cpu_ids);
-       if (!id)
-               return -ENODEV;
-
        all_cpu_data[cpunum] = kzalloc(sizeof(struct cpudata), GFP_KERNEL);
        if (!all_cpu_data[cpunum])
                return -ENOMEM;
#2 lore raw
Quoted 23 lines · Viresh Kumar
Quoted 22 lines · Stratos Karafotis

We check the CPU ID during driver init. There is no need to do it again per logical CPU initialization.

So, remove the duplicate check.

---
  drivers/cpufreq/intel_pstate.c | 6 ------
  1 file changed, 6 deletions(-)
drivers/cpufreq/intel_pstate.c +0 -2
index aebd457..4e7f492 100644
@@ -691,14 +691,8 @@ MODULE_DEVICE_TABLE(x86cpu, intel_pstate_cpu_ids);
 
  static int intel_pstate_init_cpu(unsigned int cpunum)
  {
-
-       const struct x86_cpu_id *id;
         struct cpudata *cpu;
 
Quoted 10 lines

drivers/cpufreq/intel_pstate.c MODULE_DEVICE_TABLE(x86cpu, intel_pstate_cpu_ids); · line 698

Quoted 7 lines
drivers/cpufreq/intel_pstate.c +0 -4
-       id = x86_match_cpu(intel_pstate_cpu_ids);
-       if (!id)
-               return -ENODEV;
-
         all_cpu_data[cpunum] = kzalloc(sizeof(struct cpudata), GFP_KERNEL);
         if (!all_cpu_data[cpunum])
                 return -ENOMEM;
#3 lore raw
Quoted 34 lines · Dirk Brandewie
Quoted 23 lines · Viresh Kumar
Quoted 22 lines · Stratos Karafotis

We check the CPU ID during driver init. There is no need to do it again per logical CPU initialization.

So, remove the duplicate check.

---
  drivers/cpufreq/intel_pstate.c | 6 ------
  1 file changed, 6 deletions(-)
drivers/cpufreq/intel_pstate.c +0 -2
index aebd457..4e7f492 100644
@@ -691,14 +691,8 @@ MODULE_DEVICE_TABLE(x86cpu, intel_pstate_cpu_ids);
 
  static int intel_pstate_init_cpu(unsigned int cpunum)
  {
-
-       const struct x86_cpu_id *id;
         struct cpudata *cpu;
 
Quoted 10 lines

drivers/cpufreq/intel_pstate.c MODULE_DEVICE_TABLE(x86cpu, intel_pstate_cpu_ids); · line 698

Quoted 7 lines
drivers/cpufreq/intel_pstate.c +0 -4
-       id = x86_match_cpu(intel_pstate_cpu_ids);
-       if (!id)
-               return -ENODEV;
-
         all_cpu_data[cpunum] = kzalloc(sizeof(struct cpudata), GFP_KERNEL);
         if (!all_cpu_data[cpunum])
                 return -ENOMEM;
Quoted 1 line

[1/7] applied, please wait with the rest until after 3.16-rc1 is released.

Thanks!

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.