From mboxrd@z Thu Jan 1 00:00:00 1970 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 DAD3D25E451; Sun, 1 Jun 2025 23:28:38 +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=1748820519; cv=none; b=nZgKFrxfIxOXSs1oZ12g+7Ncn7utrMHzUDSwebreaYX1ply+yclU4LK0xb7IOcDKxgnhRbd+eFJQ0YXPW5qzZMqm0Y4p+vGY0ePb1Sofbdz0Lgsh56hiuN1BPXtB7g77FzuSWx9a8tMqAWUkgvOZ9sZPm49AVm4ZrSe72s4PINA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748820519; c=relaxed/simple; bh=8Tp3AU6og9BHvtwofmSrID3yJJnOozXAX6ODrCrL0/A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=rH57ICnfg1TcTEDMYEOE1Ma3wG0hVEafpzmwWPUEwRI6hxXfdK1mqD4vsrpkKtiqPDphJpJFpHF4e/LOjTeD8FbAG2XvV1356Zqm6XsPUZuRTMK+V/KH0fGVoVnJfSSomIHzF3cjkDabxrS7gQc0YtRlh+KELYHyIS1J1j5+OLI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cSgMrXVs; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cSgMrXVs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B977C4CEF1; Sun, 1 Jun 2025 23:28:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1748820518; bh=8Tp3AU6og9BHvtwofmSrID3yJJnOozXAX6ODrCrL0/A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cSgMrXVsnqAZrz9vtMggZ/1N7i1g7m7oVXCEco9drJMdgy4fKZK56AdjhduSUUB8Q y0gVm2Ah7wqTiMnL8crlYtLpa0TkWzH4hOjdQ0Oz1H5wY5tdiVgetmBTVRpKjkuxgh LLo81VHk+Ii0v/Hx+bOmUphfYrd+UerstLJtTgz8/0TkUOVRzyaGRnFmQJfQPwMxl9 e86dNto+oE7a/tlAH8JBgsj/RcxM/mOufl52nCLbqkKmhKvjynD+uHT7oJhdBzsZR6 94DA6Y7RRxtRLf6jUKlpr8Eqq8YF+12VGtbjVQUSVbKwNySyW4pPNUqsy45sOQakdx xZeF8sYBERFQA== From: Sasha Levin To: patches@lists.linux.dev, stable@vger.kernel.org Cc: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Muhammad Usama Anjum , Shuah Khan , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Sasha Levin , kees@kernel.org, shuah@kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH AUTOSEL 6.15 082/110] selftests: harness: Mark functions without prototypes static Date: Sun, 1 Jun 2025 19:24:04 -0400 Message-Id: <20250601232435.3507697-82-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250601232435.3507697-1-sashal@kernel.org> References: <20250601232435.3507697-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.15 Content-Transfer-Encoding: 8bit From: Thomas Weißschuh [ Upstream commit c2bcc8e9577a35f9cf4707f8bb0b58bce30991aa ] With -Wmissing-prototypes the compiler will warn about non-static functions which don't have a prototype defined. As they are not used from a different compilation unit they don't need to be defined globally. Avoid the issue by marking the functions static. Signed-off-by: Thomas Weißschuh Reviewed-by: Muhammad Usama Anjum Acked-by: Shuah Khan Link: https://lore.kernel.org/r/20250505-nolibc-kselftest-harness-v4-4-ee4dd5257135@linutronix.de Signed-off-by: Thomas Weißschuh Signed-off-by: Sasha Levin --- **YES** This commit should be backported to stable kernel trees. **Rationale:** 1. **Legitimate Build Fix**: The commit addresses a real compiler warning issue (`-Wmissing-prototypes`) that affects build cleanliness and code quality. Modern build systems increasingly use stricter warning flags, making this fix valuable for stable trees. 2. **Zero Functional Risk**: The changes are purely cosmetic from a runtime perspective. Adding `static` to functions that were already internal has no impact on functionality, memory layout, or behavior - it only affects compiler symbol visibility and warnings. 3. **Minimal and Contained**: The diff is extremely small (4 function signatures with `static` added) and isolated to the kselftest harness framework. There are no complex logic changes or cross-subsystem impacts. 4. **Testing Infrastructure Improvement**: While the kselftest framework isn't critical runtime code, it's important for kernel testing and validation. Improving build compliance in testing infrastructure benefits stable kernel maintenance. 5. **Standard Practice**: Compiler warning fixes of this nature (adding missing `static` keywords) are routinely backported to stable trees as they represent good coding practices without functional risk. 6. **Different from Similar Commits**: Unlike the referenced similar commits (all marked "NO") which involved feature additions, API changes, or structural modifications, this commit is purely a build compliance fix with no behavioral changes. The commit meets all stable tree criteria: it fixes an issue (compiler warnings), has minimal risk (no functional changes), and improves code quality without introducing new features or architectural changes. Tools like `kselftest_harness.h:241`, `kselftest_harness.h:290`, `kselftest_harness.h:970`, and `kselftest_harness.h:1188` are the specific locations where these low- risk improvements are made. tools/testing/selftests/kselftest_harness.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h index 666c9fde76da9..7c337b4fa054d 100644 --- a/tools/testing/selftests/kselftest_harness.h +++ b/tools/testing/selftests/kselftest_harness.h @@ -258,7 +258,7 @@ * A bare "return;" statement may be used to return early. */ #define FIXTURE_SETUP(fixture_name) \ - void fixture_name##_setup( \ + static void fixture_name##_setup( \ struct __test_metadata __attribute__((unused)) *_metadata, \ FIXTURE_DATA(fixture_name) __attribute__((unused)) *self, \ const FIXTURE_VARIANT(fixture_name) \ @@ -307,7 +307,7 @@ __FIXTURE_TEARDOWN(fixture_name) #define __FIXTURE_TEARDOWN(fixture_name) \ - void fixture_name##_teardown( \ + static void fixture_name##_teardown( \ struct __test_metadata __attribute__((unused)) *_metadata, \ FIXTURE_DATA(fixture_name) __attribute__((unused)) *self, \ const FIXTURE_VARIANT(fixture_name) \ @@ -987,7 +987,7 @@ static void __timeout_handler(int sig, siginfo_t *info, void *ucontext) kill(-(t->pid), SIGKILL); } -void __wait_for_test(struct __test_metadata *t) +static void __wait_for_test(struct __test_metadata *t) { struct sigaction action = { .sa_sigaction = __timeout_handler, @@ -1205,9 +1205,9 @@ static bool test_enabled(int argc, char **argv, return !has_positive; } -void __run_test(struct __fixture_metadata *f, - struct __fixture_variant_metadata *variant, - struct __test_metadata *t) +static void __run_test(struct __fixture_metadata *f, + struct __fixture_variant_metadata *variant, + struct __test_metadata *t) { struct __test_xfail *xfail; char test_name[1024]; -- 2.39.5