lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <be8961be-2964-4571-9818-b5a23867b27e@oss.qualcomm.com>
Date: Tue, 2 Sep 2025 17:54:39 +0200
From: Harald Mommer <harald.mommer@....qualcomm.com>
To: Andy Shevchenko <andriy.shevchenko@...el.com>,
        Haixu Cui <quic_haixcui@...cinc.com>
Cc: quic_msavaliy@...cinc.com, broonie@...nel.org, virtio-dev@...ts.linux.dev,
        viresh.kumar@...aro.org, linux-spi@...r.kernel.org,
        linux-kernel@...r.kernel.org, hdanton@...a.com,
        qiang4.zhang@...ux.intel.com, alex.bennee@...aro.org,
        quic_ztu@...cinc.com, virtualization@...ts.linux-foundation.org
Subject: Re: [PATCH v9 3/3] SPI: Add virtio SPI driver

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ