mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-11 13:52:02 -04:00
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 <thomas.weissschuh@linutronix.de> Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Acked-by: Shuah Khan <skhan@linuxfoundation.org> Link: https://lore.kernel.org/r/20250505-nolibc-kselftest-harness-v4-4-ee4dd5257135@linutronix.de Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
This commit is contained in:
committed by
Thomas Weißschuh
parent
6c409e0d87
commit
c2bcc8e957
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user