[v1,18/19] timer: remove unneeded header includes

Message ID 20220421190859.264174-19-sean.morrissey@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series remove IWYU flagged headers |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Sean Morrissey April 21, 2022, 7:08 p.m. UTC
  These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/timer/rte_timer.c | 3 ---
 lib/timer/rte_timer.h | 2 --
 2 files changed, 5 deletions(-)
  

Comments

Stephen Hemminger April 21, 2022, 8:08 p.m. UTC | #1
On Thu, 21 Apr 2022 19:08:58 +0000
Sean Morrissey <sean.morrissey@intel.com> wrote:

> diff --git a/lib/timer/rte_timer.c b/lib/timer/rte_timer.c
> index c51a393e5c..f52ccc33ed 100644
> --- a/lib/timer/rte_timer.c
> +++ b/lib/timer/rte_timer.c
> @@ -5,12 +5,9 @@
>  #include <stdio.h>
>  #include <stdint.h>
>  #include <stdbool.h>
> -#include <inttypes.h>
>  #include <assert.h>
> -#include <sys/queue.h>
>  
>  #include <rte_common.h>
> -#include <rte_cycles.h>
>  #include <rte_eal_memconfig.h>
>  #include <rte_memory.h>
>  #include <rte_lcore.h>

This doesn't look right.

rte_timer.c relies on rte_get_timer_cycles() which is defined in
rte_cycles.h

Perhaps iwyu is getting confused, or thinking that is already covered
by another include file?
  
Sean Morrissey April 22, 2022, 8:44 a.m. UTC | #2
On 21/04/2022 21:08, Stephen Hemminger wrote:
> On Thu, 21 Apr 2022 19:08:58 +0000
> Sean Morrissey <sean.morrissey@intel.com> wrote:
>
>> diff --git a/lib/timer/rte_timer.c b/lib/timer/rte_timer.c
>> index c51a393e5c..f52ccc33ed 100644
>> --- a/lib/timer/rte_timer.c
>> +++ b/lib/timer/rte_timer.c
>> @@ -5,12 +5,9 @@
>>   #include <stdio.h>
>>   #include <stdint.h>
>>   #include <stdbool.h>
>> -#include <inttypes.h>
>>   #include <assert.h>
>> -#include <sys/queue.h>
>>   
>>   #include <rte_common.h>
>> -#include <rte_cycles.h>
>>   #include <rte_eal_memconfig.h>
>>   #include <rte_memory.h>
>>   #include <rte_lcore.h>
> This doesn't look right.
>
> rte_timer.c relies on rte_get_timer_cycles() which is defined in
> rte_cycles.h
>
> Perhaps iwyu is getting confused, or thinking that is already covered
> by another include file?

IWYU can throw false positives.

Please let me fix all build issues with this patchset and get back to 
you. It could re-introduce the header in question. If not I will 
investigate where IWYU believes the include is coming from.

Typically the headers removed by this tool are usually already included 
from a daisy chain of includes from another header.
  

Patch

diff --git a/lib/timer/rte_timer.c b/lib/timer/rte_timer.c
index c51a393e5c..f52ccc33ed 100644
--- a/lib/timer/rte_timer.c
+++ b/lib/timer/rte_timer.c
@@ -5,12 +5,9 @@ 
 #include <stdio.h>
 #include <stdint.h>
 #include <stdbool.h>
-#include <inttypes.h>
 #include <assert.h>
-#include <sys/queue.h>
 
 #include <rte_common.h>
-#include <rte_cycles.h>
 #include <rte_eal_memconfig.h>
 #include <rte_memory.h>
 #include <rte_lcore.h>
diff --git a/lib/timer/rte_timer.h b/lib/timer/rte_timer.h
index 0f820555c0..503438a36b 100644
--- a/lib/timer/rte_timer.h
+++ b/lib/timer/rte_timer.h
@@ -36,9 +36,7 @@ 
 
 #include <stdio.h>
 #include <stdint.h>
-#include <stddef.h>
 #include <rte_common.h>
-#include <rte_config.h>
 #include <rte_spinlock.h>
 
 #ifdef __cplusplus