diff options
author | Julia Lawall <julia@diku.dk> | 2009-12-18 11:43:22 -0500 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2009-12-18 11:43:32 -0500 |
commit | 83e56d0b23f91b70a7e708ce0979a57b6c6a1507 (patch) | |
tree | bcfd461199eb4c551675ecd5bf5a9822231c482b /drivers/s390 | |
parent | bb509912481214cf6ad1181c968295c62ff1ad9e (diff) |
[S390] drivers: Correct size given to memset
Memset should be given the size of the structure, not the size of the pointer.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
type T;
T *x;
expression E;
@@
memset(x, E, sizeof(
+ *
x))
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/cio/fcx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/s390/cio/fcx.c b/drivers/s390/cio/fcx.c index 61677dfbdc9b..ca5e9bb9d458 100644 --- a/drivers/s390/cio/fcx.c +++ b/drivers/s390/cio/fcx.c | |||
@@ -163,7 +163,7 @@ void tcw_finalize(struct tcw *tcw, int num_tidaws) | |||
163 | /* Add tcat to tccb. */ | 163 | /* Add tcat to tccb. */ |
164 | tccb = tcw_get_tccb(tcw); | 164 | tccb = tcw_get_tccb(tcw); |
165 | tcat = (struct tccb_tcat *) &tccb->tca[tca_size(tccb)]; | 165 | tcat = (struct tccb_tcat *) &tccb->tca[tca_size(tccb)]; |
166 | memset(tcat, 0, sizeof(tcat)); | 166 | memset(tcat, 0, sizeof(*tcat)); |
167 | /* Calculate tcw input/output count and tcat transport count. */ | 167 | /* Calculate tcw input/output count and tcat transport count. */ |
168 | count = calc_dcw_count(tccb); | 168 | count = calc_dcw_count(tccb); |
169 | if (tcw->w && (tcw->flags & TCW_FLAGS_OUTPUT_TIDA)) | 169 | if (tcw->w && (tcw->flags & TCW_FLAGS_OUTPUT_TIDA)) |
@@ -269,7 +269,7 @@ EXPORT_SYMBOL(tccb_init); | |||
269 | */ | 269 | */ |
270 | void tsb_init(struct tsb *tsb) | 270 | void tsb_init(struct tsb *tsb) |
271 | { | 271 | { |
272 | memset(tsb, 0, sizeof(tsb)); | 272 | memset(tsb, 0, sizeof(*tsb)); |
273 | } | 273 | } |
274 | EXPORT_SYMBOL(tsb_init); | 274 | EXPORT_SYMBOL(tsb_init); |
275 | 275 | ||