aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugenio Pérez <[email protected]>2021-11-04 20:58:33 +0100
committerMichael S. Tsirkin <[email protected]>2022-01-14 18:50:52 -0500
commit23118b09e6e11a03cb40a86875d5d342257ae1ec (patch)
treee3ccb7e6ed51921c5ae27870cd9bca17bc837443
parent10aa250b2f7d87d0921c5e991fd49e607050d486 (diff)
vdpa: Avoid duplicate call to vp_vdpa get_status
It has no sense to call get_status twice, since we already have a variable for that. Signed-off-by: Eugenio Pérez <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michael S. Tsirkin <[email protected]> Acked-by: Jason Wang <[email protected]> Reviewed-by: Stefano Garzarella <[email protected]>
-rw-r--r--drivers/vhost/vdpa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index e3c4f059b21a..ed2aabf07e74 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -170,7 +170,7 @@ static long vhost_vdpa_set_status(struct vhost_vdpa *v, u8 __user *statusp)
* Userspace shouldn't remove status bits unless reset the
* status to 0.
*/
- if (status != 0 && (ops->get_status(vdpa) & ~status) != 0)
+ if (status != 0 && (status_old & ~status) != 0)
return -EINVAL;
if ((status_old & VIRTIO_CONFIG_S_DRIVER_OK) && !(status & VIRTIO_CONFIG_S_DRIVER_OK))