Commit 83e56d0b authored by Julia Lawall's avatar Julia Lawall Committed by Martin Schwidefsky

[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: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent bb509912
...@@ -163,7 +163,7 @@ void tcw_finalize(struct tcw *tcw, int num_tidaws) ...@@ -163,7 +163,7 @@ void tcw_finalize(struct tcw *tcw, int num_tidaws)
/* Add tcat to tccb. */ /* Add tcat to tccb. */
tccb = tcw_get_tccb(tcw); tccb = tcw_get_tccb(tcw);
tcat = (struct tccb_tcat *) &tccb->tca[tca_size(tccb)]; tcat = (struct tccb_tcat *) &tccb->tca[tca_size(tccb)];
memset(tcat, 0, sizeof(tcat)); memset(tcat, 0, sizeof(*tcat));
/* Calculate tcw input/output count and tcat transport count. */ /* Calculate tcw input/output count and tcat transport count. */
count = calc_dcw_count(tccb); count = calc_dcw_count(tccb);
if (tcw->w && (tcw->flags & TCW_FLAGS_OUTPUT_TIDA)) if (tcw->w && (tcw->flags & TCW_FLAGS_OUTPUT_TIDA))
...@@ -269,7 +269,7 @@ EXPORT_SYMBOL(tccb_init); ...@@ -269,7 +269,7 @@ EXPORT_SYMBOL(tccb_init);
*/ */
void tsb_init(struct tsb *tsb) void tsb_init(struct tsb *tsb)
{ {
memset(tsb, 0, sizeof(tsb)); memset(tsb, 0, sizeof(*tsb));
} }
EXPORT_SYMBOL(tsb_init); EXPORT_SYMBOL(tsb_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment