Skip to contentSkip to conversation

csiostor: remove unneeded memset()

PATCH In review Dan Carpenter 2 participants 2 messages Nov 27, 2012 – Nov 29, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 csiostor: remove unneeded memset()

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

drivers/scsi/csiostor/csio_lnode.c +0 -1
index 551959e..8b54976 100644
@@ -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 on v1 1/1
#1 lore raw
Quoted 10 lines · Dan Carpenter

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

drivers/scsi/csiostor/csio_lnode.c +0 -0
index 551959e..8b54976 100644

drivers/scsi/csiostor/csio_lnode.c csio_append_attrib(uint8_t **ptr, uint16_t type, uint8_t *val, uint16_t len) · line 250

Quoted 7 lines
drivers/scsi/csiostor/csio_lnode.c +0 -1
@@ -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;
 }

Thanks,
Naresh.