vhost: vdpa: remove unnecessary null check
Subsystems (5)
PATCH 1/1 vhost: vdpa: remove unnecessary null check
container_of is never null, so this null check is
unnecessary.
Addresses-Coverity-ID: 1492006 ("Logically dead code")
Fixes 20453a45fb06 ("vhost: introduce vDPA-based backend")
Signed-off-by Gustavo A. R. Silva <[email protected]>
--- drivers/vhost/vdpa.c | 2 -- 1 file changed, 2 deletions(-)
drivers/vhost/vdpa.c +0 -2
@@ -678,8 +678,6 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep)int nvqs, i, r, opened; v = container_of(inode->i_cdev, struct vhost_vdpa, cdev); -if (!v) -return -ENODEV ; opened =atomic_cmpxchg (&v->opened,0 ,1 );if (opened)
Signature · 1 line
2.26.0
Quoted 15 lines · Gustavo A. R. Silva
container_ofis never null, so this null check is
unnecessary.Addresses-Coverity-ID: 1492006 ("Logically dead code")
Fixes 20453a45fb06 ("vhost: introduce vDPA-based backend")Signed-off-by Gustavo A. R. Silva <[email protected]>--- drivers/vhost/vdpa.c | 2 -- 1 file changed, 2 deletions(-)drivers/vhost/vdpa.c +0
-0
drivers/vhost/vdpa.c static int vhost_vdpa_open(struct inode *inode, struct file *filep) · line 683
Quoted 8 lines
drivers/vhost/vdpa.c +0
-2@@ -678,8 +678,6 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep)int nvqs, i, r, opened; v = container_of(inode->i_cdev, struct vhost_vdpa, cdev); -if (!v) -return -ENODEV ; opened =atomic_cmpxchg (&v->opened,0 ,1 );if (opened)
Acked-by Jason Wang <[email protected]>
Thanks
Michael S. Tsirkin
maintainerQuoted 6 lines · Gustavo A. R. Silva
container_ofis never null, so this null check is
unnecessary.Addresses-Coverity-ID: 1492006 ("Logically dead code")
Fixes 20453a45fb06 ("vhost: introduce vDPA-based backend")Signed-off-by Gustavo A. R. Silva <[email protected]>
Yes weird. Was the point to test i_cdev? Tiwei?
Quoted 19 lines
--- drivers/vhost/vdpa.c | 2 -- 1 file changed, 2 deletions(-)drivers/vhost/vdpa.c +0
-2@@ -678,8 +678,6 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep)int nvqs, i, r, opened; v = container_of(inode->i_cdev, struct vhost_vdpa, cdev); -if (!v) -return -ENODEV ; opened =atomic_cmpxchg (&v->opened,0 ,1 );if (opened)Signature · 1 line
2.26.0