summaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm
diff options
context:
space:
mode:
authorVishal Verma <vishal.l.verma@intel.com>2019-02-27 17:06:26 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-27 17:37:39 +0200
commit2979da373471f64a14d67904c969c74cd42b0dda (patch)
tree6d34af67e219a6a2fe9b99b9156aa8e5ee865d09 /drivers/nvdimm
parent5e66a5e2fd776bf014f06ba8ff569318c5415c71 (diff)
downloadlinux-stable-2979da373471f64a14d67904c969c74cd42b0dda.tar.gz
linux-stable-2979da373471f64a14d67904c969c74cd42b0dda.tar.bz2
linux-stable-2979da373471f64a14d67904c969c74cd42b0dda.zip
libnvdimm/btt: Remove unnecessary code in btt_freelist_init
[ Upstream commit 2f8c9011151337d0bc106693f272f9bddbccfab2 ] We call btt_log_read() twice, once to get the 'old' log entry, and again to get the 'new' entry. However, we have no use for the 'old' entry, so remove it. Cc: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/nvdimm')
-rw-r--r--drivers/nvdimm/btt.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c
index 75ae2c508a04..d78cfe82ad5c 100644
--- a/drivers/nvdimm/btt.c
+++ b/drivers/nvdimm/btt.c
@@ -541,9 +541,9 @@ static int arena_clear_freelist_error(struct arena_info *arena, u32 lane)
static int btt_freelist_init(struct arena_info *arena)
{
- int old, new, ret;
+ int new, ret;
u32 i, map_entry;
- struct log_entry log_new, log_old;
+ struct log_entry log_new;
arena->freelist = kcalloc(arena->nfree, sizeof(struct free_entry),
GFP_KERNEL);
@@ -551,10 +551,6 @@ static int btt_freelist_init(struct arena_info *arena)
return -ENOMEM;
for (i = 0; i < arena->nfree; i++) {
- old = btt_log_read(arena, i, &log_old, LOG_OLD_ENT);
- if (old < 0)
- return old;
-
new = btt_log_read(arena, i, &log_new, LOG_NEW_ENT);
if (new < 0)
return new;