diff options
author | Vishal Verma <vishal.l.verma@intel.com> | 2019-02-27 19:06:26 -0500 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2019-02-28 12:42:51 -0500 |
commit | 2f8c9011151337d0bc106693f272f9bddbccfab2 (patch) | |
tree | 6aa5fd999099dc069d24cbe2985f747adf48c239 | |
parent | 0171b6b78131110a6870d4b7296bc9dfc392116a (diff) |
libnvdimm/btt: Remove unnecessary code in btt_freelist_init
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>
-rw-r--r-- | drivers/nvdimm/btt.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c index b123b0dcf274..cd4fa87ea48c 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) | |||
541 | 541 | ||
542 | static int btt_freelist_init(struct arena_info *arena) | 542 | static int btt_freelist_init(struct arena_info *arena) |
543 | { | 543 | { |
544 | int old, new, ret; | 544 | int new, ret; |
545 | u32 i, map_entry; | 545 | u32 i, map_entry; |
546 | struct log_entry log_new, log_old; | 546 | struct log_entry log_new; |
547 | 547 | ||
548 | arena->freelist = kcalloc(arena->nfree, sizeof(struct free_entry), | 548 | arena->freelist = kcalloc(arena->nfree, sizeof(struct free_entry), |
549 | GFP_KERNEL); | 549 | GFP_KERNEL); |
@@ -551,10 +551,6 @@ static int btt_freelist_init(struct arena_info *arena) | |||
551 | return -ENOMEM; | 551 | return -ENOMEM; |
552 | 552 | ||
553 | for (i = 0; i < arena->nfree; i++) { | 553 | for (i = 0; i < arena->nfree; i++) { |
554 | old = btt_log_read(arena, i, &log_old, LOG_OLD_ENT); | ||
555 | if (old < 0) | ||
556 | return old; | ||
557 | |||
558 | new = btt_log_read(arena, i, &log_new, LOG_NEW_ENT); | 554 | new = btt_log_read(arena, i, &log_new, LOG_NEW_ENT); |
559 | if (new < 0) | 555 | if (new < 0) |
560 | return new; | 556 | return new; |