[PATCH] XArray: Fix warning comparing pointer to 0

Haowen Bai posted 1 patch 4 years, 3 months ago
lib/test_xarray.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] XArray: Fix warning comparing pointer to 0
Posted by Haowen Bai 4 years, 3 months ago
Avoid pointer type value compared with 0 to make code clear.

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
---
 lib/test_xarray.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/test_xarray.c b/lib/test_xarray.c
index 8b1c318..d3fa5d9 100644
--- a/lib/test_xarray.c
+++ b/lib/test_xarray.c
@@ -742,7 +742,7 @@ static noinline void check_xa_alloc_1(struct xarray *xa, unsigned int base)
 
 	XA_BUG_ON(xa, xa_alloc(xa, &id, xa_mk_index(10), XA_LIMIT(10, 5),
 				GFP_KERNEL) != -EBUSY);
-	XA_BUG_ON(xa, xa_store_index(xa, 3, GFP_KERNEL) != 0);
+	XA_BUG_ON(xa, xa_store_index(xa, 3, GFP_KERNEL) != NULL);
 	XA_BUG_ON(xa, xa_alloc(xa, &id, xa_mk_index(10), XA_LIMIT(10, 5),
 				GFP_KERNEL) != -EBUSY);
 	xa_erase_index(xa, 3);
-- 
2.7.4