lkml.org 
[lkml]   [2020]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] drm: remove redundant assignment to variable 'ret'
From
Date


On 2020/7/15 20:05, Daniel Vetter wrote:
> On Wed, Jul 15, 2020 at 03:05:59PM +0800, Jing Xiangfeng wrote:
>> The variable ret has been assigned the value '-EINVAL'. The assignment
>> in the if() 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
> -Daniel
>
>>
>> Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
>> ---
>> drivers/gpu/drm/drm_auth.c | 1 -
>> 1 file changed, 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c
>> index 800ac39f3213..6e1b502f2797 100644
>> --- a/drivers/gpu/drm/drm_auth.c
>> +++ b/drivers/gpu/drm/drm_auth.c
>> @@ -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
>>
>

\
 
 \ /
  Last update: 2020-07-16 04:01    [W:0.068 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site