]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[SCSI] hpsa: Change memset using sizeof(ptr) to sizeof(*ptr)
authorJoe Perches <joe@perches.com>
Mon, 9 May 2011 06:32:40 +0000 (23:32 -0700)
committerJames Bottomley <jbottomley@parallels.com>
Tue, 17 May 2011 07:19:27 +0000 (11:19 +0400)
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>
drivers/scsi/hpsa.c

index cffc7bb419de8ac4a35d0ed19f501861578ea7a3..c6c0434d80345a122b5e5729bb423615c12e0657 100644 (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);