1
0
Fork 0

[SCSI] hpsa: Change memset using sizeof(ptr) to sizeof(*ptr)

Not at all sure this is correct or appropriate to change,
but this seems odd.

Found via coccinelle script

@@
type T;
T* ptr;
expression E1;
@@

* memset(E1, 0, sizeof(ptr));

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
hifive-unleashed-5.1
Joe Perches 2011-05-08 23:32:40 -07:00 committed by James Bottomley
parent 51f52a4752
commit 7630abd0c6
1 changed files with 1 additions and 1 deletions

View File

@ -1329,7 +1329,7 @@ static void hpsa_scsi_do_simple_cmd_with_retry(struct ctlr_info *h,
int retry_count = 0;
do {
memset(c->err_info, 0, sizeof(c->err_info));
memset(c->err_info, 0, sizeof(*c->err_info));
hpsa_scsi_do_simple_cmd_core(h, c);
retry_count++;
} while (check_for_unit_attention(h, c) && retry_count <= 3);