[PATCH V8 12/19] virtio_ring: switch to use unsigned int for virtqueue_poll_packed()

Jason Wang posted 19 patches 3 months, 3 weeks ago
There is a newer version of this series
[PATCH V8 12/19] virtio_ring: switch to use unsigned int for virtqueue_poll_packed()
Posted by Jason Wang 3 months, 3 weeks ago
Switch to use unsigned int for virtqueue_poll_packed() to match
virtqueue_poll() and virtqueue_poll_split() and ease the abstraction
the virtqueue ops.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 drivers/virtio/virtio_ring.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 58c03a8aab85..73dcc6984e33 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -1699,7 +1699,8 @@ static inline bool is_used_desc_packed(const struct vring_virtqueue *vq,
 	return avail == used && used == used_wrap_counter;
 }
 
-static bool virtqueue_poll_packed(const struct vring_virtqueue *vq, u16 off_wrap)
+static bool virtqueue_poll_packed(const struct vring_virtqueue *vq,
+				  unsigned int off_wrap)
 {
 	bool wrap_counter;
 	u16 used_idx;
-- 
2.31.1
Re: [PATCH V8 12/19] virtio_ring: switch to use unsigned int for virtqueue_poll_packed()
Posted by Michael S. Tsirkin 3 months, 2 weeks ago
On Mon, Oct 20, 2025 at 03:09:56PM +0800, Jason Wang wrote:
> Switch to use unsigned int for virtqueue_poll_packed() to match
> virtqueue_poll() and virtqueue_poll_split() and ease

and to ease

> the abstraction
> the virtqueue ops.

of the virtqueue ops


> 
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
>  drivers/virtio/virtio_ring.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
> index 58c03a8aab85..73dcc6984e33 100644
> --- a/drivers/virtio/virtio_ring.c
> +++ b/drivers/virtio/virtio_ring.c
> @@ -1699,7 +1699,8 @@ static inline bool is_used_desc_packed(const struct vring_virtqueue *vq,
>  	return avail == used && used == used_wrap_counter;
>  }
>  
> -static bool virtqueue_poll_packed(const struct vring_virtqueue *vq, u16 off_wrap)
> +static bool virtqueue_poll_packed(const struct vring_virtqueue *vq,
> +				  unsigned int off_wrap)
>  {
>  	bool wrap_counter;
>  	u16 used_idx;
> -- 
> 2.31.1
Re: [PATCH V8 12/19] virtio_ring: switch to use unsigned int for virtqueue_poll_packed()
Posted by Jason Wang 3 months, 2 weeks ago
On Tue, Oct 21, 2025 at 12:15 AM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Mon, Oct 20, 2025 at 03:09:56PM +0800, Jason Wang wrote:
> > Switch to use unsigned int for virtqueue_poll_packed() to match
> > virtqueue_poll() and virtqueue_poll_split() and ease
>
> and to ease
>
> > the abstraction
> > the virtqueue ops.
>
> of the virtqueue ops
>
>

Fixed.

Thanks