* [PATCH v1] selftests/mm: Fix WARNING comparing pointer to 0
@ 2023-08-17 16:00 Anh Tuan Phan
0 siblings, 0 replies; only message in thread
From: Anh Tuan Phan @ 2023-08-17 16:00 UTC (permalink / raw)
To: akpm, shuah
Cc: Anh Tuan Phan, linux-mm, linux-kselftest, linux-kernel-mentees
Remove comparing pointer to 0 to avoid this warning from coccinelle:
./tools/testing/selftests/mm/map_populate.c:80:16-17: WARNING comparing pointer to 0, suggest !E
./tools/testing/selftests/mm/map_populate.c:80:16-17: WARNING comparing pointer to 0
Signed-off-by: Anh Tuan Phan <tuananhlfc@gmail.com>
---
tools/testing/selftests/mm/map_populate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/mm/map_populate.c b/tools/testing/selftests/mm/map_populate.c
index 240f2d9dae7a..7945d0754875 100644
--- a/tools/testing/selftests/mm/map_populate.c
+++ b/tools/testing/selftests/mm/map_populate.c
@@ -77,7 +77,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()");
--
2.34.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-08-17 16:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-17 16:00 [PATCH v1] selftests/mm: Fix WARNING comparing pointer to 0 Anh Tuan Phan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).