Linux-Renesas-SoC Archive on lore.kernel.org
 help / Atom feed
* [PATCH] rcar-csi2: Fix coccinelle warning for PTR_ERR_OR_ZERO()
@ 2019-05-16  0:35 Niklas Söderlund
  2019-05-16  8:00 ` Ulrich Hecht
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Niklas Söderlund @ 2019-05-16  0:35 UTC (permalink / raw)
  To: Laurent Pinchart, linux-media
  Cc: linux-renesas-soc, Niklas Söderlund, kbuild test robot

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rcar-csi2: Fix coccinelle warning for PTR_ERR_OR_ZERO()
  2019-05-16  0:35 [PATCH] rcar-csi2: Fix coccinelle warning for PTR_ERR_OR_ZERO() Niklas Söderlund
@ 2019-05-16  8:00 ` Ulrich Hecht
  2019-05-16  8:15 ` Geert Uytterhoeven
  2019-05-16 11:27 ` Simon Horman
  2 siblings, 0 replies; 4+ messages in thread
From: Ulrich Hecht @ 2019-05-16  8:00 UTC (permalink / raw)
  To: Niklas Söderlund, Laurent Pinchart, linux-media
  Cc: linux-renesas-soc, kbuild test robot


> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rcar-csi2: Fix coccinelle warning for PTR_ERR_OR_ZERO()
  2019-05-16  0:35 [PATCH] rcar-csi2: Fix coccinelle warning for PTR_ERR_OR_ZERO() Niklas Söderlund
  2019-05-16  8:00 ` Ulrich Hecht
@ 2019-05-16  8:15 ` Geert Uytterhoeven
  2019-05-16 11:27 ` Simon Horman
  2 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2019-05-16  8:15 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: Laurent Pinchart, Linux Media Mailing List, Linux-Renesas,
	kbuild test robot

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

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rcar-csi2: Fix coccinelle warning for PTR_ERR_OR_ZERO()
  2019-05-16  0:35 [PATCH] rcar-csi2: Fix coccinelle warning for PTR_ERR_OR_ZERO() Niklas Söderlund
  2019-05-16  8:00 ` Ulrich Hecht
  2019-05-16  8:15 ` Geert Uytterhoeven
@ 2019-05-16 11:27 ` Simon Horman
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2019-05-16 11:27 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: Laurent Pinchart, linux-media, linux-renesas-soc, kbuild test robot

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
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-16  0:35 [PATCH] rcar-csi2: Fix coccinelle warning for PTR_ERR_OR_ZERO() Niklas Söderlund
2019-05-16  8:00 ` Ulrich Hecht
2019-05-16  8:15 ` Geert Uytterhoeven
2019-05-16 11:27 ` Simon Horman

Linux-Renesas-SoC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-renesas-soc/0 linux-renesas-soc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-renesas-soc linux-renesas-soc/ https://lore.kernel.org/linux-renesas-soc \
		linux-renesas-soc@vger.kernel.org linux-renesas-soc@archiver.kernel.org
	public-inbox-index linux-renesas-soc


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-renesas-soc


AGPL code for this site: git clone https://public-inbox.org/ public-inbox