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=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,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 00CD2C433B4 for ; Sat, 8 May 2021 08:17:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF53461090 for ; Sat, 8 May 2021 08:17:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229797AbhEHISz (ORCPT ); Sat, 8 May 2021 04:18:55 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:17600 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229752AbhEHISz (ORCPT ); Sat, 8 May 2021 04:18:55 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Fcg9H4vlNz1BGnC; Sat, 8 May 2021 16:15:15 +0800 (CST) Received: from [127.0.0.1] (10.174.177.72) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Sat, 8 May 2021 16:17:50 +0800 Subject: Re: [PATCH 1/1] drm/msm/dpu: Fix error return code in dpu_mdss_init() To: Stephen Boyd , Daniel Vetter , "David Airlie" , Rob Clark , Sean Paul , dri-devel , freedreno , linux-arm-msm , linux-kernel References: <20210508024254.1877-1-thunder.leizhen@huawei.com> <4f6ab4db-958d-c2c5-7879-aa9a0d3b87ae@huawei.com> From: "Leizhen (ThunderTown)" Message-ID: Date: Sat, 8 May 2021 16:17:48 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.72] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On 2021/5/8 15:58, Stephen Boyd wrote: > Quoting Leizhen (ThunderTown) (2021-05-08 00:55:04) >> >> >> On 2021/5/8 14:09, Stephen Boyd wrote: >>> Quoting Zhen Lei (2021-05-07 19:42:54) >>>> Fix to return a negative error code from the error handling case instead >>>> of 0, as done elsewhere in this function. >>>> >>>> Fixes: 070e64dc1bbc ("drm/msm/dpu: Convert to a chained irq chip") >>>> Reported-by: Hulk Robot >>>> Signed-off-by: Zhen Lei >>>> --- >>>> drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c | 4 +++- >>>> 1 file changed, 3 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c >>>> index 06b56fec04e0..1b6c9fb500a1 100644 >>>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c >>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c >>>> @@ -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; >>>> + } >>> >>> It would be even better if ret wasn't assigned to 0 at the start of this >>> function. >> >> The returned error code is not unique. >> > > What does it mean? I was saying this Sorry, I misunderstood. I think your opinion is good. > > ----8<---- > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c > b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c > index cd4078807db1..0fcf190f6322 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c > @@ -263,7 +263,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); > @@ -297,8 +297,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); > @@ -309,7 +311,7 @@ int dpu_mdss_init(struct drm_device *dev) > > dpu_mdss_icc_request_bw(priv->mdss); > > - return ret; > + return 0; > > irq_error: > _dpu_mdss_irq_domain_fini(dpu_mdss); > > . >