Skip to contentSkip to conversation

arm: imx: Zero entire imxdma structure

PATCH New Ilia Mirkin 3 participants 4 messages Feb 20, 2011 – Feb 21, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: imx: Zero entire imxdma structure

The semantic match that finds the problem:
// <smpl>
@@
type T;
identifier x;
@@

T *x;
...
* memset(x, ..., ... * sizeof(x) * ...);
// </smpl>

---
 arch/arm/mach-imx/dma-v1.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Untested, lack of tool chain and hardware. But there's definitely something odd going on here, and this seemed like the most logical fix.

arch/arm/mach-imx/dma-v1.c +1 -1
index e9f1769..236f149 100644
@@ -699,7 +699,7 @@ int imx_dma_request(int channel, const char *name)
 		local_irq_restore(flags);
 		return -EBUSY;
 	}
-	memset(imxdma, 0, sizeof(imxdma));
+	memset(imxdma, 0, sizeof(*imxdma));
 	imxdma->name = name;
 	local_irq_restore(flags); /* request_irq() can block */
 
Signature · 1 line
1.7.3.4
#1 lore raw

PATCH 1/1 arm: imx: Zero entire imxdma structure

Quoted 12 lines · Ilia Mirkin

The semantic match that finds the problem:
// <smpl>
@@
type T;
identifier x;
@@

T *x;
...
* memset(x, ..., ... * sizeof(x) * ...);
// </smpl>

Quoted 8 lines

---
?arch/arm/mach-imx/dma-v1.c | ? ?2 +-
?1 files changed, 1 insertions(+), 1 deletions(-)

Untested, lack of tool chain and hardware. But there's definitely something odd going on here, and this seemed like the most logical fix.

Doing some quick digging (as I've been discovering that a few of the other patches I was planning on sending have already been sent out in the past), I noticed that this same patch was already sent on Dec 9, 2009 by Julia Lawall[1] (back when it was plat-mxc/dma-mx1-mx2.c), and then again by Vasiliy Kulikov[2] on Oct 10, 2010.

On each occasion, the response was positive, but patch has yet to make it upstream. Weird.

Signature · 5 lines
Ilia Mirkin
imirkin at alum.mit.edu

[1] Message-ID: <[email protected]>
[2] Message-ID: <[email protected]>
#2 lore raw

PATCH 1/1 arm: imx: Zero entire imxdma structure

Quoted 22 lines · Ilia Mirkin
Quoted 12 lines · Ilia Mirkin

The semantic match that finds the problem:
// <smpl>
@@
type T;
identifier x;
@@

T *x;
...
* memset(x, ..., ... * sizeof(x) * ...);
// </smpl>

Quoted 8 lines

---
?arch/arm/mach-imx/dma-v1.c | ? ?2 +-
?1 files changed, 1 insertions(+), 1 deletions(-)

Untested, lack of tool chain and hardware. But there's definitely something odd going on here, and this seemed like the most logical fix.

Quoted 8 lines

Doing some quick digging (as I've been discovering that a few of the other patches I was planning on sending have already been sent out in the past), I noticed that this same patch was already sent on Dec 9, 2009 by Julia Lawall[1] (back when it was plat-mxc/dma-mx1-mx2.c), and then again by Vasiliy Kulikov[2] on Oct 10, 2010.

On each occasion, the response was positive, but patch has yet to make it upstream. Weird.

Sascha, are you going to take this patch?

maintainer
#3 lore raw

PATCH 1/1 arm: imx: Zero entire imxdma structure

Quoted 29 lines · Russell King - ARM Linux
Quoted 28 lines · Ilia Mirkin
Quoted 12 lines · Ilia Mirkin

The semantic match that finds the problem:
// <smpl>
@@
type T;
identifier x;
@@

T *x;
...
* memset(x, ..., ... * sizeof(x) * ...);
// </smpl>

Quoted 8 lines

---
?arch/arm/mach-imx/dma-v1.c | ? ?2 +-
?1 files changed, 1 insertions(+), 1 deletions(-)

Untested, lack of tool chain and hardware. But there's definitely something odd going on here, and this seemed like the most logical fix.

Doing some quick digging (as I've been discovering that a few of the other patches I was planning on sending have already been sent out in the past), I noticed that this same patch was already sent on Dec 9, 2009 by Julia Lawall[1] (back when it was plat-mxc/dma-mx1-mx2.c), and then again by Vasiliy Kulikov[2] on Oct 10, 2010.

Quoted 4 lines
Quoted 2 lines

On each occasion, the response was positive, but patch has yet to make it upstream. Weird.

Sascha, are you going to take this patch?

Yes.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |