Message ID | 20200330123643.17120-8-richard.weiyang@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | XArray: several cleanups | expand |
diff --git a/lib/xarray.c b/lib/xarray.c index 0c5b44def3aa..82570bbbf2a5 100644 --- a/lib/xarray.c +++ b/lib/xarray.c @@ -650,16 +650,12 @@ static void *xas_create(struct xa_state *xas, bool allow_root) slot = &xa->xa_head; } else if (xas_error(xas)) { return NULL; - } else if (node) { + } else { unsigned int offset = xas->xa_offset; shift = node->shift; entry = xa_entry_locked(xa, node, offset); slot = &node->slots[offset]; - } else { - shift = 0; - entry = xa_head_locked(xa); - slot = &xa->xa_head; } while (shift > order) {
From the last if/else check, it handles the NULL/non-NULL xa_node mutually exclusively. While the NULL xa_node case is handled in the first condition xas_top(). Just remove the redundant handling for NULL xa_node. Signed-off-by: Wei Yang <richard.weiyang@gmail.com> --- lib/xarray.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)