From: Joe Perches Date: Mon, 9 May 2011 06:32:40 +0000 (-0700) Subject: [SCSI] hpsa: Change memset using sizeof(ptr) to sizeof(*ptr) X-Git-Tag: v3.0-rc1~383^2~15 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7630abd0c690e90cea9412846f596fe1565aaa0e;p=karo-tx-linux.git [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 Acked-by: Stephen M. Cameron Signed-off-by: James Bottomley Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index cffc7bb419de..c6c0434d8034 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -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);