lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e3d3cf69-e559-47f0-aafb-409b1c776513@vivo.com>
Date: Mon, 18 Aug 2025 10:25:53 +0000
From: 赵西超 <zhao.xichao@...o.com>
To: Eugenio Perez Martin <eperezma@...hat.com>
CC: "mst@...hat.com" <mst@...hat.com>, "jasowang@...hat.com"
	<jasowang@...hat.com>, "xuanzhuo@...ux.alibaba.com"
	<xuanzhuo@...ux.alibaba.com>, "virtualization@...ts.linux.dev"
	<virtualization@...ts.linux.dev>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] virtio-vdpa: Drop redundant conversion to bool


> On Mon, Aug 18, 2025 at 12:01 PM Xichao Zhao <zhao.xichao@...o.com> wrote:
>> The result of integer comparison already evaluates to bool. No need for
>> explicit conversion.
>>
>> Signed-off-by: Xichao Zhao <zhao.xichao@...o.com>
>> ---
>>   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 ?

Yes, I agree. I am preparing to modify it and send a v3 version.Thank you.

Best regards,

Xichao Zhao

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ