summaryrefslogtreecommitdiff
path: root/include/linux/xarray.h
diff options
context:
space:
mode:
authorMaxime Ripard <maxime@cerno.tech>2020-04-14 10:19:50 +0300
committerMaxime Ripard <maxime@cerno.tech>2020-04-14 10:19:50 +0300
commita4721ced760684d1776bf31f7925aa41bb3f4846 (patch)
treea76e23b60ecceed68b5fa4904f677fe20e304b6e /include/linux/xarray.h
parent83a196773b8bc6702f49df1eddc848180e350340 (diff)
parent8f3d9f354286745c751374f5f1fcafee6b3f3136 (diff)
downloadlinux-a4721ced760684d1776bf31f7925aa41bb3f4846.tar.xz
Merge v5.7-rc1 into drm-misc-fixes
Start the new drm-misc-fixes cycle. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Diffstat (limited to 'include/linux/xarray.h')
-rw-r--r--include/linux/xarray.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/linux/xarray.h b/include/linux/xarray.h
index f73e1775ded0..14c893433139 100644
--- a/include/linux/xarray.h
+++ b/include/linux/xarray.h
@@ -32,8 +32,8 @@
* The following internal entries have a special meaning:
*
* 0-62: Sibling entries
- * 256: Zero entry
- * 257: Retry entry
+ * 256: Retry entry
+ * 257: Zero entry
*
* Errors are also represented as internal entries, but use the negative
* space (-4094 to -2). They're never stored in the slots array; only
@@ -1648,6 +1648,7 @@ static inline void *xas_next_marked(struct xa_state *xas, unsigned long max,
xa_mark_t mark)
{
struct xa_node *node = xas->xa_node;
+ void *entry;
unsigned int offset;
if (unlikely(xas_not_node(node) || node->shift))
@@ -1659,7 +1660,10 @@ static inline void *xas_next_marked(struct xa_state *xas, unsigned long max,
return NULL;
if (offset == XA_CHUNK_SIZE)
return xas_find_marked(xas, max, mark);
- return xa_entry(xas->xa, node, offset);
+ entry = xa_entry(xas->xa, node, offset);
+ if (!entry)
+ return xas_find_marked(xas, max, mark);
+ return entry;
}
/*