From: Minwoo Im <minwoo.im.dev@gmail.com>
Date: Tue, 5 Dec 2017 05:23:54 +0900
Subject: nvme-pci: remove an unnecessary initialization in HMB code
Patch-mainline: v4.16-rc1
Git-commit: 6fbcde6691b514faa963c60f5537332530f1bf0a
References: FATE#323952, FATE#322506
The local variable __size__ will be set a bit later in a for-loop.
Remove the explicit initialization at the beginning of this function.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Johannes Thumshirn <jthumshirn@suse.de>
---
drivers/nvme/host/pci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1768,7 +1768,7 @@ static int __nvme_alloc_host_mem(struct
dma_addr_t descs_dma;
int i = 0;
void **bufs;
- u64 size = 0, tmp;
+ u64 size, tmp;
tmp = (preferred + chunk_size - 1);
do_div(tmp, chunk_size);
@@ -1851,7 +1851,7 @@ static int nvme_setup_host_mem(struct nv
u64 preferred = (u64)dev->ctrl.hmpre * 4096;
u64 min = (u64)dev->ctrl.hmmin * 4096;
u32 enable_bits = NVME_HOST_MEM_ENABLE;
- int ret = 0;
+ int ret;
preferred = min(preferred, max);
if (min > max) {