xarray-port-tests-to-kunit-fix

Fix cocci warning:

lib/test_xarray.c:1019:52-53: WARNING comparing pointer to 0

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202412081700.YXB3vBbg-lkp@intel.com/
Cc: Tamir Duberstein <tamird@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Andrew Morton 2024-12-09 19:06:54 -08:00
parent 1c11b09ea0
commit 2616a8828b

View File

@ -1016,7 +1016,7 @@ static noinline void check_xa_alloc_1(struct kunit *test, struct xarray *xa, uns
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(test, xa, 3);