aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvme
diff options
context:
space:
mode:
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>2021-06-14 19:45:52 -0700
committerChristoph Hellwig <hch@lst.de>2021-06-17 15:51:19 +0200
commitc22c2720133d51d95da608a77cd703f29d29747e (patch)
tree956401ce430ebb031edd8a6176d78050a8bf6f3c /drivers/nvme
parentnvme-fabrics: remove memset in nvmf_reg_read64() (diff)
downloadlinux-dev-c22c2720133d51d95da608a77cd703f29d29747e.tar.xz
linux-dev-c22c2720133d51d95da608a77cd703f29d29747e.zip
nvme-fabrics: remove memset in nvmf_reg_write32()
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>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/host/fabrics.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index 4753f1e5505e..09fe3d97bf44 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -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;