linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: scameron@beardog.cce.hp.com
To: Joe Perches <joe@perches.com>
Cc: "James E.J. Bottomley" <James.Bottomley@suse.de>,
	iss_storagedev@hp.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] hpsa: Change memset using sizeof(ptr) to sizeof(*ptr)
Date: Mon, 9 May 2011 08:52:51 -0500	[thread overview]
Message-ID: <20110509135251.GE5997@beardog.cce.hp.com> (raw)
In-Reply-To: <1304922760.19586.30.camel@Joe-Laptop>

On Sun, May 08, 2011 at 11:32:40PM -0700, Joe Perches wrote:
> Not at all sure this is correct or appropriate to change,
> but this seems odd.
> 
> Found via coccinelle script

Ack.

-- steve

> 
> @@
> 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);
> 

      reply	other threads:[~2011-05-09 13:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110509135251.GE5997@beardog.cce.hp.com \
    --to=scameron@beardog.cce.hp.com \
    --cc=James.Bottomley@suse.de \
    --cc=iss_storagedev@hp.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).