cpufreq: intel_pstate: Remove redundant includes
Subsystems (2)
PATCH 5/7 cpufreq: intel_pstate: Remove redundant includes
Also put them in alphabetical order.
--- drivers/cpufreq/intel_pstate.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-)
drivers/cpufreq/intel_pstate.c +2 -15
@@ -10,26 +10,13 @@* of the License. */ -#include <linux/kernel.h> -#include <linux/kernel_stat.h> -#include <linux/module.h> -#include <linux/ktime.h> -#include <linux/hrtimer.h> -#include <linux/tick.h> -#include <linux/slab.h> -#include <linux/sched.h> -#include <linux/list.h> +#include <linux/acpi.h> #include <linux/cpu.h> #include <linux/cpufreq.h> -#include <linux/sysfs.h> -#include <linux/types.h> -#include <linux/fs.h> #include <linux/debugfs.h> -#include <linux/acpi.h> +#include <linux/module.h> #include <trace/events/power.h> -#include <asm/div64.h> -#include <asm/msr.h> #include <asm/cpu_device_id.h> #define BYT_RATIOS 0x66a
Signature · 1 line
1.9.3
Viresh Kumar
maintainerQuoted 28 lines · Stratos Karafotis
Also put them in alphabetical order.
Signed-off-by Stratos Karafotis <[email protected]>--- drivers/cpufreq/intel_pstate.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-)drivers/cpufreq/intel_pstate.c +1
-10@@ -10,26 +10,13 @@* of the License. */ -#include <linux/kernel.h> -#include <linux/kernel_stat.h> -#include <linux/module.h> -#include <linux/ktime.h> -#include <linux/hrtimer.h> -#include <linux/tick.h> -#include <linux/slab.h> -#include <linux/sched.h> -#include <linux/list.h> +#include <linux/acpi.h> #include <linux/cpu.h> #include <linux/cpufreq.h> -#include <linux/sysfs.h>
drivers/cpufreq/intel_pstate.c line 20
Quoted 10 lines
drivers/cpufreq/intel_pstate.c +1
-5-#include <linux/types.h> -#include <linux/fs.h> #include <linux/debugfs.h> -#include <linux/acpi.h> +#include <linux/module.h> #include <trace/events/power.h> -#include <asm/div64.h> -#include <asm/msr.h> #include <asm/cpu_device_id.h>
As a rule, header files for all the symbols directly used by a file must be included directly by the file and must not depend on indirect inclusions.
So even if it compiles, its the wrong thing to do. Though you can obviously remove the headers which aren't used.
Quoted 43 lines · Viresh Kumar
Quoted 28 lines · Stratos Karafotis
Also put them in alphabetical order.
Signed-off-by Stratos Karafotis <[email protected]>--- drivers/cpufreq/intel_pstate.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-)drivers/cpufreq/intel_pstate.c +1
-10@@ -10,26 +10,13 @@* of the License. */ -#include <linux/kernel.h> -#include <linux/kernel_stat.h> -#include <linux/module.h> -#include <linux/ktime.h> -#include <linux/hrtimer.h> -#include <linux/tick.h> -#include <linux/slab.h> -#include <linux/sched.h> -#include <linux/list.h> +#include <linux/acpi.h> #include <linux/cpu.h> #include <linux/cpufreq.h> -#include <linux/sysfs.h> drivers/cpufreq/intel_pstate.c line 20
Quoted 10 lines
drivers/cpufreq/intel_pstate.c +1
-5-#include <linux/types.h> -#include <linux/fs.h> #include <linux/debugfs.h> -#include <linux/acpi.h> +#include <linux/module.h> #include <trace/events/power.h> -#include <asm/div64.h> -#include <asm/msr.h> #include <asm/cpu_device_id.h> As a rule, header files for all the symbols directly used by a file must be included directly by the file and must not depend on indirect inclusions.
Quoted 3 lines
So even if it compiles, its the wrong thing to do. Though you can obviously remove the headers which aren't used.
I didn't know this. I will drop this patch. I'm sorry for the noise.
Thanks for your comments!
Stratos