* [PATCH -next] coresight: tpda: fix return value check in tpda_probe()
@ 2023-01-29 8:42 Yang Yingliang
2023-01-30 9:40 ` Suzuki K Poulose
0 siblings, 1 reply; 3+ messages in thread
From: Yang Yingliang @ 2023-01-29 8:42 UTC (permalink / raw)
To: coresight, linux-arm-kernel
Cc: mathieu.poirier, suzuki.poulose, mike.leach, leo.yan,
alexander.shishkin, quic_taozha, quic_jinlmao, yangyingliang
devm_ioremap_resource() never returns NULL pointer, it
will return ERR_PTR() when it fails, so replace the check
with IS_ERR().
Fixes: 5b7916625c01 ("Coresight: Add TPDA link driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
drivers/hwtracing/coresight/coresight-tpda.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwtracing/coresight/coresight-tpda.c b/drivers/hwtracing/coresight/coresight-tpda.c
index 19c25c9f6157..6313b12880e0 100644
--- a/drivers/hwtracing/coresight/coresight-tpda.c
+++ b/drivers/hwtracing/coresight/coresight-tpda.c
@@ -145,7 +145,7 @@ static int tpda_probe(struct amba_device *adev, const struct amba_id *id)
dev_set_drvdata(dev, drvdata);
base = devm_ioremap_resource(dev, &adev->res);
- if (!base)
+ if (IS_ERR(base))
return -ENOMEM;
drvdata->base = base;
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] coresight: tpda: fix return value check in tpda_probe()
2023-01-29 8:42 [PATCH -next] coresight: tpda: fix return value check in tpda_probe() Yang Yingliang
@ 2023-01-30 9:40 ` Suzuki K Poulose
2023-01-30 12:12 ` Yang Yingliang
0 siblings, 1 reply; 3+ messages in thread
From: Suzuki K Poulose @ 2023-01-30 9:40 UTC (permalink / raw)
To: Yang Yingliang, coresight, linux-arm-kernel
Cc: mathieu.poirier, mike.leach, leo.yan, alexander.shishkin,
quic_taozha, quic_jinlmao
On 29/01/2023 08:42, Yang Yingliang wrote:
> devm_ioremap_resource() never returns NULL pointer, it
> will return ERR_PTR() when it fails, so replace the check
> with IS_ERR().
Thanks for the patch.
>
> Fixes: 5b7916625c01 ("Coresight: Add TPDA link driver")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
> drivers/hwtracing/coresight/coresight-tpda.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-tpda.c b/drivers/hwtracing/coresight/coresight-tpda.c
> index 19c25c9f6157..6313b12880e0 100644
> --- a/drivers/hwtracing/coresight/coresight-tpda.c
> +++ b/drivers/hwtracing/coresight/coresight-tpda.c
> @@ -145,7 +145,7 @@ static int tpda_probe(struct amba_device *adev, const struct amba_id *id)
> dev_set_drvdata(dev, drvdata);
>
> base = devm_ioremap_resource(dev, &adev->res);
> - if (!base)
> + if (IS_ERR(base))
> return -ENOMEM;
I have fixed this up to :
return PTR_ERR(base);
for consistency.
Thanks
Suzuki
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] coresight: tpda: fix return value check in tpda_probe()
2023-01-30 9:40 ` Suzuki K Poulose
@ 2023-01-30 12:12 ` Yang Yingliang
0 siblings, 0 replies; 3+ messages in thread
From: Yang Yingliang @ 2023-01-30 12:12 UTC (permalink / raw)
To: Suzuki K Poulose, coresight, linux-arm-kernel
Cc: mathieu.poirier, mike.leach, leo.yan, alexander.shishkin,
quic_taozha, quic_jinlmao, yangyingliang
On 2023/1/30 17:40, Suzuki K Poulose wrote:
> On 29/01/2023 08:42, Yang Yingliang wrote:
>> devm_ioremap_resource() never returns NULL pointer, it
>> will return ERR_PTR() when it fails, so replace the check
>> with IS_ERR().
>
> Thanks for the patch.
>>
>> Fixes: 5b7916625c01 ("Coresight: Add TPDA link driver")
>> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
>> ---
>> drivers/hwtracing/coresight/coresight-tpda.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/hwtracing/coresight/coresight-tpda.c
>> b/drivers/hwtracing/coresight/coresight-tpda.c
>> index 19c25c9f6157..6313b12880e0 100644
>> --- a/drivers/hwtracing/coresight/coresight-tpda.c
>> +++ b/drivers/hwtracing/coresight/coresight-tpda.c
>> @@ -145,7 +145,7 @@ static int tpda_probe(struct amba_device *adev,
>> const struct amba_id *id)
>> dev_set_drvdata(dev, drvdata);
>> base = devm_ioremap_resource(dev, &adev->res);
>> - if (!base)
>> + if (IS_ERR(base))
>> return -ENOMEM;
>
> I have fixed this up to :
>
> return PTR_ERR(base);
>
> for consistency.
Yes, it should be PTR_ERR().
Thanks,
Yang
>
> Thanks
> Suzuki
>
>
> .
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-01-30 17:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-29 8:42 [PATCH -next] coresight: tpda: fix return value check in tpda_probe() Yang Yingliang
2023-01-30 9:40 ` Suzuki K Poulose
2023-01-30 12:12 ` Yang Yingliang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.