Hello,
On 9/1/25 14:07, Andy Shevchenko wrote:
> On Thu, Aug 28, 2025 at 05:34:51PM +0800, Haixu Cui wrote:
>> This is the virtio SPI Linux kernel driver.
>
> ...
>
>> +#include <linux/completion.h>
>> +#include <linux/interrupt.h>
>> +#include <linux/io.h>
>> +#include <linux/module.h>
>> +#include <linux/spi/spi.h>
>> +#include <linux/stddef.h>
>
> A lot of headers are still missing. See below.
The driver should compile with the set of included headers.
>
> ...
>
>
>> +struct virtio_spi_priv {
>> + /* The virtio device we're associated with */
>> + struct virtio_device *vdev;
>> + /* Pointer to the virtqueue */
>> + struct virtqueue *vq;
>> + /* Copy of config space mode_func_supported */
>> + u32 mode_func_supported;
>
> uXX (in particular u32) is defined in types.h.
>
>> + /* Copy of config space max_freq_hz */
>> + u32 max_freq_hz;
>> +};
u32 is for sure defined in types.h. But looking into another device
(gpio-virtio.c) I see that there is also u8 and u32 used and I don't see that
there types.h is included directly in the C file. It must be included
indirectly as the driver compiles. Same happens here.
I'm not aware of a requirement in the style guide for the Linux kernel that all
used headers have to be included directly in the C file but this does not mean
that such a requirement does not exist. Can anyone point my nose on it?
Regards
Harald Mommer