Skip to content

Commit

Permalink
libnvdimm/btt: Remove unnecessary code in btt_freelist_init
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vishal Verma authored and Dan Williams committed Feb 28, 2019
1 parent 0171b6b commit 2f8c901
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/nvdimm/btt.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,20 +541,16 @@ 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);
if (!arena->freelist)
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;
Expand Down

0 comments on commit 2f8c901

Please sign in to comment.