[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANLsYkzocXuYsopyN-fUxB92XtP_=ud-q1Bizj_25T+oG1kg_w@mail.gmail.com>
Date: Wed, 29 Nov 2017 09:52:36 -0700
From: Mathieu Poirier <mathieu.poirier@...aro.org>
To: Vasyl Gomonovych <gomonovych@...il.com>
Cc: "linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] coresight: Use PTR_ERR_OR_ZERO()
On 28 November 2017 at 15:16, Vasyl Gomonovych <gomonovych@...il.com> wrote:
> Fix ptr_ret.cocci warnings:
> drivers/hwtracing/coresight/coresight-tpiu.c:163:1-3: WARNING: PTR_ERR_OR_ZERO can be used
> drivers/hwtracing/coresight/coresight-funnel.c:217:1-3: WARNING: PTR_ERR_OR_ZERO can be used
> drivers/hwtracing/coresight/coresight-dynamic-replicator.c:166:1-3: WARNING: PTR_ERR_OR_ZERO can be used
>
> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
>
> Generated by: scripts/coccinelle/api/ptr_ret.cocci
>
> Signed-off-by: Vasyl Gomonovych <gomonovych@...il.com>
> ---
> drivers/hwtracing/coresight/coresight-dynamic-replicator.c | 4 +---
> drivers/hwtracing/coresight/coresight-funnel.c | 4 +---
> drivers/hwtracing/coresight/coresight-tpiu.c | 4 +---
> 3 files changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-dynamic-replicator.c b/drivers/hwtracing/coresight/coresight-dynamic-replicator.c
> index 8f4357e2626c..043da86b0fe9 100644
> --- a/drivers/hwtracing/coresight/coresight-dynamic-replicator.c
> +++ b/drivers/hwtracing/coresight/coresight-dynamic-replicator.c
> @@ -163,10 +163,8 @@ static int replicator_probe(struct amba_device *adev, const struct amba_id *id)
> desc.dev = &adev->dev;
> desc.groups = replicator_groups;
> drvdata->csdev = coresight_register(&desc);
> - if (IS_ERR(drvdata->csdev))
> - return PTR_ERR(drvdata->csdev);
>
> - return 0;
> + return PTR_ERR_OR_ZERO(drvdata->csdev);
> }
>
> #ifdef CONFIG_PM
> diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c
> index fd3c396717f6..9f8ac0bef853 100644
> --- a/drivers/hwtracing/coresight/coresight-funnel.c
> +++ b/drivers/hwtracing/coresight/coresight-funnel.c
> @@ -214,10 +214,8 @@ static int funnel_probe(struct amba_device *adev, const struct amba_id *id)
> desc.dev = dev;
> desc.groups = coresight_funnel_groups;
> drvdata->csdev = coresight_register(&desc);
> - if (IS_ERR(drvdata->csdev))
> - return PTR_ERR(drvdata->csdev);
>
> - return 0;
> + return PTR_ERR_OR_ZERO(drvdata->csdev);
> }
>
> #ifdef CONFIG_PM
> diff --git a/drivers/hwtracing/coresight/coresight-tpiu.c b/drivers/hwtracing/coresight/coresight-tpiu.c
> index bef49a3a5ca7..76ea1b8d4db5 100644
> --- a/drivers/hwtracing/coresight/coresight-tpiu.c
> +++ b/drivers/hwtracing/coresight/coresight-tpiu.c
> @@ -160,10 +160,8 @@ static int tpiu_probe(struct amba_device *adev, const struct amba_id *id)
> desc.pdata = pdata;
> desc.dev = dev;
> drvdata->csdev = coresight_register(&desc);
> - if (IS_ERR(drvdata->csdev))
> - return PTR_ERR(drvdata->csdev);
>
> - return 0;
> + return PTR_ERR_OR_ZERO(drvdata->csdev);
> }
Applied - thanks,
Mathieu
>
> #ifdef CONFIG_PM
> --
> 1.9.1
>
Powered by blists - more mailing lists