提交 18f91b3c 编写于 作者: K Keith Busch 提交者: Yang Yingliang

nvme: Fix uninitialized-variable warning

[ Upstream commit 15755854d53b4bbb0bb37a0fce66f0156cfc8a17 ]

gcc may detect a false positive on nvme using an unintialized variable
if setting features fails. Since this is not a fast path, explicitly
initialize this variable to suppress the warning.
Reported-by: NArnd Bergmann <arnd@arndb.de>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NKeith Busch <kbusch@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 03c85ca6
...@@ -1064,8 +1064,8 @@ static struct nvme_id_ns *nvme_identify_ns(struct nvme_ctrl *ctrl, ...@@ -1064,8 +1064,8 @@ static struct nvme_id_ns *nvme_identify_ns(struct nvme_ctrl *ctrl,
static int nvme_set_features(struct nvme_ctrl *dev, unsigned fid, unsigned dword11, static int nvme_set_features(struct nvme_ctrl *dev, unsigned fid, unsigned dword11,
void *buffer, size_t buflen, u32 *result) void *buffer, size_t buflen, u32 *result)
{ {
union nvme_result res = { 0 };
struct nvme_command c; struct nvme_command c;
union nvme_result res;
int ret; int ret;
memset(&c, 0, sizeof(c)); memset(&c, 0, sizeof(c));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册