Skip to contentSkip to conversation

tools/testing/selftests/vm/: fix warning comparing pointer to 0

PATCH New Jiapeng Chong 1 participant 1 message Mar 15, 2021 Kselftest

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/testing/selftests/vm/: fix warning comparing pointer to 0

Fix the following coccicheck warning:

./tools/testing/selftests/vm/map_populate.c:82:16-17: WARNING comparing pointer to 0.

---
 tools/testing/selftests/vm/map_populate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/vm/map_populate.c +1 -1
index 6b8aeaa..fb11b9e 100644
@@ -79,7 +79,7 @@ int main(int argc, char **argv)
 	unsigned long *smap;
 
 	ftmp = tmpfile();
-	BUG_ON(ftmp == 0, "tmpfile()");
+	BUG_ON(!ftmp, "tmpfile()");
 
 	ret = ftruncate(fileno(ftmp), MMAP_SZ);
 	BUG_ON(ret, "ftruncate()");
Signature · 1 line
1.8.3.1