]> git.baikalelectronics.ru Git - kernel.git/commit
drivers/net/cpmac.c: Correct code taking the size of a pointer
authorJulia Lawall <julia@diku.dk>
Sun, 13 Dec 2009 05:35:45 +0000 (05:35 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Dec 2009 03:56:35 +0000 (19:56 -0800)
commit477d36d4cb11a69a1b77eb1f4e754b20a062f03c
tree411f7dde320c07ec45cf354a62ca1f04263fc532
parent81b85db73be3e6e8667d8b4840a6faaa909798f0
drivers/net/cpmac.c: Correct code taking the size of a pointer

sizeof(dev->dev_addr) is the size of a pointer.  On the other hand,
sizeof(pdata->dev_addr) is the size of an array, so use that instead.

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression *x;
expression f;
type T;
@@

*f(...,(T)x,...)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/cpmac.c