From: Jason Wang <jasowang@redhat.com>
To: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>, mst@redhat.com
Cc: virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] virtio_ring: boolean values to a bool variable
Date: Mon, 18 Jan 2021 10:57:03 +0800 [thread overview]
Message-ID: <1d311c25-9051-ddcd-e7e1-5adbb8a913f9@redhat.com> (raw)
In-Reply-To: <1610704825-17724-1-git-send-email-abaci-bugfix@linux.alibaba.com>
On 2021/1/15 下午6:00, Jiapeng Zhong wrote:
> Fix the following coccicheck warnings:
>
> ./drivers/virtio/virtio_ring.c:1637:1-29: WARNING: Assignment of
> 0/1 to bool variable.
>
> ./drivers/virtio/virtio_ring.c:1636:1-30: WARNING: Assignment of
> 0/1 to bool variable.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
It looks to me it's not the only places:
git grep avail_wrap_counter
drivers/virtio/virtio_ring.c: bool avail_wrap_counter;
drivers/virtio/virtio_ring.c: vq->packed.avail_wrap_counter ^= 1;
drivers/virtio/virtio_ring.c: vq->packed.avail_wrap_counter ^= 1;
drivers/virtio/virtio_ring.c: if (wrap_counter !=
vq->packed.avail_wrap_counter)
drivers/virtio/virtio_ring.c: vq->packed.avail_wrap_counter = 1;
Thanks
> ---
> drivers/virtio/virtio_ring.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
> index 71e16b5..5adb361 100644
> --- a/drivers/virtio/virtio_ring.c
> +++ b/drivers/virtio/virtio_ring.c
> @@ -1633,8 +1633,8 @@ static struct virtqueue *vring_create_virtqueue_packed(
> vq->packed.vring.device = device;
>
> vq->packed.next_avail_idx = 0;
> - vq->packed.avail_wrap_counter = 1;
> - vq->packed.used_wrap_counter = 1;
> + vq->packed.avail_wrap_counter = true;
> + vq->packed.used_wrap_counter = true;
> vq->packed.event_flags_shadow = 0;
> vq->packed.avail_used_flags = 1 << VRING_PACKED_DESC_F_AVAIL;
>
next prev parent reply other threads:[~2021-01-18 2:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-15 10:00 Jiapeng Zhong
2021-01-18 2:57 ` Jason Wang [this message]
2021-05-03 8:17 ` Michael S. Tsirkin
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=1d311c25-9051-ddcd-e7e1-5adbb8a913f9@redhat.com \
--to=jasowang@redhat.com \
--cc=abaci-bugfix@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
/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®