Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

virtio: kerneldocs fixes and enhancements

Fix variable names in some kerneldocs, naming in others.
Add kerneldocs for struct vring_desc and vring_interrupt.

Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
Message-Id: <20220810094004.1250-2-ricardo.canuelo@collabora.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>

authored by

Ricardo Cañuelo and committed by
Michael S. Tsirkin
5c669c4a 9993a4f9

+25 -11
+8
drivers/virtio/virtio_ring.c
··· 2426 2426 return vq->packed_ring ? more_used_packed(vq) : more_used_split(vq); 2427 2427 } 2428 2428 2429 + /** 2430 + * vring_interrupt - notify a virtqueue on an interrupt 2431 + * @irq: the IRQ number (ignored) 2432 + * @_vq: the struct virtqueue to notify 2433 + * 2434 + * Calls the callback function of @_vq to process the virtqueue 2435 + * notification. 2436 + */ 2429 2437 irqreturn_t vring_interrupt(int irq, void *_vq) 2430 2438 { 2431 2439 struct vring_virtqueue *vq = to_vvq(_vq);
+3 -3
include/linux/virtio.h
··· 11 11 #include <linux/gfp.h> 12 12 13 13 /** 14 - * virtqueue - a queue to register buffers for sending or receiving. 14 + * struct virtqueue - a queue to register buffers for sending or receiving. 15 15 * @list: the chain of virtqueues for this device 16 16 * @callback: the function to call when buffers are consumed (can be NULL). 17 17 * @name: the name of this virtqueue (mainly for debugging) ··· 97 97 void (*recycle)(struct virtqueue *vq, void *buf)); 98 98 99 99 /** 100 - * virtio_device - representation of a device using virtio 100 + * struct virtio_device - representation of a device using virtio 101 101 * @index: unique position on the virtio bus 102 102 * @failed: saved value for VIRTIO_CONFIG_S_FAILED bit (for restore) 103 103 * @config_enabled: configuration change reporting enabled ··· 156 156 list_for_each_entry(vq, &vdev->vqs, list) 157 157 158 158 /** 159 - * virtio_driver - operations for a virtio I/O driver 159 + * struct virtio_driver - operations for a virtio I/O driver 160 160 * @driver: underlying device driver (populate name and owner). 161 161 * @id_table: the ids serviced by this driver. 162 162 * @feature_table: an array of feature numbers supported by this driver.
+3 -3
include/linux/virtio_config.h
··· 239 239 240 240 /** 241 241 * virtio_synchronize_cbs - synchronize with virtqueue callbacks 242 - * @vdev: the device 242 + * @dev: the virtio device 243 243 */ 244 244 static inline 245 245 void virtio_synchronize_cbs(struct virtio_device *dev) ··· 258 258 259 259 /** 260 260 * virtio_device_ready - enable vq use in probe function 261 - * @vdev: the device 261 + * @dev: the virtio device 262 262 * 263 263 * Driver must call this to use vqs in the probe function. 264 264 * ··· 306 306 /** 307 307 * virtqueue_set_affinity - setting affinity for a virtqueue 308 308 * @vq: the virtqueue 309 - * @cpu: the cpu no. 309 + * @cpu_mask: the cpu mask 310 310 * 311 311 * Pay attention the function are best-effort: the affinity hint may not be set 312 312 * due to config support, irq type and sharing.
+11 -5
include/uapi/linux/virtio_ring.h
··· 93 93 #define VRING_USED_ALIGN_SIZE 4 94 94 #define VRING_DESC_ALIGN_SIZE 16 95 95 96 - /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ 96 + /** 97 + * struct vring_desc - Virtio ring descriptors, 98 + * 16 bytes long. These can chain together via @next. 99 + * 100 + * @addr: buffer address (guest-physical) 101 + * @len: buffer length 102 + * @flags: descriptor flags 103 + * @next: index of the next descriptor in the chain, 104 + * if the VRING_DESC_F_NEXT flag is set. We chain unused 105 + * descriptors via this, too. 106 + */ 97 107 struct vring_desc { 98 - /* Address (guest-physical). */ 99 108 __virtio64 addr; 100 - /* Length. */ 101 109 __virtio32 len; 102 - /* The flags as indicated above. */ 103 110 __virtio16 flags; 104 - /* We chain unused descriptors via this, too */ 105 111 __virtio16 next; 106 112 }; 107 113