linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] [SCSI] csiostor: remove unneeded memset()
@ 2012-11-27 17:33 Dan Carpenter
  2012-11-29  6:15 ` Naresh Kumar Inna
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-11-27 17:33 UTC (permalink / raw)
  To: James E.J. Bottomley
  Cc: Naresh Kumar Inna, linux-scsi, linux-kernel, kernel-janitors

No need to memset() this when we just copy over it on the next line.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/scsi/csiostor/csio_lnode.c b/drivers/scsi/csiostor/csio_lnode.c
index 551959e..8b54976 100644
--- a/drivers/scsi/csiostor/csio_lnode.c
+++ b/drivers/scsi/csiostor/csio_lnode.c
@@ -245,7 +245,6 @@ csio_append_attrib(uint8_t **ptr, uint16_t type, uint8_t *val, uint16_t len)
 	len += 4;		/* includes attribute type and length */
 	len = (len + 3) & ~3;	/* should be multiple of 4 bytes */
 	ae->len = htons(len);
-	memset(ae->value, 0, len - 4);
 	memcpy(ae->value, val, len);
 	*ptr += len;
 }

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

* Re: [patch] [SCSI] csiostor: remove unneeded memset()
  2012-11-27 17:33 [patch] [SCSI] csiostor: remove unneeded memset() Dan Carpenter
@ 2012-11-29  6:15 ` Naresh Kumar Inna
  0 siblings, 0 replies; 2+ messages in thread
From: Naresh Kumar Inna @ 2012-11-29  6:15 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: James E.J. Bottomley, linux-scsi, linux-kernel, kernel-janitors

On 11/27/2012 11:03 PM, Dan Carpenter wrote:
> No need to memset() this when we just copy over it on the next line.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/scsi/csiostor/csio_lnode.c b/drivers/scsi/csiostor/csio_lnode.c
> index 551959e..8b54976 100644
> --- a/drivers/scsi/csiostor/csio_lnode.c
> +++ b/drivers/scsi/csiostor/csio_lnode.c
> @@ -245,7 +245,6 @@ csio_append_attrib(uint8_t **ptr, uint16_t type, uint8_t *val, uint16_t len)
>  	len += 4;		/* includes attribute type and length */
>  	len = (len + 3) & ~3;	/* should be multiple of 4 bytes */
>  	ae->len = htons(len);
> -	memset(ae->value, 0, len - 4);
>  	memcpy(ae->value, val, len);
>  	*ptr += len;
>  }
> 

Acked-by: Naresh Kumar Inna <naresh@chelsio.com>

Thanks,
Naresh.


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

end of thread, other threads:[~2012-11-29  6:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-27 17:33 [patch] [SCSI] csiostor: remove unneeded memset() Dan Carpenter
2012-11-29  6:15 ` Naresh Kumar Inna

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).