All of lore.kernel.org
 help / color / mirror / Atom feed
From: walter harms <wharms@bfs.de>
To: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	kernel-janitors@vger.kernel.org, Mark Brown <broonie@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/6] regulator: ti-abb: simplify platform_get_resource_byname/devm_ioremap_resource
Date: Mon, 19 Aug 2013 09:10:41 +0000	[thread overview]
Message-ID: <5211E111.4060406@bfs.de> (raw)
In-Reply-To: <1376902316-18520-6-git-send-email-Julia.Lawall@lip6.fr>



Am 19.08.2013 10:51, schrieb Julia Lawall:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Remove unneeded error handling on the result of a call to
> platform_get_resource_byname when the value is passed to devm_ioremap_resource.
> 
> A simplified version of the semantic patch that makes this change is as
> follows: (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@
> expression pdev,res,e,e1;
> expression ret != 0;
> identifier l;
> @@
> 
>   res = platform_get_resource_byname(...);
> - if (res = NULL) { ... \(goto l;\|return ret;\) }
>   e = devm_ioremap_resource(e1, res);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/regulator/ti-abb-regulator.c |   10 ----------
>  1 file changed, 10 deletions(-)
> 
> diff --git a/drivers/regulator/ti-abb-regulator.c b/drivers/regulator/ti-abb-regulator.c
> index 3753ed0..d8e3e12 100644
> --- a/drivers/regulator/ti-abb-regulator.c
> +++ b/drivers/regulator/ti-abb-regulator.c
> @@ -717,11 +717,6 @@ static int ti_abb_probe(struct platform_device *pdev)
>  	/* Map ABB resources */
>  	pname = "base-address";
>  	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, pname);
> -	if (!res) {
> -		dev_err(dev, "Missing '%s' IO resource\n", pname);
> -		ret = -ENODEV;
> -		goto err;
> -	}
>  	abb->base = devm_ioremap_resource(dev, res);
>  	if (IS_ERR(abb->base)) {
>  		ret = PTR_ERR(abb->base);


is pname used by anything else ? (also below)

re,
 wh

> @@ -770,11 +765,6 @@ static int ti_abb_probe(struct platform_device *pdev)
>  
>  	pname = "ldo-address";
>  	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, pname);
> -	if (!res) {
> -		dev_dbg(dev, "Missing '%s' IO resource\n", pname);
> -		ret = -ENODEV;
> -		goto skip_opt;
> -	}
>  	abb->ldo_base = devm_ioremap_resource(dev, res);
>  	if (IS_ERR(abb->ldo_base)) {
>  		ret = PTR_ERR(abb->ldo_base);
> 
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

WARNING: multiple messages have this Message-ID (diff)
From: walter harms <wharms@bfs.de>
To: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	kernel-janitors@vger.kernel.org, Mark Brown <broonie@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/6] regulator: ti-abb: simplify platform_get_resource_byname/devm_ioremap_resource
Date: Mon, 19 Aug 2013 11:10:41 +0200	[thread overview]
Message-ID: <5211E111.4060406@bfs.de> (raw)
In-Reply-To: <1376902316-18520-6-git-send-email-Julia.Lawall@lip6.fr>



Am 19.08.2013 10:51, schrieb Julia Lawall:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Remove unneeded error handling on the result of a call to
> platform_get_resource_byname when the value is passed to devm_ioremap_resource.
> 
> A simplified version of the semantic patch that makes this change is as
> follows: (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@
> expression pdev,res,e,e1;
> expression ret != 0;
> identifier l;
> @@
> 
>   res = platform_get_resource_byname(...);
> - if (res == NULL) { ... \(goto l;\|return ret;\) }
>   e = devm_ioremap_resource(e1, res);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/regulator/ti-abb-regulator.c |   10 ----------
>  1 file changed, 10 deletions(-)
> 
> diff --git a/drivers/regulator/ti-abb-regulator.c b/drivers/regulator/ti-abb-regulator.c
> index 3753ed0..d8e3e12 100644
> --- a/drivers/regulator/ti-abb-regulator.c
> +++ b/drivers/regulator/ti-abb-regulator.c
> @@ -717,11 +717,6 @@ static int ti_abb_probe(struct platform_device *pdev)
>  	/* Map ABB resources */
>  	pname = "base-address";
>  	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, pname);
> -	if (!res) {
> -		dev_err(dev, "Missing '%s' IO resource\n", pname);
> -		ret = -ENODEV;
> -		goto err;
> -	}
>  	abb->base = devm_ioremap_resource(dev, res);
>  	if (IS_ERR(abb->base)) {
>  		ret = PTR_ERR(abb->base);


is pname used by anything else ? (also below)

re,
 wh

> @@ -770,11 +765,6 @@ static int ti_abb_probe(struct platform_device *pdev)
>  
>  	pname = "ldo-address";
>  	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, pname);
> -	if (!res) {
> -		dev_dbg(dev, "Missing '%s' IO resource\n", pname);
> -		ret = -ENODEV;
> -		goto skip_opt;
> -	}
>  	abb->ldo_base = devm_ioremap_resource(dev, res);
>  	if (IS_ERR(abb->ldo_base)) {
>  		ret = PTR_ERR(abb->ldo_base);
> 
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  reply	other threads:[~2013-08-19  9:10 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-19  8:51 [PATCH 0/6] simplify platform_get_resource_byname/devm_ioremap_resource Julia Lawall
2013-08-19  8:51 ` Julia Lawall
2013-08-19  8:51 ` Julia Lawall
2013-08-19  8:51 ` Julia Lawall
2013-08-19  8:51 ` [PATCH 1/6] ASoC: omap: " Julia Lawall
2013-08-19  8:51   ` Julia Lawall
2013-08-19  8:51   ` Julia Lawall
2013-08-19 18:02   ` Jarkko Nikula
2013-08-19 18:02     ` Jarkko Nikula
2013-08-19 18:02     ` Jarkko Nikula
2013-08-20 10:51   ` Mark Brown
2013-08-20 10:51     ` Mark Brown
2013-08-19  8:51 ` [PATCH 2/6] watchdog: " Julia Lawall
2013-08-19  8:51   ` Julia Lawall
2013-08-19 13:06   ` Guenter Roeck
2013-08-19 13:06     ` Guenter Roeck
2013-08-19  8:51 ` [PATCH 3/6] mtd: fsmc_nand: " Julia Lawall
2013-08-19  8:51   ` Julia Lawall
2013-08-19  8:51   ` Julia Lawall
2013-08-19 13:38   ` Artem Bityutskiy
2013-08-19 13:38     ` Artem Bityutskiy
2013-08-19 13:38     ` Artem Bityutskiy
2013-08-19  8:51 ` [PATCH 4/6] usb: musb: dsps: " Julia Lawall
2013-08-19  8:51   ` Julia Lawall
2013-08-19 11:17   ` Svenning Sørensen
2013-08-19 11:17     ` Svenning Sørensen
2013-08-19 11:35     ` Julia Lawall
2013-08-19 11:35       ` Julia Lawall
2013-08-19 11:59       ` Svenning Sørensen
2013-08-19 11:59         ` Svenning Sørensen
2013-08-19 12:00         ` Julia Lawall
2013-08-19 12:00           ` Julia Lawall
2013-08-19 11:47     ` [PATCH 4/6 v2] " Julia Lawall
2013-08-19 11:47       ` Julia Lawall
2013-08-19 14:29       ` Sergei Shtylyov
2013-08-19 14:29         ` Sergei Shtylyov
2013-08-19 14:32         ` Julia Lawall
2013-08-19 14:32           ` Julia Lawall
2013-08-19 14:44         ` Dan Carpenter
2013-08-19 14:44           ` Dan Carpenter
2013-08-19  8:51 ` [PATCH 5/6] regulator: ti-abb: " Julia Lawall
2013-08-19  8:51   ` Julia Lawall
2013-08-19  9:10   ` walter harms [this message]
2013-08-19  9:10     ` walter harms
2013-08-19  9:12     ` Julia Lawall
2013-08-19  9:12       ` Julia Lawall
2013-08-19 10:12     ` Julia Lawall
2013-08-19 10:12       ` Julia Lawall
2013-08-19 10:17       ` walter harms
2013-08-19 10:17         ` walter harms
2013-08-19 10:23         ` Julia Lawall
2013-08-19 10:23           ` Julia Lawall
2013-08-19 10:16     ` Julia Lawall
2013-08-19 10:16       ` Julia Lawall
2013-08-22 10:15   ` Mark Brown
2013-08-22 10:15     ` Mark Brown
2013-08-19  8:51 ` [PATCH 6/6] MIPS: ath79: " Julia Lawall
2013-08-19  8:51   ` Julia Lawall
2013-08-22 17:50   ` Gabor Juhos
2013-08-22 17:50     ` Gabor Juhos
2013-08-31  8:09     ` John Crispin
2013-08-31  9:41       ` Gabor Juhos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5211E111.4060406@bfs.de \
    --to=wharms@bfs.de \
    --cc=Julia.Lawall@lip6.fr \
    --cc=broonie@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.