lkml.org 
[lkml]   [2020]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 44/59] libnvdimm/btt: Remove unnecessary code in btt_freelist_init
    Date
    From: Vishal Verma <vishal.l.verma@intel.com>

    [ 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>
    ---
    drivers/nvdimm/btt.c | 8 ++------
    1 file changed, 2 insertions(+), 6 deletions(-)

    diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c
    index 471498469d0a..61e519f1d768 100644
    --- a/drivers/nvdimm/btt.c
    +++ b/drivers/nvdimm/btt.c
    @@ -540,9 +540,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);
    @@ -550,10 +550,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;
    --
    2.25.1


    \
     
     \ /
      Last update: 2020-05-26 21:30    [W:4.061 / U:0.072 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site