[PATCH] sched/headers: remove duplicate included header

晏艳(采苓) posted 1 patch 2 years, 9 months ago
kernel/sched/build_utility.c | 1 -
1 file changed, 1 deletion(-)
[PATCH] sched/headers: remove duplicate included header
Posted by 晏艳(采苓) 2 years, 9 months ago
linux/psi.h is included more than once.

Signed-off-by: Yan Yan <yanyan.yan@antgroup.com>
---
 kernel/sched/build_utility.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/kernel/sched/build_utility.c b/kernel/sched/build_utility.c
index 99bdd96f454f..80a3df49ab47 100644
--- a/kernel/sched/build_utility.c
+++ b/kernel/sched/build_utility.c
@@ -34,7 +34,6 @@
 #include <linux/nospec.h>
 #include <linux/proc_fs.h>
 #include <linux/psi.h>
-#include <linux/psi.h>
 #include <linux/ptrace_api.h>
 #include <linux/sched_clock.h>
 #include <linux/security.h>
-- 
2.32.0.3.g01195cf9f
Re: [PATCH] sched/headers: remove duplicate included header
Posted by Yan Yan(cailing) 2 years, 9 months ago
Ping.

It seems that removing the two same included lines is ok. Because the 
following "sched.h" also includes psi.h.

Any comments?

Thanks,

-Yan Yan

在 2023/5/6 23:39, 晏艳(采苓) 写道:
> linux/psi.h is included more than once.
>
> Signed-off-by: Yan Yan <yanyan.yan@antgroup.com>
> ---
>   kernel/sched/build_utility.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/kernel/sched/build_utility.c b/kernel/sched/build_utility.c
> index 99bdd96f454f..80a3df49ab47 100644
> --- a/kernel/sched/build_utility.c
> +++ b/kernel/sched/build_utility.c
> @@ -34,7 +34,6 @@
>   #include <linux/nospec.h>
>   #include <linux/proc_fs.h>
>   #include <linux/psi.h>
> -#include <linux/psi.h>
>   #include <linux/ptrace_api.h>
>   #include <linux/sched_clock.h>
>   #include <linux/security.h>
Re: [PATCH] sched/headers: remove duplicate included header
Posted by Yan Yan(cailing) 2 years, 8 months ago
Ping, any comments?

thanks,

-Yan Yan

在 2023/5/16 00:00, Yan Yan 写道:
> Ping.
>
> It seems that removing the two same included lines is ok. Because the 
> following "sched.h" also includes psi.h.
>
> Any comments?
>
> Thanks,
>
> -Yan Yan
>
> 在 2023/5/6 23:39, 晏艳(采苓) 写道:
>> linux/psi.h is included more than once.
>>
>> Signed-off-by: Yan Yan <yanyan.yan@antgroup.com>
>> ---
>>   kernel/sched/build_utility.c | 1 -
>>   1 file changed, 1 deletion(-)
>>
>> diff --git a/kernel/sched/build_utility.c b/kernel/sched/build_utility.c
>> index 99bdd96f454f..80a3df49ab47 100644
>> --- a/kernel/sched/build_utility.c
>> +++ b/kernel/sched/build_utility.c
>> @@ -34,7 +34,6 @@
>>   #include <linux/nospec.h>
>>   #include <linux/proc_fs.h>
>>   #include <linux/psi.h>
>> -#include <linux/psi.h>
>>   #include <linux/ptrace_api.h>
>>   #include <linux/sched_clock.h>
>>   #include <linux/security.h>
Re: [PATCH] sched/headers: remove duplicate included header
Posted by Christophe JAILLET 2 years, 8 months ago
Le 22/05/2023 à 04:26, Yan Yan(cailing) a écrit :
> Ping, any comments?
> 
> thanks,
> 
> -Yan Yan
> 
> 在 2023/5/16 00:00, Yan Yan 写道:
>> Ping.
>>
>> It seems that removing the two same included lines is ok. Because the 
>> following "sched.h" also includes psi.h.
>>
>> Any comments?

FWIW, yes, looks good.


If you want to ga that way, their are some other potential removal 
candidates in build_utility.c:

	linux/sched/mm.h

	linux/cpufreq.h
	linux/ctype.h
	linux/proc_fs.h
	linux/spinlock_api.h
	linux/wait_api.h
	linux/workqueue_api.h

CJ

>>
>> Thanks,
>>
>> -Yan Yan
>>
>> 在 2023/5/6 23:39, 晏艳(采苓) 写道:
>>> linux/psi.h is included more than once.
>>>
>>> Signed-off-by: Yan Yan <yanyan.yan@antgroup.com>
>>> ---
>>>   kernel/sched/build_utility.c | 1 -
>>>   1 file changed, 1 deletion(-)
>>>
>>> diff --git a/kernel/sched/build_utility.c b/kernel/sched/build_utility.c
>>> index 99bdd96f454f..80a3df49ab47 100644
>>> --- a/kernel/sched/build_utility.c
>>> +++ b/kernel/sched/build_utility.c
>>> @@ -34,7 +34,6 @@
>>>   #include <linux/nospec.h>
>>>   #include <linux/proc_fs.h>
>>>   #include <linux/psi.h>
>>> -#include <linux/psi.h>
>>>   #include <linux/ptrace_api.h>
>>>   #include <linux/sched_clock.h>
>>>   #include <linux/security.h>
>