Messages in this thread Patch in this message | | | From | Wei Yang <> | Subject | [PATCH 5/9] XArray: entry in last level is not expected to be a node | Date | Mon, 30 Mar 2020 12:36:39 +0000 |
| |
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
| |