From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C592CC433E2 for ; Thu, 16 Jul 2020 09:42:44 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 80D7F2065D for ; Thu, 16 Jul 2020 09:42:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 80D7F2065D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9066889D83; Thu, 16 Jul 2020 09:42:43 +0000 (UTC) Received: from huawei.com (szxga07-in.huawei.com [45.249.212.35]) by gabe.freedesktop.org (Postfix) with ESMTPS id D2F8A6E1A5 for ; Thu, 16 Jul 2020 01:59:50 +0000 (UTC) Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 094F3E12A9A918CC266D; Thu, 16 Jul 2020 09:59:41 +0800 (CST) Received: from [10.174.179.105] (10.174.179.105) by smtp.huawei.com (10.3.19.206) with Microsoft SMTP Server (TLS) id 14.3.487.0; Thu, 16 Jul 2020 09:59:39 +0800 Subject: Re: [PATCH] drm: remove redundant assignment to variable 'ret' To: , , , , , , References: <20200715070559.180986-1-jingxiangfeng@huawei.com> <20200715120503.GJ3278063@phenom.ffwll.local> From: Jing Xiangfeng Message-ID: <5F0FB48A.6080407@huawei.com> Date: Thu, 16 Jul 2020 09:59:38 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20200715120503.GJ3278063@phenom.ffwll.local> X-Originating-IP: [10.174.179.105] X-CFilter-Loop: Reflected X-Mailman-Approved-At: Thu, 16 Jul 2020 09:42:42 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 >> --- >> 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 >> > _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel