[PATCH] virtio: Add missing documentation for structure fields

Simon Horman posted 1 patch 2 years, 9 months ago
There is a newer version of this series
include/linux/virtio.h | 2 ++
1 file changed, 2 insertions(+)
[PATCH] virtio: Add missing documentation for structure fields
Posted by Simon Horman 2 years, 9 months ago
Add missing documentation for the vqs_list_lock field of struct virtio_device,
and the validate field of struct virtio_driver.

./scripts/kernel-doc says:

 .../virtio.h:131: warning: Function parameter or member 'vqs_list_lock' not described in 'virtio_device'
 .../virtio.h:192: warning: Function parameter or member 'validate' not described in 'virtio_driver'
 2 warnings as Errors

No functional changes intended.

Signed-off-by: Simon Horman <horms@kernel.org>
---
 include/linux/virtio.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index b93238db94e3..0b2b82ee3220 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -103,6 +103,7 @@ int virtqueue_resize(struct virtqueue *vq, u32 num,
  * @config_enabled: configuration change reporting enabled
  * @config_change_pending: configuration change reported while disabled
  * @config_lock: protects configuration change reporting
+ * @vqs_list_lock: protects @vqs.
  * @dev: underlying device.
  * @id: the device type identification (used to match it with a driver).
  * @config: the configuration ops for this device.
@@ -160,6 +161,7 @@ size_t virtio_max_dma_size(const struct virtio_device *vdev);
  * @feature_table_size: number of entries in the feature table array.
  * @feature_table_legacy: same as feature_table but when working in legacy mode.
  * @feature_table_size_legacy: number of entries in feature table legacy array.
+ * @validate: the function to call to vaidate features at probe time.
  * @probe: the function to call when a device is found.  Returns 0 or -errno.
  * @scan: optional function to call after successful probe; intended
  *    for virtio-scsi to invoke a scan.
Re: [PATCH] virtio: Add missing documentation for structure fields
Posted by Michael S. Tsirkin 2 years, 9 months ago
On Wed, May 10, 2023 at 02:23:12PM +0200, Simon Horman wrote:
> Add missing documentation for the vqs_list_lock field of struct virtio_device,
> and the validate field of struct virtio_driver.
> 
> ./scripts/kernel-doc says:
> 
>  .../virtio.h:131: warning: Function parameter or member 'vqs_list_lock' not described in 'virtio_device'
>  .../virtio.h:192: warning: Function parameter or member 'validate' not described in 'virtio_driver'
>  2 warnings as Errors
> 
> No functional changes intended.
> 
> Signed-off-by: Simon Horman <horms@kernel.org>
> ---
>  include/linux/virtio.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/linux/virtio.h b/include/linux/virtio.h
> index b93238db94e3..0b2b82ee3220 100644
> --- a/include/linux/virtio.h
> +++ b/include/linux/virtio.h
> @@ -103,6 +103,7 @@ int virtqueue_resize(struct virtqueue *vq, u32 num,
>   * @config_enabled: configuration change reporting enabled
>   * @config_change_pending: configuration change reported while disabled
>   * @config_lock: protects configuration change reporting
> + * @vqs_list_lock: protects @vqs.
>   * @dev: underlying device.
>   * @id: the device type identification (used to match it with a driver).
>   * @config: the configuration ops for this device.
> @@ -160,6 +161,7 @@ size_t virtio_max_dma_size(const struct virtio_device *vdev);
>   * @feature_table_size: number of entries in the feature table array.
>   * @feature_table_legacy: same as feature_table but when working in legacy mode.
>   * @feature_table_size_legacy: number of entries in feature table legacy array.
> + * @validate: the function to call to vaidate features at probe time.

typo

and this is called before probe actually not at probe time

>   * @probe: the function to call when a device is found.  Returns 0 or -errno.
>   * @scan: optional function to call after successful probe; intended
>   *    for virtio-scsi to invoke a scan.
Re: [PATCH] virtio: Add missing documentation for structure fields
Posted by Simon Horman 2 years, 9 months ago
On Wed, May 10, 2023 at 12:04:21PM -0400, Michael S. Tsirkin wrote:
> On Wed, May 10, 2023 at 02:23:12PM +0200, Simon Horman wrote:
> > Add missing documentation for the vqs_list_lock field of struct virtio_device,
> > and the validate field of struct virtio_driver.
> > 
> > ./scripts/kernel-doc says:
> > 
> >  .../virtio.h:131: warning: Function parameter or member 'vqs_list_lock' not described in 'virtio_device'
> >  .../virtio.h:192: warning: Function parameter or member 'validate' not described in 'virtio_driver'
> >  2 warnings as Errors
> > 
> > No functional changes intended.
> > 
> > Signed-off-by: Simon Horman <horms@kernel.org>
> > ---
> >  include/linux/virtio.h | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/include/linux/virtio.h b/include/linux/virtio.h
> > index b93238db94e3..0b2b82ee3220 100644
> > --- a/include/linux/virtio.h
> > +++ b/include/linux/virtio.h
> > @@ -103,6 +103,7 @@ int virtqueue_resize(struct virtqueue *vq, u32 num,
> >   * @config_enabled: configuration change reporting enabled
> >   * @config_change_pending: configuration change reported while disabled
> >   * @config_lock: protects configuration change reporting
> > + * @vqs_list_lock: protects @vqs.
> >   * @dev: underlying device.
> >   * @id: the device type identification (used to match it with a driver).
> >   * @config: the configuration ops for this device.
> > @@ -160,6 +161,7 @@ size_t virtio_max_dma_size(const struct virtio_device *vdev);
> >   * @feature_table_size: number of entries in the feature table array.
> >   * @feature_table_legacy: same as feature_table but when working in legacy mode.
> >   * @feature_table_size_legacy: number of entries in feature table legacy array.
> > + * @validate: the function to call to vaidate features at probe time.
> 
> typo
> 
> and this is called before probe actually not at probe time

Thanks, how about the following?

* @validate: the function to call to validate features

> >   * @probe: the function to call when a device is found.  Returns 0 or -errno.
> >   * @scan: optional function to call after successful probe; intended
> >   *    for virtio-scsi to invoke a scan.
>
Re: [PATCH] virtio: Add missing documentation for structure fields
Posted by Michael S. Tsirkin 2 years, 9 months ago
On Wed, May 10, 2023 at 10:01:17PM +0200, Simon Horman wrote:
> On Wed, May 10, 2023 at 12:04:21PM -0400, Michael S. Tsirkin wrote:
> > On Wed, May 10, 2023 at 02:23:12PM +0200, Simon Horman wrote:
> > > Add missing documentation for the vqs_list_lock field of struct virtio_device,
> > > and the validate field of struct virtio_driver.
> > > 
> > > ./scripts/kernel-doc says:
> > > 
> > >  .../virtio.h:131: warning: Function parameter or member 'vqs_list_lock' not described in 'virtio_device'
> > >  .../virtio.h:192: warning: Function parameter or member 'validate' not described in 'virtio_driver'
> > >  2 warnings as Errors
> > > 
> > > No functional changes intended.
> > > 
> > > Signed-off-by: Simon Horman <horms@kernel.org>
> > > ---
> > >  include/linux/virtio.h | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/include/linux/virtio.h b/include/linux/virtio.h
> > > index b93238db94e3..0b2b82ee3220 100644
> > > --- a/include/linux/virtio.h
> > > +++ b/include/linux/virtio.h
> > > @@ -103,6 +103,7 @@ int virtqueue_resize(struct virtqueue *vq, u32 num,
> > >   * @config_enabled: configuration change reporting enabled
> > >   * @config_change_pending: configuration change reported while disabled
> > >   * @config_lock: protects configuration change reporting
> > > + * @vqs_list_lock: protects @vqs.
> > >   * @dev: underlying device.
> > >   * @id: the device type identification (used to match it with a driver).
> > >   * @config: the configuration ops for this device.
> > > @@ -160,6 +161,7 @@ size_t virtio_max_dma_size(const struct virtio_device *vdev);
> > >   * @feature_table_size: number of entries in the feature table array.
> > >   * @feature_table_legacy: same as feature_table but when working in legacy mode.
> > >   * @feature_table_size_legacy: number of entries in feature table legacy array.
> > > + * @validate: the function to call to vaidate features at probe time.
> > 
> > typo
> > 
> > and this is called before probe actually not at probe time
> 
> Thanks, how about the following?
> 
> * @validate: the function to call to validate features

... and config space

> > >   * @probe: the function to call when a device is found.  Returns 0 or -errno.
> > >   * @scan: optional function to call after successful probe; intended
> > >   *    for virtio-scsi to invoke a scan.
> >
Re: [PATCH] virtio: Add missing documentation for structure fields
Posted by Simon Horman 2 years, 9 months ago
On Wed, May 10, 2023 at 04:14:53PM -0400, Michael S. Tsirkin wrote:
> On Wed, May 10, 2023 at 10:01:17PM +0200, Simon Horman wrote:
> > On Wed, May 10, 2023 at 12:04:21PM -0400, Michael S. Tsirkin wrote:
> > > On Wed, May 10, 2023 at 02:23:12PM +0200, Simon Horman wrote:
> > > > Add missing documentation for the vqs_list_lock field of struct virtio_device,
> > > > and the validate field of struct virtio_driver.
> > > > 
> > > > ./scripts/kernel-doc says:
> > > > 
> > > >  .../virtio.h:131: warning: Function parameter or member 'vqs_list_lock' not described in 'virtio_device'
> > > >  .../virtio.h:192: warning: Function parameter or member 'validate' not described in 'virtio_driver'
> > > >  2 warnings as Errors
> > > > 
> > > > No functional changes intended.
> > > > 
> > > > Signed-off-by: Simon Horman <horms@kernel.org>
> > > > ---
> > > >  include/linux/virtio.h | 2 ++
> > > >  1 file changed, 2 insertions(+)
> > > > 
> > > > diff --git a/include/linux/virtio.h b/include/linux/virtio.h
> > > > index b93238db94e3..0b2b82ee3220 100644
> > > > --- a/include/linux/virtio.h
> > > > +++ b/include/linux/virtio.h
> > > > @@ -103,6 +103,7 @@ int virtqueue_resize(struct virtqueue *vq, u32 num,
> > > >   * @config_enabled: configuration change reporting enabled
> > > >   * @config_change_pending: configuration change reported while disabled
> > > >   * @config_lock: protects configuration change reporting
> > > > + * @vqs_list_lock: protects @vqs.
> > > >   * @dev: underlying device.
> > > >   * @id: the device type identification (used to match it with a driver).
> > > >   * @config: the configuration ops for this device.
> > > > @@ -160,6 +161,7 @@ size_t virtio_max_dma_size(const struct virtio_device *vdev);
> > > >   * @feature_table_size: number of entries in the feature table array.
> > > >   * @feature_table_legacy: same as feature_table but when working in legacy mode.
> > > >   * @feature_table_size_legacy: number of entries in feature table legacy array.
> > > > + * @validate: the function to call to vaidate features at probe time.
> > > 
> > > typo
> > > 
> > > and this is called before probe actually not at probe time
> > 
> > Thanks, how about the following?
> > 
> > * @validate: the function to call to validate features
> 
> ... and config space

Ok, so:

* @validate: the function to call to validate features and config spaces

> > > >   * @probe: the function to call when a device is found.  Returns 0 or -errno.
> > > >   * @scan: optional function to call after successful probe; intended
> > > >   *    for virtio-scsi to invoke a scan.
> > > 
>
Re: [PATCH] virtio: Add missing documentation for structure fields
Posted by Michael S. Tsirkin 2 years, 9 months ago
On Wed, May 10, 2023 at 10:18:33PM +0200, Simon Horman wrote:
> On Wed, May 10, 2023 at 04:14:53PM -0400, Michael S. Tsirkin wrote:
> > On Wed, May 10, 2023 at 10:01:17PM +0200, Simon Horman wrote:
> > > On Wed, May 10, 2023 at 12:04:21PM -0400, Michael S. Tsirkin wrote:
> > > > On Wed, May 10, 2023 at 02:23:12PM +0200, Simon Horman wrote:
> > > > > Add missing documentation for the vqs_list_lock field of struct virtio_device,
> > > > > and the validate field of struct virtio_driver.
> > > > > 
> > > > > ./scripts/kernel-doc says:
> > > > > 
> > > > >  .../virtio.h:131: warning: Function parameter or member 'vqs_list_lock' not described in 'virtio_device'
> > > > >  .../virtio.h:192: warning: Function parameter or member 'validate' not described in 'virtio_driver'
> > > > >  2 warnings as Errors
> > > > > 
> > > > > No functional changes intended.
> > > > > 
> > > > > Signed-off-by: Simon Horman <horms@kernel.org>
> > > > > ---
> > > > >  include/linux/virtio.h | 2 ++
> > > > >  1 file changed, 2 insertions(+)
> > > > > 
> > > > > diff --git a/include/linux/virtio.h b/include/linux/virtio.h
> > > > > index b93238db94e3..0b2b82ee3220 100644
> > > > > --- a/include/linux/virtio.h
> > > > > +++ b/include/linux/virtio.h
> > > > > @@ -103,6 +103,7 @@ int virtqueue_resize(struct virtqueue *vq, u32 num,
> > > > >   * @config_enabled: configuration change reporting enabled
> > > > >   * @config_change_pending: configuration change reported while disabled
> > > > >   * @config_lock: protects configuration change reporting
> > > > > + * @vqs_list_lock: protects @vqs.
> > > > >   * @dev: underlying device.
> > > > >   * @id: the device type identification (used to match it with a driver).
> > > > >   * @config: the configuration ops for this device.
> > > > > @@ -160,6 +161,7 @@ size_t virtio_max_dma_size(const struct virtio_device *vdev);
> > > > >   * @feature_table_size: number of entries in the feature table array.
> > > > >   * @feature_table_legacy: same as feature_table but when working in legacy mode.
> > > > >   * @feature_table_size_legacy: number of entries in feature table legacy array.
> > > > > + * @validate: the function to call to vaidate features at probe time.
> > > > 
> > > > typo
> > > > 
> > > > and this is called before probe actually not at probe time
> > > 
> > > Thanks, how about the following?
> > > 
> > > * @validate: the function to call to validate features
> > 
> > ... and config space
> 
> Ok, so:
> 
> * @validate: the function to call to validate features and config spaces

config space

> > > > >   * @probe: the function to call when a device is found.  Returns 0 or -errno.
> > > > >   * @scan: optional function to call after successful probe; intended
> > > > >   *    for virtio-scsi to invoke a scan.
> > > > 
> >