summaryrefslogtreecommitdiffstats
path: root/lib/xarray.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2020-02-27 13:37:40 +0100
committerMatthew Wilcox (Oracle) <willy@infradead.org>2020-02-27 13:37:40 +0100
commitd8e93e3f22d9fd2e6a3ccae3623c3af8789ccfc0 (patch)
treee125224c51ccab31358311660a79f176175edf2f /lib/xarray.c
parentida: remove abandoned macros (diff)
downloadlinux-d8e93e3f22d9fd2e6a3ccae3623c3af8789ccfc0.tar.xz
linux-d8e93e3f22d9fd2e6a3ccae3623c3af8789ccfc0.zip
XArray: Optimise xas_sibling() if !CONFIG_XARRAY_MULTI
If CONFIG_XARRAY_MULTI is disabled, then xas_sibling() must be false. Reported-by: JaeJoon Jung <rgbi3307@gmail.com> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Diffstat (limited to 'lib/xarray.c')
-rw-r--r--lib/xarray.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/xarray.c b/lib/xarray.c
index 05324cf571f4..f448bcd263ac 100644
--- a/lib/xarray.c
+++ b/lib/xarray.c
@@ -1836,7 +1836,7 @@ static bool xas_sibling(struct xa_state *xas)
struct xa_node *node = xas->xa_node;
unsigned long mask;
- if (!node)
+ if (!IS_ENABLED(CONFIG_XARRAY_MULTI) || !node)
return false;
mask = (XA_CHUNK_SIZE << node->shift) - 1;
return (xas->xa_index & mask) >