lkml.org 
[lkml]   [2021]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] XArray: fix comparing pointer to 0
Date
Compare pointer-typed values to NULL rather than 0.

Signed-off-by: Yihao Han <hanyihao@vivo.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 d10cb0182654..0c366e88d884 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.17.1
\
 
 \ /
  Last update: 2021-12-06 04:33    [W:0.032 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site