On Mon, Jan 18, 2021 at 10:57:03AM +0800, Jason Wang wrote: > > 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@xxxxxxxxxxxxxxxxx> > > Signed-off-by: Jiapeng Zhong <abaci-bugfix@xxxxxxxxxxxxxxxxx> > > > 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 Agreed if we are doing this let's change them all. > > > --- > > 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; _______________________________________________ Virtualization mailing list Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linuxfoundation.org/mailman/listinfo/virtualization