diff mbox series

[v3,4/5] lib/kvargs: remove unneeded header includes

Message ID 20211007102557.188739-5-sean.morrissey@intel.com (mailing list archive)
State Superseded
Delegated to: Thomas Monjalon
Headers show
Series introduce IWYU | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Sean Morrissey Oct. 7, 2021, 10:25 a.m. UTC
These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/kvargs/rte_kvargs.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Olivier Matz Oct. 15, 2021, 9 a.m. UTC | #1
Hi Sean,

On Thu, Oct 07, 2021 at 10:25:56AM +0000, Sean Morrissey wrote:
> These header includes have been flagged by the iwyu_tool
> and removed.
> 
> Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
> ---
>  lib/kvargs/rte_kvargs.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/lib/kvargs/rte_kvargs.c b/lib/kvargs/rte_kvargs.c
> index 38e9d5c1ca..4cce8e953b 100644
> --- a/lib/kvargs/rte_kvargs.c
> +++ b/lib/kvargs/rte_kvargs.c
> @@ -7,7 +7,6 @@
>  #include <stdlib.h>
>  #include <stdbool.h>
>  
> -#include <rte_os_shim.h>
>  #include <rte_string_fns.h>
>  
>  #include "rte_kvargs.h"
> -- 
> 2.25.1
> 

Did you check that it still compiles for the Windows platform
after this change?

+CC Dmitry
Sean Morrissey Oct. 15, 2021, 9:20 a.m. UTC | #2
On 15/10/2021 10:00, Olivier Matz wrote:
> Hi Sean,
>
> On Thu, Oct 07, 2021 at 10:25:56AM +0000, Sean Morrissey wrote:
>> These header includes have been flagged by the iwyu_tool
>> and removed.
>>
>> Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
>> ---
>>   lib/kvargs/rte_kvargs.c | 1 -
>>   1 file changed, 1 deletion(-)
>>
>> diff --git a/lib/kvargs/rte_kvargs.c b/lib/kvargs/rte_kvargs.c
>> index 38e9d5c1ca..4cce8e953b 100644
>> --- a/lib/kvargs/rte_kvargs.c
>> +++ b/lib/kvargs/rte_kvargs.c
>> @@ -7,7 +7,6 @@
>>   #include <stdlib.h>
>>   #include <stdbool.h>
>>   
>> -#include <rte_os_shim.h>
>>   #include <rte_string_fns.h>
>>   
>>   #include "rte_kvargs.h"
>> -- 
>> 2.25.1
>>
> Did you check that it still compiles for the Windows platform
> after this change?
>
> +CC Dmitry

Hi Olivier,

I cross-compiled with MinGW-64 after this change and it still compiled.

Thanks,

Sean.
Olivier Matz Oct. 15, 2021, 12:24 p.m. UTC | #3
On Fri, Oct 15, 2021 at 10:20:06AM +0100, Morrissey, Sean wrote:
> 
> On 15/10/2021 10:00, Olivier Matz wrote:
> > Hi Sean,
> > 
> > On Thu, Oct 07, 2021 at 10:25:56AM +0000, Sean Morrissey wrote:
> > > These header includes have been flagged by the iwyu_tool
> > > and removed.
> > > 
> > > Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
> > > ---
> > >   lib/kvargs/rte_kvargs.c | 1 -
> > >   1 file changed, 1 deletion(-)
> > > 
> > > diff --git a/lib/kvargs/rte_kvargs.c b/lib/kvargs/rte_kvargs.c
> > > index 38e9d5c1ca..4cce8e953b 100644
> > > --- a/lib/kvargs/rte_kvargs.c
> > > +++ b/lib/kvargs/rte_kvargs.c
> > > @@ -7,7 +7,6 @@
> > >   #include <stdlib.h>
> > >   #include <stdbool.h>
> > > -#include <rte_os_shim.h>
> > >   #include <rte_string_fns.h>
> > >   #include "rte_kvargs.h"
> > > -- 
> > > 2.25.1
> > > 
> > Did you check that it still compiles for the Windows platform
> > after this change?
> > 
> > +CC Dmitry
> 
> Hi Olivier,
> 
> I cross-compiled with MinGW-64 after this change and it still compiled.

Thanks.

However I see that strdup() is used in rte_kvargs.c, and it is defined in
lib/eal/windows/include/rte_os_shim.h. So at first glance, it seems a better
option to keep the include as it is.

I don't know if strdup() is defined somewhere else on windows, or if
rte_os_shim.h is included by another header. Better have an opinion from a
windows maintainer if we want to remove this include.
diff mbox series

Patch

diff --git a/lib/kvargs/rte_kvargs.c b/lib/kvargs/rte_kvargs.c
index 38e9d5c1ca..4cce8e953b 100644
--- a/lib/kvargs/rte_kvargs.c
+++ b/lib/kvargs/rte_kvargs.c
@@ -7,7 +7,6 @@ 
 #include <stdlib.h>
 #include <stdbool.h>
 
-#include <rte_os_shim.h>
 #include <rte_string_fns.h>
 
 #include "rte_kvargs.h"