Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/mm: don't compare return values to in cow

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.

Link: https://lkml.kernel.org/r/20250610-selftest-mm-cow-tweaks-v1-3-43cd7457500f@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Suggested-by: David Hildenbrand <david@redhat.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Mark Brown and committed by
Andrew Morton
32dc2d5e 5fbfb1f3

+3 -3
+3 -3
tools/testing/selftests/mm/cow.c
··· 1613 1613 smem = (char *)(((uintptr_t)mmap_smem + pmdsize) & ~(pmdsize - 1)); 1614 1614 1615 1615 ret = madvise(mem, pmdsize, MADV_HUGEPAGE); 1616 - if (ret != 0) { 1616 + if (ret) { 1617 1617 ksft_perror("madvise()"); 1618 1618 log_test_result(KSFT_FAIL); 1619 1619 goto munmap; 1620 1620 } 1621 - ret |= madvise(smem, pmdsize, MADV_HUGEPAGE); 1622 - if (ret != 0) { 1621 + ret = madvise(smem, pmdsize, MADV_HUGEPAGE); 1622 + if (ret) { 1623 1623 ksft_perror("madvise()"); 1624 1624 log_test_result(KSFT_FAIL); 1625 1625 goto munmap;