From: Vishal Verma Date: Thu, 28 Feb 2019 00:06:26 +0000 (-0700) Subject: libnvdimm/btt: Remove unnecessary code in btt_freelist_init X-Git-Tag: v4.9.225~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da9de008fb6a9b2c0161712ec4f708f1e96b0327;p=platform%2Fkernel%2Flinux-amlogic.git 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 Signed-off-by: Vishal Verma Signed-off-by: Dan Williams Signed-off-by: Sasha Levin --- diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c index 0c46ada027cf..e90ecb179622 100644 --- a/drivers/nvdimm/btt.c +++ b/drivers/nvdimm/btt.c @@ -447,9 +447,9 @@ static int btt_log_init(struct arena_info *arena) 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); @@ -457,10 +457,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;