mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: 赵西超 <zhao.xichao@vivo.com>
To: Eugenio Perez Martin <eperezma@redhat.com>
Cc: "mst@redhat.com" <mst@redhat.com>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	"xuanzhuo@linux.alibaba.com" <xuanzhuo@linux.alibaba.com>,
	"virtualization@lists.linux.dev" <virtualization@lists.linux.dev>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] virtio-vdpa: Drop redundant conversion to bool
Date: Mon, 18 Aug 2025 10:25:53 +0000	[thread overview]
Message-ID: <e3d3cf69-e559-47f0-aafb-409b1c776513@vivo.com> (raw)
In-Reply-To: <CAJaqyWd+q6hs3bZxyEz+jtg-v=gNe2b0DtEECTLHeaWeFaF2NQ@mail.gmail.com>


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


      reply	other threads:[~2025-08-18 10:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-18 10:00 Xichao Zhao
2025-08-18 10:13 ` Eugenio Perez Martin
2025-08-18 10:25   ` 赵西超 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e3d3cf69-e559-47f0-aafb-409b1c776513@vivo.com \
    --to=zhao.xichao@vivo.com \
    --cc=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=virtualization@lists.linux.dev \
    --cc=xuanzhuo@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®