Skip to content

Commit c2bcc8e

Browse files
committed
selftests: harness: Mark functions without prototypes static
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 <[email protected]> Reviewed-by: Muhammad Usama Anjum <[email protected]> Acked-by: Shuah Khan <[email protected]> Link: https://lore.kernel.org/r/20250505-nolibc-kselftest-harness-v4-4-ee4dd5257135@linutronix.de Signed-off-by: Thomas Weißschuh <[email protected]>
1 parent 6c409e0 commit c2bcc8e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tools/testing/selftests/kselftest_harness.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@
258258
* A bare "return;" statement may be used to return early.
259259
*/
260260
#define FIXTURE_SETUP(fixture_name) \
261-
void fixture_name##_setup( \
261+
static void fixture_name##_setup( \
262262
struct __test_metadata __attribute__((unused)) *_metadata, \
263263
FIXTURE_DATA(fixture_name) __attribute__((unused)) *self, \
264264
const FIXTURE_VARIANT(fixture_name) \
@@ -307,7 +307,7 @@
307307
__FIXTURE_TEARDOWN(fixture_name)
308308

309309
#define __FIXTURE_TEARDOWN(fixture_name) \
310-
void fixture_name##_teardown( \
310+
static void fixture_name##_teardown( \
311311
struct __test_metadata __attribute__((unused)) *_metadata, \
312312
FIXTURE_DATA(fixture_name) __attribute__((unused)) *self, \
313313
const FIXTURE_VARIANT(fixture_name) \
@@ -987,7 +987,7 @@ static void __timeout_handler(int sig, siginfo_t *info, void *ucontext)
987987
kill(-(t->pid), SIGKILL);
988988
}
989989

990-
void __wait_for_test(struct __test_metadata *t)
990+
static void __wait_for_test(struct __test_metadata *t)
991991
{
992992
struct sigaction action = {
993993
.sa_sigaction = __timeout_handler,
@@ -1205,9 +1205,9 @@ static bool test_enabled(int argc, char **argv,
12051205
return !has_positive;
12061206
}
12071207

1208-
void __run_test(struct __fixture_metadata *f,
1209-
struct __fixture_variant_metadata *variant,
1210-
struct __test_metadata *t)
1208+
static void __run_test(struct __fixture_metadata *f,
1209+
struct __fixture_variant_metadata *variant,
1210+
struct __test_metadata *t)
12111211
{
12121212
struct __test_xfail *xfail;
12131213
char test_name[1024];

0 commit comments

Comments
 (0)