Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp575195lqd; Wed, 24 Apr 2024 10:25:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVkrM+eTAJwYxkltKhEwJUkFFwUxYcK5v8Zd6AJYchyry4GXX1WA7DvQHnPOmSi81peJpWUht1TU5c40o2cD/bNGKi3UIBOpySaEB883Q== X-Google-Smtp-Source: AGHT+IGYyW3uVdLy1j0dKA5oSUuntAV0S0HTDRdru0yzJwIUXggoMyqwd+85chTjGypHtKkCtAiT X-Received: by 2002:a0c:fcd1:0:b0:6a0:54da:b7ca with SMTP id i17-20020a0cfcd1000000b006a054dab7camr3079650qvq.36.1713979500501; Wed, 24 Apr 2024 10:25:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713979500; cv=pass; d=google.com; s=arc-20160816; b=OBqkuFw4gZdAAKiQdqvY32R2NJW2CXNbV++zw0wAjenURSvPKwEO5+YT+63z3zostR WUmM6kZSTqjNwifj8BwUbylOhNeBE4Do5gc94eyp8u0/TJS5g19ZlnUG8fKwDTyk22FV W7Cv15rBY4mbnoRUtW35BTbsVY9TOSgBBDrnO+eXI1E2nvX4YE8W6FGz5nz2Jb6Rge57 agC2dDONYT5zew4uT5ci7qXSlUoxg97n3SKs3uZVOhhv0FTKyN+iInTuHAss6XcHIJMG TJvXOjYkfhAWf9OkcZL2KiLVL/yuj5uq/sjRbLMf0buEqaxHlrXREakyLJO3G1/rMdi6 OdQg== 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=t6ib9oZ4bT0BkQfOKwayFCviq1zcgLUzcDPYjksdZp8=; fh=oX/LSscMk0tg9dDGVUUr0iHwnLMMvSYsGzDPmwkd31Y=; b=W/jTbheQ7558Ji4KsaswKMFcKsYIV6gvD4TCsbROMHkhSMEQDWWXI2R+40WydUaW/i dlCwqRn/6xrbBN3iQ1t/Jdt5KFjnF4Bul/sQ5NDyTne8w608wQ/7087c7LKCWdW5jzB5 L/9VuHLLGrfMTCe+7iZuyISZAKiKvwLNbr8uQBg50fs9/BtdKu6a+d3YyWXeikUKgwNM I5zksZaEOAFL8/5VekrMVrCF76h7PHFNDcBRsjAlLwnwZbXHxt8tzt9DidQvR1E1dDkK UpH1rZ3wYfiUhpmk8E8lku4wIEqud2e5oQpIgeYQohrbOfxqTjdHXwTg3tDlpEmOA2S9 aGKA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gBHzkQLO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-157386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157386-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 13-20020a0562140dcd00b006a0845c746esi6607201qvt.418.2024.04.24.10.25.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 10:25:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gBHzkQLO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-157386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157386-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3DE081C24E11 for ; Wed, 24 Apr 2024 17:25:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 113AD16D4E3; Wed, 24 Apr 2024 17:24:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gBHzkQLO" 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 3660C16D338; Wed, 24 Apr 2024 17:24:48 +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=1713979488; cv=none; b=d/vANw0mAcYAEkuM62cX4teuyQqPj2yQZj38fJJknuRhm9rzjVf4bOwhYQlv9fixhS6TxX5fLbwVJd1Vfn07fFgUUYTJJQRVA4E3FylMdWPrxeXetfePzBETJOfZVstG77AC04YP7+LgYhl2gn8tjV9OBDKM3AaVSxUqHj05sxk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713979488; c=relaxed/simple; bh=D85E1t//7pg4Je3S7QzI88EErnsJ7FlfVkbWF4PN0xM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BpA8BBZ1GAM8f6i5IvJXlCLNGvEUEXbXf/2XV3p019xBsI98ebSXFuUgijXaN3xFz/+TyxKuJ9a4LdASLCZ/MQKyfJ/ZAy5HdS7XHN7JLhxv+rBxcmsh5WNArJkxR6jacqLc6mT1UxmFVSlnKfqEO2UAJw+TwLaUOXHTj4A3GAI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gBHzkQLO; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5BAEC32781; Wed, 24 Apr 2024 17:24:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713979488; bh=D85E1t//7pg4Je3S7QzI88EErnsJ7FlfVkbWF4PN0xM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=gBHzkQLO5b7D/YUZcX6pBuU7yTPmGpcG+6ecKmSOfoTtQrKC9hS4jX5/MedmdTM3b K57gbBOSvDbUmIYhxGhO2yXYlFPtBeOde4Gb1lRlLj6O48Yg/6cEz4A9fmpCNri7Lp hIie63HLVHyGN77c1dMoHCUmCuc5HtkDw/D/g0XmxTjY51n5Cct9h2mmfaJZ8Zc33o h1gh6jZQlBy6KAReXp2g60KLXtqwWo739lHYBwPdtUH1XhAixxw8AyJHu/ME6OGFNG QJxFtCK1lBkEK2kTD7VOQaFmr/ZFCtPdpCRMmRhPPSA4x0OwkpZ5PAAjtV5mfkLnQo Nhs46dUJryOTQ== From: Nathan Chancellor Date: Wed, 24 Apr 2024 10:24:04 -0700 Subject: [PATCH v2 01/10] selftests/clone3: ksft_exit functions do not return 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-1-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 , brauner@kernel.org X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=2113; i=nathan@kernel.org; h=from:subject:message-id; bh=D85E1t//7pg4Je3S7QzI88EErnsJ7FlfVkbWF4PN0xM=; b=owGbwMvMwCUmm602sfCA1DTG02pJDGmaDrEfXpufeRS1tEFutVdKklDZ5INhHfJ38xf2bRCxD jn5wrKuo5SFQYyLQVZMkaX6sepxQ8M5ZxlvnJoEM4eVCWQIAxenAEzkbjvDP1NV3h0fPkroflVJ P1ll+Ofcn6UZ1pf+rynx1YvfwLw5oIrhf3V3i4CFzYn3N6f4bV96f0/N7rCWfxve6894VTu7e3p vMA8A X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 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_{pass,fail}(), 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. Just removing 'return' would have resulted in !ret ? ksft_exit_pass() : ksft_exit_fail(); so convert that into the more idiomatic if (ret) ksft_exit_fail(); ksft_exit_pass(); Reviewed-by: Muhammad Usama Anjum Reviewed-by: Thomas Gleixner Signed-off-by: Nathan Chancellor --- Cc: brauner@kernel.org --- tools/testing/selftests/clone3/clone3_clear_sighand.c | 2 +- tools/testing/selftests/clone3/clone3_set_tid.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/clone3/clone3_clear_sighand.c b/tools/testing/selftests/clone3/clone3_clear_sighand.c index 54a8b2445be9..ce0426786828 100644 --- a/tools/testing/selftests/clone3/clone3_clear_sighand.c +++ b/tools/testing/selftests/clone3/clone3_clear_sighand.c @@ -120,5 +120,5 @@ int main(int argc, char **argv) test_clone3_clear_sighand(); - return ksft_exit_pass(); + ksft_exit_pass(); } diff --git a/tools/testing/selftests/clone3/clone3_set_tid.c b/tools/testing/selftests/clone3/clone3_set_tid.c index fbf813a5a06f..bfb0da2b4fdd 100644 --- a/tools/testing/selftests/clone3/clone3_set_tid.c +++ b/tools/testing/selftests/clone3/clone3_set_tid.c @@ -412,5 +412,7 @@ int main(int argc, char *argv[]) out: ret = 0; - return !ret ? ksft_exit_pass() : ksft_exit_fail(); + if (ret) + ksft_exit_fail(); + ksft_exit_pass(); } -- 2.44.0