Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp576613lqd; Wed, 24 Apr 2024 10:27:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU9S9ekqj2I8TfjVkTSxgV47Fz6NJPK4EhHtqIU9JgGIzWyK573dGwQYFDR+NfU6EgAHQfW62DIjsBekmTw2EYdjWVvJVylyoeV79cXug== X-Google-Smtp-Source: AGHT+IF0/FXH5cGELo2UrIrF1CRFz6IYx6JNJf14jOnxS8ErB+iO+KJcyCKSJI6icmO/RXlra8fE X-Received: by 2002:a17:90a:f18c:b0:2a2:775:9830 with SMTP id bv12-20020a17090af18c00b002a207759830mr1649387pjb.11.1713979647778; Wed, 24 Apr 2024 10:27:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713979647; cv=pass; d=google.com; s=arc-20160816; b=LqSJyTmMHn8nYNMroT5ZC910GfEf65zv0SvftOwCmMep5T+rMlWcdO6fAUOy0yZGfd cAnscs291kDIk0coCLel9ZPJXGemTCNpAq/1a3zN1X71MtlUqwW5wuvQbJ1U+pjubF+T 5pclIXEfs2L/5V9PXhq3Ik8j2ZGXkRM1vSgZq4tTt/yC2YBQ92fok0DMn/KP4t51C5oG fO1SDf77N2iyifroagbJdsFZALUUyu9w6tE7yDlWA3Mmq1S9n094/Z8v+m5NETv/YFPA FxyhN6DULopNPodQlpk9ut0mRFO+URLY52YwbeDctIBvYUCNhRtmGfdX2dEbps29oOym GpXw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=oMFLU0xS+djOOoxirtHVPG2VvT7ugN5SMXT9x3G+tPg=; fh=ONcWLRte6g1WmGCJl0cxuwrbqMc0ygXVa9Ipo83fDfs=; b=h8cPntz7LiO3WvmaMvcYRtBJPoAc6d+qEjo3lSwTtCDvGcIvG25bTH6X5rw2ya56XT zqyRtdmfBs8wZIbBQz4K5jFFxB1eY4Jb+1u3pwAidR/mnZKlMNjoqFPWmHKblBvDUU1P 7bcTYWQt9fNBaRsLojj4b7xbsMVVkNaPLTVRm5NGxm33Y8JyZAoVUVm5153ujZgMdDcr OoEytvrL013viZglLu3HEvjDqlVenQFdNSIqXhwIHqjRn+uemYjtGH/mOGWUzsOLiDWW 67SbFrSSebENcfrHajOLI/PBrbG4sPJP3JaPgsp7FI7Rp/MQjriEGj0dpxVed3JTYgsG xxkw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Wf7uOyy7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-157395-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157395-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id m10-20020a17090ade0a00b002abf98da692si10998112pjv.70.2024.04.24.10.27.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 10:27:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157395-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Wf7uOyy7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-157395-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157395-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2AB0928A300 for ; Wed, 24 Apr 2024 17:26:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A7DD716F0F6; Wed, 24 Apr 2024 17:24:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Wf7uOyy7" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96F7F16EC1C; Wed, 24 Apr 2024 17:24:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713979493; cv=none; b=F0sLoktt2ZqJHpQaH4FEYR2BSvzyTpwGhsOtXiCfhrenRVdyeT84hSCNDmCM8YpWLfzRPOLLi3U0nb4r7HxMpXiAue5QoJBKdP0bvfo9mc6F2s+pBQG5durRSltWUZvrKQKSsBgLzzqJ2oFgEYbkixO7iTi3s564ArUkcwHuS0g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713979493; c=relaxed/simple; bh=jLnC6a51kXShlJw2qowP2td/Td80RuzryZnAn9alooQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PtR0Em4oSWwabzR03W2Vc6Nbvh6S/pWMLAgYhgIkk62vbpW6ni1DqktMFfPIHdDCOSvvDsVzKtxoXfwyS/BVcrmtMxicmu/jdNe36vap4ntfx5tfmG7SLvvMqfGy4MgYxuZdeW10CAAo8oDw/Sht8USfk+7bA9MabTam/Psj7kg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Wf7uOyy7; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D51EDC32782; Wed, 24 Apr 2024 17:24:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713979493; bh=jLnC6a51kXShlJw2qowP2td/Td80RuzryZnAn9alooQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Wf7uOyy7k7KnS1BWaCftOUBBDmNwEqjDxrD2bRGq3sqLpzDu66SEp5QzmNLVwpTfl OQi/YyWlbrexteK+VwwTWbS+Ql6xMP2+EppRESjhdm+l1zetkgi2iFI9M2bN2e2fsr ZOP8yleTVnYvzSAH8P/nYu1vKN4IrBOx8vFQkItBnmkBFZe4GqyLxiCSz8Quaa6sWI TJxpuFsK5jZEc0UKyk5AQj9dUwVktSLP6AbXRU9ojT7de7xQMYfAci/kCK49jSM9LD 6Qh5hK5KH4bprzAA26LROwUBWSFES6E1kuYrAAa07juuWXrSUMcZLq8zRScznC4iUx fjnFNIGqHplHQ== From: Nathan Chancellor Date: Wed, 24 Apr 2024 10:24:13 -0700 Subject: [PATCH v2 10/10] selftests: kselftest: Make ksft_exit functions return void instead of int Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240424-ksft-exit-int-to-void-v2-10-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 X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=2619; i=nathan@kernel.org; h=from:subject:message-id; bh=jLnC6a51kXShlJw2qowP2td/Td80RuzryZnAn9alooQ=; b=owGbwMvMwCUmm602sfCA1DTG02pJDGmaDnFWTGLpkbE/c97N0rukZGv/etKc3Z+DTyzmXBC/o SJY+y1LRykLgxgXg6yYIkv1Y9XjhoZzzjLeODUJZg4rE8gQBi5OAZjIwWeMDB3WvA8+tyje8Kl5 sNpY9XCeYkFjzsOOvcZ8S97P+KBy+w8jw5/IzW9n3mxau0d7Gouv689JYUsUt62XZE98/2x1fYK DMxsA X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 Commit f7d5bcd35d42 ("selftests: kselftest: Mark functions that unconditionally call exit() as __noreturn") marked functions that call exit() as __noreturn but it did not change the return type of these functions from 'void' to 'int' like it should have (since a noreturn function by definition cannot return an integer because it does not return...) because there were many tests that return the result of the ksft_exit functions, even though it has never been used due to calling exit(). Now that all uses of 'return ksft_exit...()' have been cleaned up properly, change the types of the ksft_exit...() functions to void to match their __noreturn nature. Reviewed-by: Muhammad Usama Anjum Reviewed-by: Thomas Gleixner Signed-off-by: Nathan Chancellor --- tools/testing/selftests/kselftest.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h index 9bb1664bcf95..f4221691a7da 100644 --- a/tools/testing/selftests/kselftest.h +++ b/tools/testing/selftests/kselftest.h @@ -327,13 +327,13 @@ void ksft_test_result_code(int exit_code, const char *test_name, break; \ } } while (0) -static inline __noreturn int ksft_exit_pass(void) +static inline __noreturn void ksft_exit_pass(void) { ksft_print_cnts(); exit(KSFT_PASS); } -static inline __noreturn int ksft_exit_fail(void) +static inline __noreturn void ksft_exit_fail(void) { ksft_print_cnts(); exit(KSFT_FAIL); @@ -360,7 +360,7 @@ static inline __noreturn int ksft_exit_fail(void) ksft_cnt.ksft_xfail + \ ksft_cnt.ksft_xskip) -static inline __noreturn __printf(1, 2) int ksft_exit_fail_msg(const char *msg, ...) +static inline __noreturn __printf(1, 2) void ksft_exit_fail_msg(const char *msg, ...) { int saved_errno = errno; va_list args; @@ -388,19 +388,19 @@ static inline __noreturn void ksft_exit_fail_perror(const char *msg) #endif } -static inline __noreturn int ksft_exit_xfail(void) +static inline __noreturn void ksft_exit_xfail(void) { ksft_print_cnts(); exit(KSFT_XFAIL); } -static inline __noreturn int ksft_exit_xpass(void) +static inline __noreturn void ksft_exit_xpass(void) { ksft_print_cnts(); exit(KSFT_XPASS); } -static inline __noreturn __printf(1, 2) int ksft_exit_skip(const char *msg, ...) +static inline __noreturn __printf(1, 2) void ksft_exit_skip(const char *msg, ...) { int saved_errno = errno; va_list args; -- 2.44.0