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