Re: [PATCH v2] virtio-vdpa: Drop redundant conversion to bool

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 18, 2025 at 12:01 PM Xichao Zhao <zhao.xichao@xxxxxxxx> wrote:
>
> The result of integer comparison already evaluates to bool. No need for
> explicit conversion.
>
> Signed-off-by: Xichao Zhao <zhao.xichao@xxxxxxxx>
> ---
>  drivers/virtio/virtio_vdpa.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c
> index 657b07a60788..09ee81470323 100644
> --- a/drivers/virtio/virtio_vdpa.c
> +++ b/drivers/virtio/virtio_vdpa.c
> @@ -176,7 +176,7 @@ virtio_vdpa_setup_vq(struct virtio_device *vdev, unsigned int index,
>         if (ops->get_vq_num_min)
>                 min_num = ops->get_vq_num_min(vdpa);
>
> -       may_reduce_num = (max_num == min_num) ? false : true;
> +       may_reduce_num = !(max_num == min_num);

What about max_num != min_num ?

>
>         /* Create the vring */
>         align = ops->get_vq_align(vdpa);
> --
> 2.34.1
>






[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux