drm: remove redundant assignment to variable 'ret'
Subsystems (2)
PATCH 1/1 drm: remove redundant assignment to variable 'ret'
The variable ret has been assigned the value '-EINVAL'. The assignment in the if() is redundant. We can remove it.
--- drivers/gpu/drm/drm_auth.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/drm_auth.c +0 -1
@@ -299,7 +299,6 @@ int drm_dropmaster_ioctl(struct drm_device *dev, void *data,if (file_priv->master->lessor !=NULL ) {DRM_DEBUG_LEASE ("Attempt to drop lessee %d as master\n" , file_priv->master->lessee_id); - ret = -EINVAL ; goto out_unlock; }
Signature · 1 line
2.17.1
Quoted 2 lines · Jing Xiangfeng
The variable ret has been assigned the value '
-EINVAL'. The assignment in theif()is redundant. We can remove it.
Nope, that's not correct. Before this assignement ret is guaranteed to be 0.
-Daniel
Quoted 21 lines
Signed-off-by Jing Xiangfeng <[email protected]>--- drivers/gpu/drm/drm_auth.c | 1 - 1 file changed, 1 deletion(-)drivers/gpu/drm/drm_auth.c +0
-1@@ -299,7 +299,6 @@ int drm_dropmaster_ioctl(struct drm_device *dev, void *data,if (file_priv->master->lessor !=NULL ) {DRM_DEBUG_LEASE ("Attempt to drop lessee %d as master\n" , file_priv->master->lessee_id); - ret = -EINVAL ; goto out_unlock; }Signature · 1 line
2.17.1
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 6 lines · Daniel Vetter
Quoted 2 lines · Jing Xiangfeng
The variable ret has been assigned the value '
-EINVAL'. The assignment in theif()is redundant. We can remove it.Nope, that's not correct. Before this assignement ret is guaranteed to be 0.
Before this assignment ret is '-EINVAL'(see commit 45bc3d26c95a: "drm: rework SET_MASTER and DROP_MASTER perm handling"). It is set to 0 above around the drm_drop_master() calls.
Thanks
Quoted 24 lines
-Daniel
Quoted 21 lines
Signed-off-by Jing Xiangfeng <[email protected]>--- drivers/gpu/drm/drm_auth.c | 1 - 1 file changed, 1 deletion(-)drivers/gpu/drm/drm_auth.c +0
-2@@ -299,7 +299,6 @@ int drm_dropmaster_ioctl(struct drm_device *dev, void *data,if (file_priv->master->lessor !=NULL ) {DRM_DEBUG_LEASE ("Attempt to drop lessee %d as master\n" , file_priv->master->lessee_id); - ret = -EINVAL ; goto out_unlock; } --2.17.1
Quoted 7 lines · Jing Xiangfeng
Quoted 4 lines · Daniel Vetter
Quoted 2 lines · Jing Xiangfeng
The variable ret has been assigned the value '
-EINVAL'. The assignment in theif()is redundant. We can remove it.
Quoted 6 lines
Quoted 2 lines
Nope, that's not correct. Before this assignement ret is guaranteed to be 0.
Before this assignment ret is '-EINVAL'(see commit
45bc3d26c95a: "drm:
reworkSET_MASTERandDROP_MASTERperm handling"). It is set to 0 above around thedrm_drop_master()calls.
Ah indeed, but it got fixed already in
commit 264ddd077c72092178153fc32d510dcecff32eeb
Author: Emil Velikov <[email protected]> Date: Sat May 30 13:46:40 2020 +0100
drm/auth: make drm_{set,drop}master_ioctl symmetrical
That's why your patch didn't make any sense to me. -Daniel
Quoted 30 lines
Thanks
Quoted 20 lines
-Daniel
Quoted 18 lines
Signed-off-by Jing Xiangfeng <[email protected]>--- drivers/gpu/drm/drm_auth.c | 1 - 1 file changed, 1 deletion(-)drivers/gpu/drm/drm_auth.c +0
-1@@ -299,7 +299,6 @@ int drm_dropmaster_ioctl(struct drm_device *dev, void *data,if (file_priv->master->lessor !=NULL ) {DRM_DEBUG_LEASE ("Attempt to drop lessee %d as master\n" , file_priv->master->lessee_id); - ret = -EINVAL ; goto out_unlock; }Quoted 4 lines
Quoted 3 lines
--
2.17.1_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel