]> www.infradead.org Git - users/jedix/linux-maple.git/commit
[SCSI] mpt2sas: take size of pointed value, not pointer
authorJulia Lawall <julia@diku.dk>
Fri, 16 Sep 2011 06:57:34 +0000 (08:57 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 16 Dec 2011 16:25:22 +0000 (11:25 -0500)
commitfc5830f0c2796a37f82b5b2657b4f0768fa8cc9e
tree82b32a8cb05061850ba0bcec759ee6d03bd6b879
parentd99462e88e4888dd2b2032ae52ea3b72ae4e4fe2
[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