lkml.org 
[lkml]   [2020]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5/9] XArray: entry in last level is not expected to be a node
    Date
    If an entry is at the last level, whose parent's shift is 0, it is not
    expected to be a node. We can just leverage the xa_is_node() check to
    break the loop instead of check shift additionally.

    Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
    ---
    lib/xarray.c | 2 --
    1 file changed, 2 deletions(-)

    diff --git a/lib/xarray.c b/lib/xarray.c
    index e08a0388a156..0c5b44def3aa 100644
    --- a/lib/xarray.c
    +++ b/lib/xarray.c
    @@ -238,8 +238,6 @@ void *xas_load(struct xa_state *xas)
    if (xas->xa_shift > node->shift)
    break;
    entry = xas_descend(xas, node);
    - if (node->shift == 0)
    - break;
    }
    return entry;
    }
    --
    2.23.0
    \
     
     \ /
      Last update: 2020-03-30 14:38    [W:4.027 / U:0.040 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site