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=-9.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 97233C433E7 for ; Thu, 16 Jul 2020 10:02:24 +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 68D512098B for ; Thu, 16 Jul 2020 10:02:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="QXqXKWHD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 68D512098B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch 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 D895D88830; Thu, 16 Jul 2020 10:02:23 +0000 (UTC) Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by gabe.freedesktop.org (Postfix) with ESMTPS id 64A6788830 for ; Thu, 16 Jul 2020 10:02:23 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id w3so10986475wmi.4 for ; Thu, 16 Jul 2020 03:02:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=HmJaP7NVFikmcFK4iQg7dTx43rAgLK9eCD2nR0ykggk=; b=QXqXKWHD595aOxvBvIH0/gxFgCKeBmrudeJvMWbRzyIjiUcd8RY3hApeSAnEV1kvE3 QpgeeNZA2EfDthgH3ykQZgPNBvm2P3awtwuaXp2nmwOFPFwcQ0DOVXbvhgDB53c/Ae0I XIkCuf6zc8kz51rbtP8PDxSLTOyINc3kqx25w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=HmJaP7NVFikmcFK4iQg7dTx43rAgLK9eCD2nR0ykggk=; b=XoIwMmizc2NqYifmfuUPMqq+6ebJWKxhWfbWq/q/YZeuFfZaoFIjONTlZ8QMcuKFC1 6eh7X0FALXtcVfbGXK71nabvxzHGZ6ZqcnQD7ru8yMikc3ZY0A6GS2cyQoj2sv4Ax6lo HIZFSJfY3TQKlgQ8B7v2WWiP147IQ4Eu72gAo3aYmknZTvubdS4xC2Hk4+9dfNcWSofk 51NR9mO3shBRJkcmnRRSNqNcOTcN2RwWQiYoZo7TTGNXn20bos0w1VFb0OY+PGxDelkE jj1aJdD8I+WekyqiX05C5P92Xrar2xax6gIWhW1iN1rF6fd4cZj6s0f2L9hABW4rSs8f oqwg== X-Gm-Message-State: AOAM531yC81TNxitWfmXpkBDwRr2E7QgM6V/xmasZIqUJtB17mefj7tm 1WGkkejBbIdGaFWNuxgCP2oeyg== X-Google-Smtp-Source: ABdhPJy/fuyzYF8bhQ0P7Z9zswy1xZik8dtBkFxL5eo+aszv5YPTqw8TmSmFdKQ6/aArjI3D5ObphA== X-Received: by 2002:a1c:5418:: with SMTP id i24mr3521598wmb.47.1594893742062; Thu, 16 Jul 2020 03:02:22 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id x9sm8030657wmk.45.2020.07.16.03.02.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 03:02:21 -0700 (PDT) Date: Thu, 16 Jul 2020 12:02:19 +0200 From: Daniel Vetter To: Jing Xiangfeng Subject: Re: [PATCH] drm: remove redundant assignment to variable 'ret' Message-ID: <20200716100202.GO3278063@phenom.ffwll.local> Mail-Followup-To: Jing Xiangfeng , maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@linux.ie, ajax@redhat.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20200715070559.180986-1-jingxiangfeng@huawei.com> <20200715120503.GJ3278063@phenom.ffwll.local> <5F0FB48A.6080407@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5F0FB48A.6080407@huawei.com> X-Operating-System: Linux phenom 5.6.0-1-amd64 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: , Cc: airlied@linux.ie, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, tzimmermann@suse.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Jul 16, 2020 at 09:59:38AM +0800, Jing Xiangfeng wrote: > > > 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. Ah indeed, but it got fixed already in commit 264ddd077c72092178153fc32d510dcecff32eeb Author: Emil Velikov 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 > > 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 -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel