* [PATCH 1/1] drm/msm/dpu: Fix error return code in dpu_mdss_init()
@ 2021-05-08 2:42 Zhen Lei
2021-05-08 6:09 ` Stephen Boyd
0 siblings, 1 reply; 5+ messages in thread
From: Zhen Lei @ 2021-05-08 2:42 UTC (permalink / raw)
To: Rob Clark, Sean Paul, David Airlie, Daniel Vetter, Stephen Boyd,
linux-arm-msm, dri-devel, freedreno, linux-kernel
Cc: Zhen Lei
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 <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
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;
+ }
irq_set_chained_handler_and_data(irq, dpu_mdss_irq,
dpu_mdss);
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] drm/msm/dpu: Fix error return code in dpu_mdss_init()
2021-05-08 2:42 [PATCH 1/1] drm/msm/dpu: Fix error return code in dpu_mdss_init() Zhen Lei
@ 2021-05-08 6:09 ` Stephen Boyd
2021-05-08 7:55 ` Leizhen (ThunderTown)
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Boyd @ 2021-05-08 6:09 UTC (permalink / raw)
To: Daniel Vetter, David Airlie, Rob Clark, Sean Paul, Zhen Lei,
dri-devel, freedreno, linux-arm-msm, linux-kernel
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 <hulkci@huawei.com>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> ---
> 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.
>
> irq_set_chained_handler_and_data(irq, dpu_mdss_irq,
> dpu_mdss);
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] drm/msm/dpu: Fix error return code in dpu_mdss_init()
2021-05-08 6:09 ` Stephen Boyd
@ 2021-05-08 7:55 ` Leizhen (ThunderTown)
2021-05-08 7:58 ` Stephen Boyd
0 siblings, 1 reply; 5+ messages in thread
From: Leizhen (ThunderTown) @ 2021-05-08 7:55 UTC (permalink / raw)
To: Stephen Boyd, Daniel Vetter, David Airlie, Rob Clark, Sean Paul,
dri-devel, freedreno, linux-arm-msm, linux-kernel
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 <hulkci@huawei.com>
>> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
>> ---
>> 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.
>
>>
>> irq_set_chained_handler_and_data(irq, dpu_mdss_irq,
>> dpu_mdss);
>
> .
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] drm/msm/dpu: Fix error return code in dpu_mdss_init()
2021-05-08 7:55 ` Leizhen (ThunderTown)
@ 2021-05-08 7:58 ` Stephen Boyd
2021-05-08 8:17 ` Leizhen (ThunderTown)
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Boyd @ 2021-05-08 7:58 UTC (permalink / raw)
To: Daniel Vetter, David Airlie, Leizhen, Rob Clark, Sean Paul,
dri-devel, freedreno, linux-arm-msm, linux-kernel
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 <hulkci@huawei.com>
> >> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> >> ---
> >> 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
----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);
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] drm/msm/dpu: Fix error return code in dpu_mdss_init()
2021-05-08 7:58 ` Stephen Boyd
@ 2021-05-08 8:17 ` Leizhen (ThunderTown)
0 siblings, 0 replies; 5+ messages in thread
From: Leizhen (ThunderTown) @ 2021-05-08 8:17 UTC (permalink / raw)
To: Stephen Boyd, Daniel Vetter, David Airlie, Rob Clark, Sean Paul,
dri-devel, freedreno, linux-arm-msm, linux-kernel
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 <hulkci@huawei.com>
>>>> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
>>>> ---
>>>> 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);
>
> .
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-05-08 8:17 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-08 2:42 [PATCH 1/1] drm/msm/dpu: Fix error return code in dpu_mdss_init() Zhen Lei
2021-05-08 6:09 ` Stephen Boyd
2021-05-08 7:55 ` Leizhen (ThunderTown)
2021-05-08 7:58 ` Stephen Boyd
2021-05-08 8:17 ` Leizhen (ThunderTown)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).