linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 5/7] cpufreq: intel_pstate: Remove redundant includes
@ 2014-06-09 21:00 Stratos Karafotis
  2014-06-10  5:29 ` Viresh Kumar
  0 siblings, 1 reply; 3+ messages in thread
From: Stratos Karafotis @ 2014-06-09 21:00 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar, Dirk Brandewie
  Cc: linux-pm@vger.kernel.org, LKML

Also put them in alphabetical order.

Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
---
 drivers/cpufreq/intel_pstate.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 26a0262..d4f0518 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -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
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 5/7] cpufreq: intel_pstate: Remove redundant includes
  2014-06-09 21:00 [PATCH 5/7] cpufreq: intel_pstate: Remove redundant includes Stratos Karafotis
@ 2014-06-10  5:29 ` Viresh Kumar
  2014-06-10 14:45   ` Stratos Karafotis
  0 siblings, 1 reply; 3+ messages in thread
From: Viresh Kumar @ 2014-06-10  5:29 UTC (permalink / raw)
  To: Stratos Karafotis
  Cc: Rafael J. Wysocki, Dirk Brandewie, linux-pm@vger.kernel.org, LKML

On 10 June 2014 02:30, Stratos Karafotis <stratosk@semaphore.gr> wrote:
> Also put them in alphabetical order.
>
> Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
> ---
>  drivers/cpufreq/intel_pstate.c | 17 ++---------------
>  1 file changed, 2 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
> index 26a0262..d4f0518 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -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>

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 5/7] cpufreq: intel_pstate: Remove redundant includes
  2014-06-10  5:29 ` Viresh Kumar
@ 2014-06-10 14:45   ` Stratos Karafotis
  0 siblings, 0 replies; 3+ messages in thread
From: Stratos Karafotis @ 2014-06-10 14:45 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Rafael J. Wysocki, Dirk Brandewie, linux-pm@vger.kernel.org, LKML

On 10/06/2014 08:29 πμ, Viresh Kumar wrote:
> On 10 June 2014 02:30, Stratos Karafotis <stratosk@semaphore.gr> wrote:
>> Also put them in alphabetical order.
>>
>> Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
>> ---
>>  drivers/cpufreq/intel_pstate.c | 17 ++---------------
>>  1 file changed, 2 insertions(+), 15 deletions(-)
>>
>> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
>> index 26a0262..d4f0518 100644
>> --- a/drivers/cpufreq/intel_pstate.c
>> +++ b/drivers/cpufreq/intel_pstate.c
>> @@ -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>
> 
> 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.
> 

I didn't know this. I will drop this patch. I'm sorry for the noise.

Thanks for your comments!
Stratos


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-10 14:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-09 21:00 [PATCH 5/7] cpufreq: intel_pstate: Remove redundant includes Stratos Karafotis
2014-06-10  5:29 ` Viresh Kumar
2014-06-10 14:45   ` Stratos Karafotis

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).