Displaying 3 results from an estimated 3 matches for "vp_modern_get_queue_size".
2023 Mar 07
3
[PATCH 1/3] virtio_pci_modern: Remove unnecessary num zero check
...fa..3d7144f8f959 100644
--- a/drivers/virtio/virtio_pci_modern.c
+++ b/drivers/virtio/virtio_pci_modern.c
@@ -306,10 +306,10 @@ static struct virtqueue *setup_vq(struct virtio_pci_device *vp_dev,
return ERR_PTR(-EINVAL);
/* Check if queue is either not available or already active. */
- num = vp_modern_get_queue_size(mdev, index);
- if (!num || vp_modern_get_queue_enable(mdev, index))
+ if (vp_modern_get_queue_enable(mdev, index))
return ERR_PTR(-ENOENT);
+ num = vp_modern_get_queue_size(mdev, index);
if (!is_power_of_2(num)) {
dev_warn(&vp_dev->pci_dev->dev, "bad queue size %u", n...
2023 Mar 08
1
[PATCH 1/3] virtio_pci_modern: Remove unnecessary num zero check
...ci_modern.c
> +++ b/drivers/virtio/virtio_pci_modern.c
> @@ -306,10 +306,10 @@ static struct virtqueue *setup_vq(struct virtio_pci_device *vp_dev,
> return ERR_PTR(-EINVAL);
>
> /* Check if queue is either not available or already active. */
> - num = vp_modern_get_queue_size(mdev, index);
> - if (!num || vp_modern_get_queue_enable(mdev, index))
> + if (vp_modern_get_queue_enable(mdev, index))
> return ERR_PTR(-ENOENT);
Spec allows non power of 2 size for packed virtqueue, so I think we
should fix it in this way.
"""...
2023 Mar 07
3
[PATCH 0/3] virtio_ring: Clean up code for virtio ring and pci
This patch series performs a clean up of the code in virtio_ring and
virtio_pci, modifying it to conform with the Linux kernel coding style
guidance [1]. The modifications ensure the code easy to read and
understand. This small series does few short cleanups in the code.
Patch-1 Remove unnecessary num zero check, which performs in power_of_2.
Patch-2 Avoid using inline for small functions.