WSL2-Linux-Kernel/drivers/vdpa
Samuel Zou 18e643cd6c vdpasim: Fix some coccinelle warnings
Fix below warnings reported by coccicheck:

drivers/vdpa/vdpa_sim/vdpa_sim.c:104:1-10: WARNING: Assignment of 0/1 to bool variable
drivers/vdpa/vdpa_sim/vdpa_sim.c:164:7-11: WARNING: Unsigned expression compared with zero: read <= 0
drivers/vdpa/vdpa_sim/vdpa_sim.c:169:7-12: WARNING: Unsigned expression compared with zero: write <= 0

1. The 'ready' variable in vdpasim_virtqueue struct is bool type.
   It is better to initialize vq->ready to false

2. Modify 'read' and 'write' variables type from size_t to ssize_t.
   And preserve the reverse christmas tree ordering of local variables.

Fixes: 2c53d0f64c ("vdpasim: vDPA device simulator")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Samuel Zou <zou_wei@huawei.com>
Link: https://lore.kernel.org/r/1588990802-28451-1-git-send-email-zou_wei@huawei.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2020-06-04 15:36:52 -04:00
..
ifcvf ifcvf: move IRQ request/free to status change handlers 2020-06-04 15:36:51 -04:00
vdpa_sim vdpasim: Fix some coccinelle warnings 2020-06-04 15:36:52 -04:00
Kconfig vhost: revert "vhost: disable for OABI" 2020-06-02 02:45:13 -04:00
Makefile vdpa: move to drivers/vdpa 2020-04-02 10:41:40 -04:00
vdpa.c vdpa: fix comment of vdpa_register_device() 2020-04-17 06:05:30 -04:00