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 7/9] XArray: the NULL xa_node condition is handled in xas_top
Date
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(-)

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) {
--
2.23.0
\
 
 \ /
  Last update: 2020-03-30 14:38    [W:0.212 / U:1.948 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site