LinuxTV Patchwork rcar-csi2: Fix coccinelle warning for PTR_ERR_OR_ZERO()

login
register
mail settings
Submitter Niklas Söderlund
Date May 16, 2019, 12:35 a.m.
Message ID <20190516003538.32172-1-niklas.soderlund+renesas@ragnatech.se>
Download mbox | patch
Permalink /patch/56182/
State New
Delegated to: Hans Verkuil
Headers show

Comments

Niklas Söderlund - May 16, 2019, 12:35 a.m.
Use the PTR_ERR_OR_ZERO() macro instead of construct:

    if (IS_ERR(foo))
        return PTR_ERR(foo);

    return 0;

Reported-by: kbuild test robot <lkp@intel.com>
Fixes: 3ae854cafd76 ("rcar-csi2: Use standby mode instead of resetting")
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/media/platform/rcar-vin/rcar-csi2.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
Ulrich Hecht - May 16, 2019, 8 a.m.
> On May 16, 2019 at 2:35 AM Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> wrote:
> 
> 
> Use the PTR_ERR_OR_ZERO() macro instead of construct:
> 
>     if (IS_ERR(foo))
>         return PTR_ERR(foo);
> 
>     return 0;
> 
> Reported-by: kbuild test robot <lkp@intel.com>
> Fixes: 3ae854cafd76 ("rcar-csi2: Use standby mode instead of resetting")
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
>  drivers/media/platform/rcar-vin/rcar-csi2.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-csi2.c b/drivers/media/platform/rcar-vin/rcar-csi2.c
> index 8f097e514900307f..c14af1b929dffd34 100644
> --- a/drivers/media/platform/rcar-vin/rcar-csi2.c
> +++ b/drivers/media/platform/rcar-vin/rcar-csi2.c
> @@ -1019,10 +1019,8 @@ static int rcsi2_probe_resources(struct rcar_csi2 *priv,
>  		return ret;
>  
>  	priv->rstc = devm_reset_control_get(&pdev->dev, NULL);
> -	if (IS_ERR(priv->rstc))
> -		return PTR_ERR(priv->rstc);
>  
> -	return 0;
> +	return PTR_ERR_OR_ZERO(priv->rstc);
>  }
>  
>  static const struct rcar_csi2_info rcar_csi2_info_r8a7795 = {
> -- 
> 2.21.0
>

Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>

CU
Uli
Geert Uytterhoeven - May 16, 2019, 8:15 a.m.
On Thu, May 16, 2019 at 3:50 AM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> Use the PTR_ERR_OR_ZERO() macro instead of construct:
>
>     if (IS_ERR(foo))
>         return PTR_ERR(foo);
>
>     return 0;
>
> Reported-by: kbuild test robot <lkp@intel.com>
> Fixes: 3ae854cafd76 ("rcar-csi2: Use standby mode instead of resetting")
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert
Simon Horman - May 16, 2019, 11:27 a.m.
On Thu, May 16, 2019 at 02:35:38AM +0200, Niklas Söderlund wrote:
> Use the PTR_ERR_OR_ZERO() macro instead of construct:
> 
>     if (IS_ERR(foo))
>         return PTR_ERR(foo);
> 
>     return 0;
> 
> Reported-by: kbuild test robot <lkp@intel.com>
> Fixes: 3ae854cafd76 ("rcar-csi2: Use standby mode instead of resetting")
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

> ---
>  drivers/media/platform/rcar-vin/rcar-csi2.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-csi2.c b/drivers/media/platform/rcar-vin/rcar-csi2.c
> index 8f097e514900307f..c14af1b929dffd34 100644
> --- a/drivers/media/platform/rcar-vin/rcar-csi2.c
> +++ b/drivers/media/platform/rcar-vin/rcar-csi2.c
> @@ -1019,10 +1019,8 @@ static int rcsi2_probe_resources(struct rcar_csi2 *priv,
>  		return ret;
>  
>  	priv->rstc = devm_reset_control_get(&pdev->dev, NULL);
> -	if (IS_ERR(priv->rstc))
> -		return PTR_ERR(priv->rstc);
>  
> -	return 0;
> +	return PTR_ERR_OR_ZERO(priv->rstc);
>  }
>  
>  static const struct rcar_csi2_info rcar_csi2_info_r8a7795 = {
> -- 
> 2.21.0
>

Patch

diff --git a/drivers/media/platform/rcar-vin/rcar-csi2.c b/drivers/media/platform/rcar-vin/rcar-csi2.c
index 8f097e514900307f..c14af1b929dffd34 100644
--- a/drivers/media/platform/rcar-vin/rcar-csi2.c
+++ b/drivers/media/platform/rcar-vin/rcar-csi2.c
@@ -1019,10 +1019,8 @@  static int rcsi2_probe_resources(struct rcar_csi2 *priv,
 		return ret;
 
 	priv->rstc = devm_reset_control_get(&pdev->dev, NULL);
-	if (IS_ERR(priv->rstc))
-		return PTR_ERR(priv->rstc);
 
-	return 0;
+	return PTR_ERR_OR_ZERO(priv->rstc);
 }
 
 static const struct rcar_csi2_info rcar_csi2_info_r8a7795 = {

Privacy Policy