All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASOC: Atmel: ClassD: Simplify use of devm_ioremap_resource
@ 2016-07-04 13:03 Amitoj Kaur Chawla
  2016-07-04 14:15 ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Amitoj Kaur Chawla @ 2016-07-04 13:03 UTC (permalink / raw)
  To: nicolas.ferre, lgirdwood, broonie, perex, tiwai, alsa-devel,
	linux-kernel
  Cc: julia.lawall

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);
-- 
1.9.1

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

* Re: [PATCH] ASOC: Atmel: ClassD: Simplify use of devm_ioremap_resource
  2016-07-04 13:03 [PATCH] ASOC: Atmel: ClassD: Simplify use of devm_ioremap_resource Amitoj Kaur Chawla
@ 2016-07-04 14:15 ` Mark Brown
  2016-07-04 14:52   ` Julia Lawall
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2016-07-04 14:15 UTC (permalink / raw)
  To: Amitoj Kaur Chawla
  Cc: nicolas.ferre, lgirdwood, perex, tiwai, alsa-devel, linux-kernel,
	julia.lawall

[-- Attachment #1: Type: text/plain, Size: 332 bytes --]

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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH] ASOC: Atmel: ClassD: Simplify use of devm_ioremap_resource
  2016-07-04 14:15 ` Mark Brown
@ 2016-07-04 14:52   ` Julia Lawall
  2016-07-04 14:59     ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Julia Lawall @ 2016-07-04 14:52 UTC (permalink / raw)
  To: Mark Brown
  Cc: Amitoj Kaur Chawla, nicolas.ferre, lgirdwood, perex, tiwai,
	alsa-devel, linux-kernel



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

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

* Re: [PATCH] ASOC: Atmel: ClassD: Simplify use of devm_ioremap_resource
  2016-07-04 14:52   ` Julia Lawall
@ 2016-07-04 14:59     ` Mark Brown
  2016-07-04 15:01       ` Julia Lawall
  2016-07-04 15:06       ` Amitoj Kaur Chawla
  0 siblings, 2 replies; 7+ messages in thread
From: Mark Brown @ 2016-07-04 14:59 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Amitoj Kaur Chawla, nicolas.ferre, lgirdwood, perex, tiwai,
	alsa-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 606 bytes --]

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).

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH] ASOC: Atmel: ClassD: Simplify use of devm_ioremap_resource
  2016-07-04 14:59     ` Mark Brown
@ 2016-07-04 15:01       ` Julia Lawall
  2016-07-04 15:06       ` Amitoj Kaur Chawla
  1 sibling, 0 replies; 7+ messages in thread
From: Julia Lawall @ 2016-07-04 15:01 UTC (permalink / raw)
  To: Mark Brown
  Cc: Amitoj Kaur Chawla, nicolas.ferre, lgirdwood, perex, tiwai,
	alsa-devel, linux-kernel



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

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

* Re: [PATCH] ASOC: Atmel: ClassD: Simplify use of devm_ioremap_resource
  2016-07-04 14:59     ` Mark Brown
  2016-07-04 15:01       ` Julia Lawall
@ 2016-07-04 15:06       ` Amitoj Kaur Chawla
  2016-07-04 15:07         ` Amitoj Kaur Chawla
  1 sibling, 1 reply; 7+ messages in thread
From: Amitoj Kaur Chawla @ 2016-07-04 15:06 UTC (permalink / raw)
  To: Mark Brown
  Cc: Julia Lawall, nicolas.ferre, Liam Girdwood, perex, tiwai,
	alsa-devel, Linux-Kernel@Vger. Kernel. Org

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

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

* Re: [PATCH] ASOC: Atmel: ClassD: Simplify use of devm_ioremap_resource
  2016-07-04 15:06       ` Amitoj Kaur Chawla
@ 2016-07-04 15:07         ` Amitoj Kaur Chawla
  0 siblings, 0 replies; 7+ messages in thread
From: Amitoj Kaur Chawla @ 2016-07-04 15:07 UTC (permalink / raw)
  To: Mark Brown
  Cc: Julia Lawall, nicolas.ferre, Liam Girdwood, perex, tiwai,
	alsa-devel, Linux-Kernel@Vger. Kernel. Org

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

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

end of thread, other threads:[~2016-07-04 15:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-04 13:03 [PATCH] ASOC: Atmel: ClassD: Simplify use of devm_ioremap_resource Amitoj Kaur Chawla
2016-07-04 14:15 ` Mark Brown
2016-07-04 14:52   ` Julia Lawall
2016-07-04 14:59     ` Mark Brown
2016-07-04 15:01       ` Julia Lawall
2016-07-04 15:06       ` Amitoj Kaur Chawla
2016-07-04 15:07         ` Amitoj Kaur Chawla

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.