diff mbox series

[v1,2/3] spi: xilinx: Add necessary inclusion and forward declaration

Message ID 20240307154510.3795380-3-andriy.shevchenko@linux.intel.com (mailing list archive)
State Superseded
Headers show
Series spi: xilinx: Massage xilinx_spi.h | expand

Commit Message

Andy Shevchenko March 7, 2024, 3:43 p.m. UTC
xilinx_spi.h is mnissing inclusion and forward declaration, add them.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/spi/xilinx_spi.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Michal Simek March 8, 2024, 8:21 a.m. UTC | #1
On 3/7/24 16:43, Andy Shevchenko wrote:
> xilinx_spi.h is mnissing inclusion and forward declaration, add them.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>   include/linux/spi/xilinx_spi.h | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/include/linux/spi/xilinx_spi.h b/include/linux/spi/xilinx_spi.h
> index fd6add419e94..4ba8f53ce570 100644
> --- a/include/linux/spi/xilinx_spi.h
> +++ b/include/linux/spi/xilinx_spi.h
> @@ -2,6 +2,10 @@
>   #ifndef __LINUX_SPI_XILINX_SPI_H
>   #define __LINUX_SPI_XILINX_SPI_H
>   
> +#include <linux/types.h>
> +
> +struct spi_board_info;
> +
>   /**
>    * struct xspi_platform_data - Platform data of the Xilinx SPI driver
>    * @num_chipselect:	Number of chip select by the IP.

Likely correct but forget how to check it with tools.

Thanks,
Michal
Andy Shevchenko March 8, 2024, 1:56 p.m. UTC | #2
On Fri, Mar 08, 2024 at 09:21:32AM +0100, Michal Simek wrote:
> On 3/7/24 16:43, Andy Shevchenko wrote:
> > xilinx_spi.h is mnissing inclusion and forward declaration, add them.

...

> > diff --git a/include/linux/spi/xilinx_spi.h b/include/linux/spi/xilinx_spi.h
> >   #define __LINUX_SPI_XILINX_SPI_H
> > +#include <linux/types.h>
> > +
> > +struct spi_board_info;
> > +
> >   /**
> >    * struct xspi_platform_data - Platform data of the Xilinx SPI driver
> >    * @num_chipselect:	Number of chip select by the IP.
> 
> Likely correct but forget how to check it with tools.

I'm not sure which tools we have to check this.

The types.h is needed for uXX
The forward declaration for the pointer to the mentioned type.

All this has been derived from reading the file.
Michal Simek March 8, 2024, 2:02 p.m. UTC | #3
On 3/8/24 14:56, Andy Shevchenko wrote:
> On Fri, Mar 08, 2024 at 09:21:32AM +0100, Michal Simek wrote:
>> On 3/7/24 16:43, Andy Shevchenko wrote:
>>> xilinx_spi.h is mnissing inclusion and forward declaration, add them.
> 
> ...
> 
>>> diff --git a/include/linux/spi/xilinx_spi.h b/include/linux/spi/xilinx_spi.h
>>>    #define __LINUX_SPI_XILINX_SPI_H
>>> +#include <linux/types.h>
>>> +
>>> +struct spi_board_info;
>>> +
>>>    /**
>>>     * struct xspi_platform_data - Platform data of the Xilinx SPI driver
>>>     * @num_chipselect:	Number of chip select by the IP.
>>
>> Likely correct but forget how to check it with tools.
> 
> I'm not sure which tools we have to check this.
> 
> The types.h is needed for uXX
> The forward declaration for the pointer to the mentioned type.
> 
> All this has been derived from reading the file.

No issue with it. But I am quite sure there was a tool which was able to find it 
out and report it. But forgot which one was it.

M
Andy Shevchenko March 8, 2024, 3 p.m. UTC | #4
On Fri, Mar 08, 2024 at 03:02:01PM +0100, Michal Simek wrote:
> On 3/8/24 14:56, Andy Shevchenko wrote:
> > On Fri, Mar 08, 2024 at 09:21:32AM +0100, Michal Simek wrote:
> > > On 3/7/24 16:43, Andy Shevchenko wrote:
> > > > xilinx_spi.h is mnissing inclusion and forward declaration, add them.

...

> > > > diff --git a/include/linux/spi/xilinx_spi.h b/include/linux/spi/xilinx_spi.h
> > > >    #define __LINUX_SPI_XILINX_SPI_H
> > > > +#include <linux/types.h>
> > > > +
> > > > +struct spi_board_info;
> > > > +
> > > >    /**
> > > >     * struct xspi_platform_data - Platform data of the Xilinx SPI driver
> > > >     * @num_chipselect:	Number of chip select by the IP.
> > > 
> > > Likely correct but forget how to check it with tools.
> > 
> > I'm not sure which tools we have to check this.
> > 
> > The types.h is needed for uXX
> > The forward declaration for the pointer to the mentioned type.
> > 
> > All this has been derived from reading the file.
> 
> No issue with it. But I am quite sure there was a tool which was able to
> find it out and report it. But forgot which one was it.

You mean iwyu? If so, it needs a lot of tuning before being able to be used
in Linux kernel.
Michal Simek March 8, 2024, 3:27 p.m. UTC | #5
On 3/8/24 16:00, Andy Shevchenko wrote:
> On Fri, Mar 08, 2024 at 03:02:01PM +0100, Michal Simek wrote:
>> On 3/8/24 14:56, Andy Shevchenko wrote:
>>> On Fri, Mar 08, 2024 at 09:21:32AM +0100, Michal Simek wrote:
>>>> On 3/7/24 16:43, Andy Shevchenko wrote:
>>>>> xilinx_spi.h is mnissing inclusion and forward declaration, add them.
> 
> ...
> 
>>>>> diff --git a/include/linux/spi/xilinx_spi.h b/include/linux/spi/xilinx_spi.h
>>>>>     #define __LINUX_SPI_XILINX_SPI_H
>>>>> +#include <linux/types.h>
>>>>> +
>>>>> +struct spi_board_info;
>>>>> +
>>>>>     /**
>>>>>      * struct xspi_platform_data - Platform data of the Xilinx SPI driver
>>>>>      * @num_chipselect:	Number of chip select by the IP.
>>>>
>>>> Likely correct but forget how to check it with tools.
>>>
>>> I'm not sure which tools we have to check this.
>>>
>>> The types.h is needed for uXX
>>> The forward declaration for the pointer to the mentioned type.
>>>
>>> All this has been derived from reading the file.
>>
>> No issue with it. But I am quite sure there was a tool which was able to
>> find it out and report it. But forgot which one was it.
> 
> You mean iwyu? If so, it needs a lot of tuning before being able to be used
> in Linux kernel.
> 

Acked-by; Michal Simek <michal.simek@amd.com>

Thanks,
Michal
diff mbox series

Patch

diff --git a/include/linux/spi/xilinx_spi.h b/include/linux/spi/xilinx_spi.h
index fd6add419e94..4ba8f53ce570 100644
--- a/include/linux/spi/xilinx_spi.h
+++ b/include/linux/spi/xilinx_spi.h
@@ -2,6 +2,10 @@ 
 #ifndef __LINUX_SPI_XILINX_SPI_H
 #define __LINUX_SPI_XILINX_SPI_H
 
+#include <linux/types.h>
+
+struct spi_board_info;
+
 /**
  * struct xspi_platform_data - Platform data of the Xilinx SPI driver
  * @num_chipselect:	Number of chip select by the IP.