diff options
author | Julia Lawall <julia@diku.dk> | 2011-09-16 02:57:34 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-09-22 07:13:12 -0400 |
commit | 96a99501d6ba0292ea7bd96846053091fc20776c (patch) | |
tree | cccae7f7a2554c6649f77c32e1e102804bc53c8d /drivers/scsi/mpt2sas | |
parent | 12b8fc10eaf4e981e9c546d4cfb94d592dc10622 (diff) |
[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>
Diffstat (limited to 'drivers/scsi/mpt2sas')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_transport.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_transport.c b/drivers/scsi/mpt2sas/mpt2sas_transport.c index 15c798026217..230732241aa2 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_transport.c +++ b/drivers/scsi/mpt2sas/mpt2sas_transport.c | |||
@@ -163,7 +163,7 @@ _transport_set_identify(struct MPT2SAS_ADAPTER *ioc, u16 handle, | |||
163 | return -EIO; | 163 | return -EIO; |
164 | } | 164 | } |
165 | 165 | ||
166 | memset(identify, 0, sizeof(identify)); | 166 | memset(identify, 0, sizeof(*identify)); |
167 | device_info = le32_to_cpu(sas_device_pg0.DeviceInfo); | 167 | device_info = le32_to_cpu(sas_device_pg0.DeviceInfo); |
168 | 168 | ||
169 | /* sas_address */ | 169 | /* sas_address */ |