nvme-fabrics: remove memset in nvmf_reg_write32()
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Tue, 15 Jun 2021 02:45:52 +0000 (19:45 -0700)
committerChristoph Hellwig <hch@lst.de>
Thu, 17 Jun 2021 13:51:19 +0000 (15:51 +0200)
Declare and initialize structure variable to the zero values so that we
can get rid of the zeroout memset call.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/fabrics.c

index 4753f1e5505e000afbcfef95b68ac02ed416e4dd..09fe3d97bf441fd084f60cb35136623cd07d5254 100644 (file)
@@ -235,10 +235,9 @@ EXPORT_SYMBOL_GPL(nvmf_reg_read64);
  */
 int nvmf_reg_write32(struct nvme_ctrl *ctrl, u32 off, u32 val)
 {
-       struct nvme_command cmd;
+       struct nvme_command cmd = { };
        int ret;
 
-       memset(&cmd, 0, sizeof(cmd));
        cmd.prop_set.opcode = nvme_fabrics_command;
        cmd.prop_set.fctype = nvme_fabrics_type_property_set;
        cmd.prop_set.attrib = 0;