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=-17.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 04836C43460 for ; Sat, 15 May 2021 17:45:22 +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 8AEF3610A0 for ; Sat, 15 May 2021 17:45:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8AEF3610A0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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 A6F466E0AC; Sat, 15 May 2021 17:45:20 +0000 (UTC) Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by gabe.freedesktop.org (Postfix) with ESMTPS id EBDC26E0AC for ; Sat, 15 May 2021 17:45:18 +0000 (UTC) Received: by mail-lj1-x236.google.com with SMTP id 131so2256900ljj.3 for ; Sat, 15 May 2021 10:45:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=Uew60+G+SsxW8j8MijONIawIC+5YuiNS9/uDWrf3cP4=; b=q7uMGfIu5kGZ+6hGNujZ64ZmMGy4RAikXSf8gFyIKdRbA71krFjYMlArGdyx2gq9Vq d9WOncS48vT9ws4TVxrvOPftv0vDMA0vs1BNZuOx0H1ORjEG171ueeUTtuYABCXCtDV8 VU02/2EfHzaGqprgipQVXAGhRyhW15jGjR19GiwNRD813aX3pyJgYqC6LekkD/on9E3k VTNYeguiwopR8UazK/toaPKYuSp0akJesQd0poBUiPBsST6mjHa7hywxSBqTb7DyWN1n J7fS/NOQsKnZ4+tBOHtHEefonMt015EkuoJrRFfV35eFvsEiMVk5/759MpZUEX/dRu79 JrNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Uew60+G+SsxW8j8MijONIawIC+5YuiNS9/uDWrf3cP4=; b=h05S5UjXDhB26dhWovlUZ0UQkdSd47RimZSzZWxxhAdExVbLuw6YaK1pm/XcrO03zC L114tDvzbu4vZydzeh1+0WfvWw0Q0l8Xs/eb2itf+iJlMedXeA6JuCgMkcECdNBZVpFh Or+9spLSXwsO8LqQND3Wgbdk8GyOUbPszvwrxcWvWJKPkxSmB60rK1yKV/DjYOY5EVeD qQH0Q0fqRcqDuZ5buRJ+R8mMwJNh6NAqLP8D6kz85ReiQ+tGusjJA6aCoeYY8QVE6mAh swzu4d9SLJ2OL9kdBy0x7vAG0acPsYjp8Yi5cV4yFNBLwAhb85bPc5OywvrKJ1iS222w 4a6g== X-Gm-Message-State: AOAM533eAIvvgAqMoijd2utjPzEywMIzwTGv4kl3dFEDyUldIGcK2KJl xCn7do83tc0REldmGon9giGtuQ== X-Google-Smtp-Source: ABdhPJzZpYVpC+2X095uKXRc/Oo5tcpmRjH0WCm9hYwhP9EBhCF2KrssdyelK4eKiW3/vctO7ffvdA== X-Received: by 2002:a2e:b807:: with SMTP id u7mr42869439ljo.67.1621100717420; Sat, 15 May 2021 10:45:17 -0700 (PDT) Received: from [192.168.1.211] ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id h4sm1430170lfv.264.2021.05.15.10.45.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 15 May 2021 10:45:16 -0700 (PDT) Subject: Re: [PATCH v2 1/1] drm/msm/dpu: Fix error return code in dpu_mdss_init() To: Zhen Lei , Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Anton Ivanov , linux-arm-msm , dri-devel , freedreno , linux-kernel References: <20210510031606.3112-1-thunder.leizhen@huawei.com> <20210510031606.3112-2-thunder.leizhen@huawei.com> From: Dmitry Baryshkov Message-ID: Date: Sat, 15 May 2021 20:45:16 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <20210510031606.3112-2-thunder.leizhen@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 10/05/2021 06:16, Zhen Lei wrote: > The error code returned by platform_get_irq() is stored in 'irq', it's > forgotten to be copied to 'ret' before being returned. As a result, the > value 0 of 'ret' is returned incorrectly. > > After the above fix is completed, initializing the local variable 'ret' > to 0 is no longer needed, remove it. > > In addition, when dpu_mdss_init() is successfully returned, the value of > 'ret' is always 0. Therefore, replace "return ret" with "return 0" to make > the code clearer. > > Fixes: 070e64dc1bbc ("drm/msm/dpu: Convert to a chained irq chip") > Reported-by: Hulk Robot > Signed-off-by: Zhen Lei Reviewed-by: Dmitry Baryshkov > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c > index 06b56fec04e047a..6b0a7bc87eb75b8 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c > @@ -225,7 +225,7 @@ int dpu_mdss_init(struct drm_device *dev) > struct msm_drm_private *priv = dev->dev_private; > struct dpu_mdss *dpu_mdss; > struct dss_module_power *mp; > - int ret = 0; > + int ret; > int irq; > > dpu_mdss = devm_kzalloc(dev->dev, sizeof(*dpu_mdss), GFP_KERNEL); > @@ -253,8 +253,10 @@ int dpu_mdss_init(struct drm_device *dev) > goto irq_domain_error; > > irq = platform_get_irq(pdev, 0); > - if (irq < 0) > + if (irq < 0) { > + ret = irq; > goto irq_error; > + } > > irq_set_chained_handler_and_data(irq, dpu_mdss_irq, > dpu_mdss); > @@ -263,7 +265,7 @@ int dpu_mdss_init(struct drm_device *dev) > > pm_runtime_enable(dev->dev); > > - return ret; > + return 0; > > irq_error: > _dpu_mdss_irq_domain_fini(dpu_mdss); > -- With best wishes Dmitry