Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nvme-fabrics: use consistent zeroout pattern

Remove zeroout memeset call & zeroout local variable cmd at the time
of declaration in nvmf_ref_read32() similar to what we have done in
nvmf_reg_read64(), nvmf_reg_write32(), nvmf_connect_admin_queue(), and
nvmf_connect_io_queue().

Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>

authored by

Chaitanya Kulkarni and committed by
Christoph Hellwig
72b3eab4 0801a4b6

+1 -2
+1 -2
drivers/nvme/host/fabrics.c
··· 144 144 */ 145 145 int nvmf_reg_read32(struct nvme_ctrl *ctrl, u32 off, u32 *val) 146 146 { 147 - struct nvme_command cmd; 147 + struct nvme_command cmd = { }; 148 148 union nvme_result res; 149 149 int ret; 150 150 151 - memset(&cmd, 0, sizeof(cmd)); 152 151 cmd.prop_get.opcode = nvme_fabrics_command; 153 152 cmd.prop_get.fctype = nvme_fabrics_type_property_get; 154 153 cmd.prop_get.offset = cpu_to_le32(off);