Redundant memset in scsi_alloc_sgtable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



scsi_init_io calls scsi_alloc_sgtable and then calls blk_rq_map_sg
to initialize the scatterlist structure.  blk_rq_map_sg() already
memset the structure for every new segment.  That makes the memset
in scsi_alloc_sgtable unnecessary.

Patch to delete the extra memset in scsi_alloc_sgtable.  Tested on
a x86_64 machine.  Looks stable to me.


Signed-off-by: Ken Chen <kenneth.w.chen@xxxxxxxxx>

--- linux-2.6.12/drivers/scsi/scsi_lib.c.orig	2005-07-12 16:34:46.051647933 -0700
+++ linux-2.6.12/drivers/scsi/scsi_lib.c	2005-07-12 16:37:10.601450849 -0700
@@ -615,8 +615,6 @@ static struct scatterlist *scsi_alloc_sg
 
 	sgp = scsi_sg_pools + cmd->sglist_len;
 	sgl = mempool_alloc(sgp->pool, gfp_mask);
-	if (sgl)
-		memset(sgl, 0, sgp->size);
 	return sgl;
 }
 


-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux