[alsa-devel] [PATCH] ASOC: Atmel: ClassD: Simplify use of devm_ioremap_resource
Remove unneeded error handling on the result of a call to platform_get_resource when the value is passed to devm_ioremap_resource.
The Coccinelle semantic patch that makes this change is as follows:
// <smpl> @@ expression pdev,res,n,e,e1; expression ret != 0; identifier l; @@
- res = platform_get_resource(pdev, IORESOURCE_MEM, n); ... when != res - if (res == NULL) { ... (goto l;|return ret;) } ... when != res + res = platform_get_resource(pdev, IORESOURCE_MEM, n); e = devm_ioremap_resource(e1, res); // </smpl>
Signed-off-by: Amitoj Kaur Chawla amitoj1606@gmail.com --- sound/soc/atmel/atmel-classd.c | 5 ----- 1 file changed, 5 deletions(-)
diff --git a/sound/soc/atmel/atmel-classd.c b/sound/soc/atmel/atmel-classd.c index 6107de9..6d9b8b4 100644 --- a/sound/soc/atmel/atmel-classd.c +++ b/sound/soc/atmel/atmel-classd.c @@ -593,11 +593,6 @@ static int atmel_classd_probe(struct platform_device *pdev) }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(dev, "no memory resource\n"); - return -ENXIO; - } - io_base = devm_ioremap_resource(dev, res); if (IS_ERR(io_base)) { ret = PTR_ERR(io_base);
On Mon, Jul 04, 2016 at 06:33:52PM +0530, Amitoj Kaur Chawla wrote:
Remove unneeded error handling on the result of a call to platform_get_resource when the value is passed to devm_ioremap_resource.
Please use subject lines matching the style for the subsystem. This makes it easier for people to identify relevant patches.
On Mon, 4 Jul 2016, Mark Brown wrote:
On Mon, Jul 04, 2016 at 06:33:52PM +0530, Amitoj Kaur Chawla wrote:
Remove unneeded error handling on the result of a call to platform_get_resource when the value is passed to devm_ioremap_resource.
Please use subject lines matching the style for the subsystem. This makes it easier for people to identify relevant patches.
The point is that ASOC should be ASoC? Ther aren't many patches on this file, and two of the three have the same subject line as the above, but with ASoC rather than ASOC.
thanks, julia
On Mon, Jul 04, 2016 at 04:52:43PM +0200, Julia Lawall wrote:
On Mon, 4 Jul 2016, Mark Brown wrote:
Please use subject lines matching the style for the subsystem. This makes it easier for people to identify relevant patches.
The point is that ASOC should be ASoC? Ther aren't many patches on this file, and two of the three have the same subject line as the above, but with ASoC rather than ASOC.
Yes, that's the case here (this is one of my pre-canned responses and I didn't yet figure out a sensible way to make it parameterized yet, should add a bit about trawling git log though).
On Mon, 4 Jul 2016, Mark Brown wrote:
On Mon, Jul 04, 2016 at 04:52:43PM +0200, Julia Lawall wrote:
On Mon, 4 Jul 2016, Mark Brown wrote:
Please use subject lines matching the style for the subsystem. This makes it easier for people to identify relevant patches.
The point is that ASOC should be ASoC? Ther aren't many patches on this file, and two of the three have the same subject line as the above, but with ASoC rather than ASOC.
Yes, that's the case here (this is one of my pre-canned responses and I didn't yet figure out a sensible way to make it parameterized yet, should add a bit about trawling git log though).
OK, thanks. With all the capital letters it looks odd overall, so that is why I was wondering.
julia
On Mon, Jul 4, 2016 at 8:29 PM, Mark Brown broonie@kernel.org wrote:
On Mon, Jul 04, 2016 at 04:52:43PM +0200, Julia Lawall wrote:
On Mon, 4 Jul 2016, Mark Brown wrote:
Please use subject lines matching the style for the subsystem. This makes it easier for people to identify relevant patches.
The point is that ASOC should be ASoC? Ther aren't many patches on this file, and two of the three have the same subject line as the above, but with ASoC rather than ASOC.
Yes, that's the case here (this is one of my pre-canned responses and I didn't yet figure out a sensible way to make it parameterized yet, should add a bit about trawling git log though).
Sorry for the error. I'll send a v2.
Amitoj
On Mon, Jul 4, 2016 at 8:36 PM, Amitoj Kaur Chawla amitoj1606@gmail.com wrote:
On Mon, Jul 4, 2016 at 8:29 PM, Mark Brown broonie@kernel.org wrote:
On Mon, Jul 04, 2016 at 04:52:43PM +0200, Julia Lawall wrote:
On Mon, 4 Jul 2016, Mark Brown wrote:
Please use subject lines matching the style for the subsystem. This makes it easier for people to identify relevant patches.
The point is that ASOC should be ASoC? Ther aren't many patches on this file, and two of the three have the same subject line as the above, but with ASoC rather than ASOC.
Yes, that's the case here (this is one of my pre-canned responses and I didn't yet figure out a sensible way to make it parameterized yet, should add a bit about trawling git log though).
Sorry for the error. I'll send a v2.
Amitoj
I see the patch has already been applied with the corrected subject line.
Amitoj
participants (3)
-
Amitoj Kaur Chawla
-
Julia Lawall
-
Mark Brown