diff options
Diffstat (limited to 'testing/sg_tst_async.cpp')
-rw-r--r-- | testing/sg_tst_async.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/testing/sg_tst_async.cpp b/testing/sg_tst_async.cpp index f81a26dd..8904e379 100644 --- a/testing/sg_tst_async.cpp +++ b/testing/sg_tst_async.cpp @@ -467,7 +467,7 @@ start_sg3_cmd(int sg_fd, command2execute cmd2exe, int pack_id, uint64_t lba, {0x88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}; uint8_t w16CmdBlk[WRITE16_CMD_LEN] = {0x8a, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}; - uint8_t sense_buffer[64] = {0}; + uint8_t sense_buffer[64] SG_C_CPP_ZERO_INIT; const char * np = NULL; struct sg_io_hdr * ptp; @@ -552,7 +552,7 @@ finish_sg3_cmd(int sg_fd, command2execute cmd2exe, int & pack_id, { bool ok; int res, k; - uint8_t sense_buffer[64] = {0}; + uint8_t sense_buffer[64] SG_C_CPP_ZERO_INIT; const char * np = NULL; struct sg_io_hdr pt; struct sg_io_hdr * ptp; @@ -652,7 +652,7 @@ start_sg4_cmd(int sg_fd, command2execute cmd2exe, int pack_id, uint64_t lba, {0x88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}; uint8_t w16CmdBlk[WRITE16_CMD_LEN] = {0x8a, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}; - uint8_t sense_buffer[64] = {0}; + uint8_t sense_buffer[64] SG_C_CPP_ZERO_INIT; const char * np = NULL; struct sg_io_v4 * ptp; @@ -730,7 +730,7 @@ finish_sg4_cmd(int sg_fd, command2execute cmd2exe, int & pack_id, { bool ok; int res, k; - uint8_t sense_buffer[64] = {0}; + uint8_t sense_buffer[64] SG_C_CPP_ZERO_INIT; const char * np = NULL; struct sg_io_v4 * ptp; struct sg_io_v4 p4t; @@ -869,7 +869,7 @@ work_sync_thread(int id, const char * dev_name, unsigned int /* hi_lba */, int thr_sync_starts = 0; struct sg_pt_base * ptp = NULL; uint8_t cdb[6]; - uint8_t sense_b[32] = {0}; + uint8_t sense_b[32] SG_C_CPP_ZERO_INIT; char b[120]; if (is_rw) { @@ -1610,7 +1610,7 @@ do_inquiry_prod_id(const char * dev_name, int block, int & sg_ver_num, uint8_t inqCmdBlk [INQ_CMD_LEN] = {0x12, 0, 0, 0, INQ_REPLY_LEN, 0}; uint8_t inqBuff[INQ_REPLY_LEN]; - uint8_t sense_buffer[64] = {0}; + uint8_t sense_buffer[64] SG_C_CPP_ZERO_INIT; int open_flags = O_RDWR; /* O_EXCL | O_RDONLY fails with EPERM */ if (! block) @@ -1689,8 +1689,8 @@ do_read_capacity(const char * dev_name, int block, unsigned int * last_lba, int res, sg_fd; uint8_t rcCmdBlk [10] = {0x25, 0, 0, 0, 0, 0, 0, 0, 0, 0}; uint8_t rcBuff[64]; - uint8_t sense_b[64] = {0}; - sg_io_hdr_t io_hdr; + uint8_t sense_b[64] SG_C_CPP_ZERO_INIT; + sg_io_hdr_t io_hdr SG_C_CPP_ZERO_INIT; int open_flags = O_RDWR; /* O_EXCL | O_RDONLY fails with EPERM */ if (! block) @@ -1701,7 +1701,6 @@ do_read_capacity(const char * dev_name, int block, unsigned int * last_lba, return -1; } /* Prepare READ CAPACITY(10) command */ - memset(&io_hdr, 0, sizeof(sg_io_hdr_t)); io_hdr.interface_id = 'S'; io_hdr.cmd_len = sizeof(rcCmdBlk); io_hdr.mx_sb_len = sizeof(sense_b); |