linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] hpsa: Change memset using sizeof(ptr) to sizeof(*ptr)
@ 2011-05-09  6:32 Joe Perches
  2011-05-09 13:52 ` scameron
  0 siblings, 1 reply; 2+ messages in thread
From: Joe Perches @ 2011-05-09  6:32 UTC (permalink / raw)
  To: Stephen M. Cameron
  Cc: James E.J. Bottomley, iss_storagedev, linux-scsi, linux-kernel

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>
---
 drivers/scsi/hpsa.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 415ad4f..c8d97b4 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -1308,7 +1308,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);



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-09 13:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-09  6:32 [RFC PATCH] hpsa: Change memset using sizeof(ptr) to sizeof(*ptr) Joe Perches
2011-05-09 13:52 ` scameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).