Tweak the coding style for checking for non-zero return values.
While we're at it also remove a now redundant oring of the madvise()
return code.

Suggested-by: David Hildenbrand <da...@redhat.com>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 tools/testing/selftests/mm/cow.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/mm/cow.c b/tools/testing/selftests/mm/cow.c
index ff80329313e4..48fcf03aa4cd 100644
--- a/tools/testing/selftests/mm/cow.c
+++ b/tools/testing/selftests/mm/cow.c
@@ -1613,13 +1613,13 @@ static void run_with_huge_zeropage(non_anon_test_fn fn, 
const char *desc)
        smem = (char *)(((uintptr_t)mmap_smem + pmdsize) & ~(pmdsize - 1));
 
        ret = madvise(mem, pmdsize, MADV_HUGEPAGE);
-       if (ret != 0) {
+       if (ret) {
                ksft_perror("madvise()");
                log_test_result(KSFT_FAIL);
                goto munmap;
        }
-       ret |= madvise(smem, pmdsize, MADV_HUGEPAGE);
-       if (ret != 0) {
+       ret = madvise(smem, pmdsize, MADV_HUGEPAGE);
+       if (ret) {
                ksft_perror("madvise()");
                log_test_result(KSFT_FAIL);
                goto munmap;

-- 
2.39.5


Reply via email to