[SCSI] mpt2sas: take size of pointed value, not pointer
commit96a99501d6ba0292ea7bd96846053091fc20776c
authorJulia Lawall <julia@diku.dk>
Fri, 16 Sep 2011 06:57:34 +0000 (16 08:57 +0200)
committerJames Bottomley <JBottomley@Parallels.com>
Thu, 22 Sep 2011 11:13:12 +0000 (22 15:13 +0400)
treecccae7f7a2554c6649f77c32e1e102804bc53c8d
parent12b8fc10eaf4e981e9c546d4cfb94d592dc10622
[SCSI] mpt2sas: take size of pointed value, not pointer

Sizeof a pointer-typed expression returns the size of the pointer, not that
of the pointed data.

The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression *e;
type T;
identifier f;
@@

f(...,(T)e,...,
-sizeof(e)
+sizeof(*e)
,...)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/mpt2sas/mpt2sas_transport.c