2024-02-23 20:57:10

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH v2 1/1] leds: expresswire: Don't use "proxy" headers

Hi!

> Update header inclusions to follow IWYU (Include What You Use)
> principle.
>
> Signed-off-by: Andy Shevchenko <[email protected]>
> ---
> v2: added one more missing header
> drivers/leds/leds-expresswire.c | 4 ++++
> include/linux/leds-expresswire.h | 4 +++-
> 2 files changed, 7 insertions(+), 1 deletion(-)
>

> diff --git a/include/linux/leds-expresswire.h b/include/linux/leds-expresswire.h
> index 3c61902ccac8..a422921f4159 100644
> --- a/include/linux/leds-expresswire.h
> +++ b/include/linux/leds-expresswire.h
> @@ -8,7 +8,9 @@
> #ifndef _LEDS_EXPRESSWIRE_H
> #define _LEDS_EXPRESSWIRE_H
>
> -#include <linux/gpio/consumer.h>
> +#include <linux/types.h>
> +
> +struct gpio_desc;

If include tweak means you need to declare struct, is it ian
improvement?

BR,
Pavel
--
People of Russia, stop Putin before his war on Ukraine escalates.


Attachments:
(No filename) (919.00 B)
signature.asc (201.00 B)
Download all attachments

2024-02-24 15:40:16

by Duje Mihanović

[permalink] [raw]
Subject: Re: [PATCH v2 1/1] leds: expresswire: Don't use "proxy" headers

On 2/23/2024 9:56 PM, Pavel Machek wrote:
>> -#include <linux/gpio/consumer.h>
>> +#include <linux/types.h>
>> +
>> +struct gpio_desc;
>
> If include tweak means you need to declare struct, is it ian
> improvement?

In this case I'd say yes, the header in question has numerous other
declarations (which are not used in leds-expresswire.h) and itself
declares gpio_desc like this anyway.

Regards,
--
Duje


2024-02-26 14:29:20

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v2 1/1] leds: expresswire: Don't use "proxy" headers

On Fri, Feb 23, 2024 at 09:56:56PM +0100, Pavel Machek wrote:

..

> > +struct gpio_desc;
>
> If include tweak means you need to declare struct, is it ian
> improvement?

Of course, we increase a build time by dropping the header that's
not used for the compilation.

--
With Best Regards,
Andy Shevchenko



2024-02-26 14:39:06

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v2 1/1] leds: expresswire: Don't use "proxy" headers

On Mon, Feb 26, 2024 at 04:28:00PM +0200, Andy Shevchenko wrote:
> On Fri, Feb 23, 2024 at 09:56:56PM +0100, Pavel Machek wrote:

..

> > > +struct gpio_desc;
> >
> > If include tweak means you need to declare struct, is it ian
> > improvement?
>
> Of course, we increase a build time by dropping the header that's

Should be read: increase --> decrease

> not used for the compilation.

--
With Best Regards,
Andy Shevchenko