@@ -721,9 +721,7 @@ EXPORT_SYMBOL_GPL(__nvme_check_ready);
721
721
722
722
static int nvme_toggle_streams (struct nvme_ctrl * ctrl , bool enable )
723
723
{
724
- struct nvme_command c ;
725
-
726
- memset (& c , 0 , sizeof (c ));
724
+ struct nvme_command c = { };
727
725
728
726
c .directive .opcode = nvme_admin_directive_send ;
729
727
c .directive .nsid = cpu_to_le32 (NVME_NSID_ALL );
@@ -748,9 +746,8 @@ static int nvme_enable_streams(struct nvme_ctrl *ctrl)
748
746
static int nvme_get_stream_params (struct nvme_ctrl * ctrl ,
749
747
struct streams_directive_params * s , u32 nsid )
750
748
{
751
- struct nvme_command c ;
749
+ struct nvme_command c = { } ;
752
750
753
- memset (& c , 0 , sizeof (c ));
754
751
memset (s , 0 , sizeof (* s ));
755
752
756
753
c .directive .opcode = nvme_admin_directive_recv ;
@@ -1460,10 +1457,9 @@ static int nvme_features(struct nvme_ctrl *dev, u8 op, unsigned int fid,
1460
1457
unsigned int dword11 , void * buffer , size_t buflen , u32 * result )
1461
1458
{
1462
1459
union nvme_result res = { 0 };
1463
- struct nvme_command c ;
1460
+ struct nvme_command c = { } ;
1464
1461
int ret ;
1465
1462
1466
- memset (& c , 0 , sizeof (c ));
1467
1463
c .features .opcode = op ;
1468
1464
c .features .fid = cpu_to_le32 (fid );
1469
1465
c .features .dword11 = cpu_to_le32 (dword11 );
@@ -1591,9 +1587,8 @@ int nvme_getgeo(struct block_device *bdev, struct hd_geometry *geo)
1591
1587
static void nvme_init_integrity (struct gendisk * disk , u16 ms , u8 pi_type ,
1592
1588
u32 max_integrity_segments )
1593
1589
{
1594
- struct blk_integrity integrity ;
1590
+ struct blk_integrity integrity = { } ;
1595
1591
1596
- memset (& integrity , 0 , sizeof (integrity ));
1597
1592
switch (pi_type ) {
1598
1593
case NVME_NS_DPS_PI_TYPE3 :
1599
1594
integrity .profile = & t10_pi_type3_crc ;
@@ -1964,13 +1959,12 @@ static int nvme_send_ns_pr_command(struct nvme_ns *ns, struct nvme_command *c,
1964
1959
static int nvme_pr_command (struct block_device * bdev , u32 cdw10 ,
1965
1960
u64 key , u64 sa_key , u8 op )
1966
1961
{
1967
- struct nvme_command c ;
1962
+ struct nvme_command c = { } ;
1968
1963
u8 data [16 ] = { 0 , };
1969
1964
1970
1965
put_unaligned_le64 (key , & data [0 ]);
1971
1966
put_unaligned_le64 (sa_key , & data [8 ]);
1972
1967
1973
- memset (& c , 0 , sizeof (c ));
1974
1968
c .common .opcode = op ;
1975
1969
c .common .cdw10 = cpu_to_le32 (cdw10 );
1976
1970
@@ -2042,9 +2036,8 @@ int nvme_sec_submit(void *data, u16 spsp, u8 secp, void *buffer, size_t len,
2042
2036
bool send )
2043
2037
{
2044
2038
struct nvme_ctrl * ctrl = data ;
2045
- struct nvme_command cmd ;
2039
+ struct nvme_command cmd = { } ;
2046
2040
2047
- memset (& cmd , 0 , sizeof (cmd ));
2048
2041
if (send )
2049
2042
cmd .common .opcode = nvme_admin_security_send ;
2050
2043
else
0 commit comments