Skip to content

Commit

Permalink
selftests/mm: fix WARNING comparing pointer to 0
Browse files Browse the repository at this point in the history
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

Link: https://lkml.kernel.org/r/20230817160033.90079-1-tuananhlfc@gmail.com
Signed-off-by: Anh Tuan Phan <tuananhlfc@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Anh Tuan Phan authored and Andrew Morton committed Aug 24, 2023
1 parent 7131fd7 commit bad5a3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/mm/map_populate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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()");
Expand Down

0 comments on commit bad5a3a

Please sign in to comment.