From patchwork Wed Apr 24 17:24:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 13642247 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92240C10F15 for ; Wed, 24 Apr 2024 17:24:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2184F8D0026; Wed, 24 Apr 2024 13:24:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C92D8D001F; Wed, 24 Apr 2024 13:24:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 090798D0026; Wed, 24 Apr 2024 13:24:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id DFABD8D001F for ; Wed, 24 Apr 2024 13:24:57 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 9D6BF1C0620 for ; Wed, 24 Apr 2024 17:24:57 +0000 (UTC) X-FDA: 82045100634.18.02E4BE2 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf16.hostedemail.com (Postfix) with ESMTP id ACDD4180025 for ; Wed, 24 Apr 2024 17:24:54 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=tjD7nKIH; spf=pass (imf16.hostedemail.com: domain of nathan@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=nathan@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713979495; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=UjqRMqoDD6a9yJ0/cEBiqPKlU7zwkGkh6hlZYq1iql0=; b=OH5lx3J86o8SPlH29FcA2UyQOMP5lZ4Hixqlf5a3pD3FMdrDpboNj8h4ZxQ8y7DY10/B7W dAtHt5SF00+9wSem6Vs4+QtAzsAV1gBKN87epPFeWJT3hNYHP50LzIN0cpV/zS3l8hfJyP iRdBByaC863tCAqx5mM6gKQNFP9hOBM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713979495; a=rsa-sha256; cv=none; b=qpUxyb6FPpFdPIGRLvCbe305tdY4aH/v1xdAXyieKDVRJkhDAbm7kd2ysHgwhvGPjPmOa5 IVcg3C2wogjOQkguDUfqeoLqeZQ7hT29aKs2eAe0SYOrWWEr0eWiQM5WvVjwegX2XNqIuC G+Jn9Bl/7jzO9V601n+Du/NEpyPvZNE= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=tjD7nKIH; spf=pass (imf16.hostedemail.com: domain of nathan@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=nathan@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 27942CE1814; Wed, 24 Apr 2024 17:24:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4576BC4AF0F; Wed, 24 Apr 2024 17:24:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713979489; bh=GWpSfOZS2K51RIY5HOOiuGLu67UwmCDp9SYGDLDiQp4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=tjD7nKIHVmBOV3N5MSCSCjPY+RbJgOA7wKENGoAnKqQ4P415hy1U2lj6EjGgRf9wa KBufw4uZKfrb7T2BZ7v6RUq92GchH3l6yCVNdghNtPvBCi6WqwCbH8kkGU1MDzx1Sp Pe1ZZJNxPOG262JqBhdUlh2dFwZBz20MeAVXZINXrjKH6d10/VZ0b+vcKH2pTKBvgM JN/OymHrQYtqfLy/4SnFDi3f5oMQCFq91E0D13512HcAaHGHD+2nicb3KENxb4IJGL IJ48HdL2rU4VFsuPJTUUIlTN5ZqP3XkZIOrwmEFM7RxY6zboVQE1mSxMYILvXmFJch z+gLzmF8KfNtg== From: Nathan Chancellor Date: Wed, 24 Apr 2024 10:24:07 -0700 Subject: [PATCH v2 04/10] selftests/mm: ksft_exit functions do not return MIME-Version: 1.0 Message-Id: <20240424-ksft-exit-int-to-void-v2-4-c35f3b8c9ca0@kernel.org> References: <20240424-ksft-exit-int-to-void-v2-0-c35f3b8c9ca0@kernel.org> In-Reply-To: <20240424-ksft-exit-int-to-void-v2-0-c35f3b8c9ca0@kernel.org> To: shuah@kernel.org Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Muhammad Usama Anjum , Thomas Gleixner , Nathan Chancellor , akpm@linux-foundation.org, linux-mm@kvack.org X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=5922; i=nathan@kernel.org; h=from:subject:message-id; bh=GWpSfOZS2K51RIY5HOOiuGLu67UwmCDp9SYGDLDiQp4=; b=owGbwMvMwCUmm602sfCA1DTG02pJDGmaDrHdSRfSpIslJsW+bnT3PP9x327Gw8XK0gmTll1ad 1dt4YmyjlIWBjEuBlkxRZbqx6rHDQ3nnGW8cWoSzBxWJpAhDFycAjCR9d8YGTZKXH7y9Drf2408 D8z3mNifCD2+pf6gbHjPdM4CC6F+Vn5Ghgd3esNbxVZ2aJ7beGLJ4Z0PQ7lWPXs7h03sb1369ea J3owA X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: ACDD4180025 X-Rspam-User: X-Stat-Signature: mo5okt55yiuaffksregpfxdmj7auaift X-HE-Tag: 1713979494-358946 X-HE-Meta: U2FsdGVkX19Ug7XSVsDY9U7F/7qswiM5i4WlfeLjOkvp072D1gkD/L23ew2i/dyP5rje7277rnoXsAvJxBCxb8k4HOfdoU8RdFWWOX+FbJOApSO1qqIElt6ICcu5R9qHoGwgZk2rxnbhoaxU+aetgEbX8WWAAgtXRdUVDzxDdAEgU3K4m3dKFq26zi+MpTWR1yl1YvIoPN7FHqHu7V/zPELLVU+bgKnkpe2Ft1VdweQes54D0GxiRnpvijdKX1FnYeyVpNx5axdNyzQnwOZeHW0/c8lhc1nOBxKj3VwavqeXF9lp0Jp3JIumkpSi8CsTbv1nEc9in/2ijcFfbx/FmALSX4KYhZHc9z72tsaTd9+wE8OvZHGRxbzU52wyVr1pPV2KcNO3dzXHnuSQcWLXe+oYlOrwitUKJj5p/oBAPO+F02fQ3eIlO+g/jPfC6rfrh6dU+lSJbO+GJzfx6L55h9JXIRHc2GoMUnuCcogrSBROn3L00EmkSQmk2LU4xktuH4PCPcK1wQ9FgXGUJJ+I7L+/PfbjkXbEho8CHDM0qXhlgfsRZhFDFKPNceAchxf+D6VJxkzwo2RbJmW6iYTn3PnlR0+wve/KeQlktolmcvnK71o1837+u/BvFCqLBs/I0nzxGjftuM6vllXjNSAsmHsBF6EuH23sLo6UpLDVa8WzE6K5d6a99AmQwm4SjzZDK9II8hvrlAdAx0qq5/iwcOLfwaqgszwk4etttCJAZtBMHmFFMXfr6n5sJfFzPiOVvoglxb7NftofpIjkLp9ZXGHV2ygJsryC7PEaD6BAxQrR575P6OklSqrUFVxYx1ZET/rZbbAnSo/1lGB90XcRl5yZVKZxWiqvY526H98SJ0nomhxsfN55h/Dqa4rdMjuVZXFUkHHzgm0gq/1aR75EI9ohAkTs5LjzONZQezGNn/pmQmdCWPzwSJzs///LACskMYUQSYe3yzdIMwHQ74g Qfca7zaC yt9soF8Aildpixj+dMaiSoQ9uZ4+KczSQoPKoKlEitvRTMCGEPZCQ0oenCehth53NVcn2cwBPyQ/kJObCU739kY/HCObTBJxi7UnQ6YAIKEoie4Sy0VZrEh+XCNfA6EBqq+/0ZRXIvJVJ3ynhIt5k9z9nvOSsGZ0QXa89EbLUzWaM0z3VD9I+qDo49Q4/pYSTIDGmmANFadxLtL4OTYMHbPzym3zMtVF76lszxntgCMYlNjwDollNFROp0i6iLQJQeSm2fUz35Gi0D047c5De5NTy0MrR7XOt+U6d3jV5GglhGfkAs4FOrkFmerpknGIGMggVk3qxW2bYDA6/3zArrHKuJd2G7hp3+vUbXp4aTdbCN170wNhQnS2HYku8J+hL+1NRUu/ysKd16tEqX7gn2LII3IomaH+CcD6qUs3GQWtdq/bPgZmS5rNfrtKWLtiptHkshaEIl2KWOkMusQSwEZhrhA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000004, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: After commit f7d5bcd35d42 ("selftests: kselftest: Mark functions that unconditionally call exit() as __noreturn"), ksft_exit_...() functions are marked as __noreturn, which means the return type should not be 'int' but 'void' because they are not returning anything (and never were since exit() has always been called). To facilitate updating the return type of these functions, remove 'return' before the calls to ksft_exit_...(), as __noreturn prevents the compiler from warning that a caller of the ksft_exit functions does not return a value because the program will terminate upon calling these functions. Reviewed-by: Muhammad Usama Anjum Reviewed-by: Thomas Gleixner Signed-off-by: Nathan Chancellor --- Cc: akpm@linux-foundation.org Cc: linux-mm@kvack.org --- tools/testing/selftests/mm/compaction_test.c | 6 +++--- tools/testing/selftests/mm/cow.c | 2 +- tools/testing/selftests/mm/gup_longterm.c | 2 +- tools/testing/selftests/mm/gup_test.c | 4 ++-- tools/testing/selftests/mm/ksm_functional_tests.c | 2 +- tools/testing/selftests/mm/madv_populate.c | 2 +- tools/testing/selftests/mm/mkdirty.c | 2 +- tools/testing/selftests/mm/pagemap_ioctl.c | 4 ++-- tools/testing/selftests/mm/soft-dirty.c | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/testing/selftests/mm/compaction_test.c b/tools/testing/selftests/mm/compaction_test.c index 533999b6c284..4f42eb7d7636 100644 --- a/tools/testing/selftests/mm/compaction_test.c +++ b/tools/testing/selftests/mm/compaction_test.c @@ -177,7 +177,7 @@ int main(int argc, char **argv) ksft_print_header(); if (prereq() || geteuid()) - return ksft_exit_skip("Prerequisites unsatisfied\n"); + ksft_exit_skip("Prerequisites unsatisfied\n"); ksft_set_plan(1); @@ -225,7 +225,7 @@ int main(int argc, char **argv) } if (check_compaction(mem_free, hugepage_size) == 0) - return ksft_exit_pass(); + ksft_exit_pass(); - return ksft_exit_fail(); + ksft_exit_fail(); } diff --git a/tools/testing/selftests/mm/cow.c b/tools/testing/selftests/mm/cow.c index 363bf5f801be..fe078d6e1806 100644 --- a/tools/testing/selftests/mm/cow.c +++ b/tools/testing/selftests/mm/cow.c @@ -1779,5 +1779,5 @@ int main(int argc, char **argv) if (err) ksft_exit_fail_msg("%d out of %d tests failed\n", err, ksft_test_num()); - return ksft_exit_pass(); + ksft_exit_pass(); } diff --git a/tools/testing/selftests/mm/gup_longterm.c b/tools/testing/selftests/mm/gup_longterm.c index ad168d35b23b..d7eaca5bbe9b 100644 --- a/tools/testing/selftests/mm/gup_longterm.c +++ b/tools/testing/selftests/mm/gup_longterm.c @@ -456,5 +456,5 @@ int main(int argc, char **argv) if (err) ksft_exit_fail_msg("%d out of %d tests failed\n", err, ksft_test_num()); - return ksft_exit_pass(); + ksft_exit_pass(); } diff --git a/tools/testing/selftests/mm/gup_test.c b/tools/testing/selftests/mm/gup_test.c index 18a49c70d4c6..bd335cf9bc0e 100644 --- a/tools/testing/selftests/mm/gup_test.c +++ b/tools/testing/selftests/mm/gup_test.c @@ -228,7 +228,7 @@ int main(int argc, char **argv) break; } ksft_test_result_skip("Please run this test as root\n"); - return ksft_exit_pass(); + ksft_exit_pass(); } p = mmap(NULL, size, PROT_READ | PROT_WRITE, flags, filed, 0); @@ -267,5 +267,5 @@ int main(int argc, char **argv) free(tid); - return ksft_exit_pass(); + ksft_exit_pass(); } diff --git a/tools/testing/selftests/mm/ksm_functional_tests.c b/tools/testing/selftests/mm/ksm_functional_tests.c index d615767e396b..508287560c45 100644 --- a/tools/testing/selftests/mm/ksm_functional_tests.c +++ b/tools/testing/selftests/mm/ksm_functional_tests.c @@ -646,5 +646,5 @@ int main(int argc, char **argv) if (err) ksft_exit_fail_msg("%d out of %d tests failed\n", err, ksft_test_num()); - return ksft_exit_pass(); + ksft_exit_pass(); } diff --git a/tools/testing/selftests/mm/madv_populate.c b/tools/testing/selftests/mm/madv_populate.c index 17bcb07f19f3..ef7d911da13e 100644 --- a/tools/testing/selftests/mm/madv_populate.c +++ b/tools/testing/selftests/mm/madv_populate.c @@ -307,5 +307,5 @@ int main(int argc, char **argv) if (err) ksft_exit_fail_msg("%d out of %d tests failed\n", err, ksft_test_num()); - return ksft_exit_pass(); + ksft_exit_pass(); } diff --git a/tools/testing/selftests/mm/mkdirty.c b/tools/testing/selftests/mm/mkdirty.c index 301abb99e027..b8a7efe9204e 100644 --- a/tools/testing/selftests/mm/mkdirty.c +++ b/tools/testing/selftests/mm/mkdirty.c @@ -375,5 +375,5 @@ int main(void) if (err) ksft_exit_fail_msg("%d out of %d tests failed\n", err, ksft_test_num()); - return ksft_exit_pass(); + ksft_exit_pass(); } diff --git a/tools/testing/selftests/mm/pagemap_ioctl.c b/tools/testing/selftests/mm/pagemap_ioctl.c index d59517ed3d48..2d785aca72a5 100644 --- a/tools/testing/selftests/mm/pagemap_ioctl.c +++ b/tools/testing/selftests/mm/pagemap_ioctl.c @@ -1484,7 +1484,7 @@ int main(int argc, char *argv[]) ksft_print_header(); if (init_uffd()) - return ksft_exit_pass(); + ksft_exit_pass(); ksft_set_plan(115); @@ -1660,5 +1660,5 @@ int main(int argc, char *argv[]) userfaultfd_tests(); close(pagemap_fd); - return ksft_exit_pass(); + ksft_exit_pass(); } diff --git a/tools/testing/selftests/mm/soft-dirty.c b/tools/testing/selftests/mm/soft-dirty.c index 7dbfa53d93a0..d9dbf879748b 100644 --- a/tools/testing/selftests/mm/soft-dirty.c +++ b/tools/testing/selftests/mm/soft-dirty.c @@ -209,5 +209,5 @@ int main(int argc, char **argv) close(pagemap_fd); - return ksft_exit_pass(); + ksft_exit_pass(); }