[Midnightbsd-cvs] src [9121] trunk/sys/cam/ata/ata_all.c: remove two bzeros that are wasted due to later copying.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Oct 1 20:35:58 EDT 2016


Revision: 9121
          http://svnweb.midnightbsd.org/src/?rev=9121
Author:   laffer1
Date:     2016-10-01 20:35:58 -0400 (Sat, 01 Oct 2016)
Log Message:
-----------
remove two bzeros that are wasted due to later copying.

Modified Paths:
--------------
    trunk/sys/cam/ata/ata_all.c

Modified: trunk/sys/cam/ata/ata_all.c
===================================================================
--- trunk/sys/cam/ata/ata_all.c	2016-10-02 00:35:31 UTC (rev 9120)
+++ trunk/sys/cam/ata/ata_all.c	2016-10-02 00:35:58 UTC (rev 9121)
@@ -367,7 +367,7 @@
 ata_48bit_cmd(struct ccb_ataio *ataio, uint8_t cmd, uint16_t features,
     uint64_t lba, uint16_t sector_count)
 {
-	bzero(&ataio->cmd, sizeof(ataio->cmd));
+
 	ataio->cmd.flags = CAM_ATAIO_48BIT;
 	if (cmd == ATA_READ_DMA48 ||
 	    cmd == ATA_READ_DMA_QUEUED48 ||
@@ -391,6 +391,7 @@
 	ataio->cmd.features_exp = features >> 8;
 	ataio->cmd.sector_count = sector_count;
 	ataio->cmd.sector_count_exp = sector_count >> 8;
+	ataio->cmd.control = 0;
 }
 
 void
@@ -397,7 +398,7 @@
 ata_ncq_cmd(struct ccb_ataio *ataio, uint8_t cmd,
     uint64_t lba, uint16_t sector_count)
 {
-	bzero(&ataio->cmd, sizeof(ataio->cmd));
+
 	ataio->cmd.flags = CAM_ATAIO_48BIT | CAM_ATAIO_FPDMA;
 	ataio->cmd.command = cmd;
 	ataio->cmd.features = sector_count;
@@ -409,6 +410,9 @@
 	ataio->cmd.lba_mid_exp = lba >> 32;
 	ataio->cmd.lba_high_exp = lba >> 40;
 	ataio->cmd.features_exp = sector_count >> 8;
+	ataio->cmd.sector_count = 0;
+	ataio->cmd.sector_count_exp = 0;
+	ataio->cmd.control = 0;
 }
 
 void



More information about the Midnightbsd-cvs mailing list