There is a warning reported by coccinelle:
./tools/testing/selftests/cgroup/test_zswap.c:211:6-18: WARNING: Unsigned expression compared with zero: stored_pages < 0
The type of "stored_pages" is size_t, which always be an unsigned type, so it is impossible less than zero. Drop the if statements to silence the warning.
Signed-off-by: Li Zetao lizetao1@huawei.com --- tools/testing/selftests/cgroup/test_zswap.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/tools/testing/selftests/cgroup/test_zswap.c b/tools/testing/selftests/cgroup/test_zswap.c index 49def87a909b..dbad8d0cd090 100644 --- a/tools/testing/selftests/cgroup/test_zswap.c +++ b/tools/testing/selftests/cgroup/test_zswap.c @@ -208,8 +208,6 @@ static int test_no_kmem_bypass(const char *root) free(trigger_allocation); if (get_zswap_stored_pages(&stored_pages)) break; - if (stored_pages < 0) - break; /* If memory was pushed to zswap, verify it belongs to memcg */ if (stored_pages > stored_pages_threshold) { int zswapped = cg_read_key_long(test_group, "memory.stat", "zswapped ");