lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <941334a9-a438-4b0f-a439-bd8cc1e847b3@collabora.com>
Date: Fri, 18 Apr 2025 21:59:46 +0500
From: Muhammad Usama Anjum <usama.anjum@...labora.com>
To: Thomas Weißschuh <thomas.weissschuh@...utronix.de>,
 Shuah Khan <shuah@...nel.org>, Shuah Khan <skhan@...uxfoundation.org>,
 Willy Tarreau <w@....eu>, Thomas Weißschuh
 <linux@...ssschuh.net>, Kees Cook <kees@...nel.org>
Cc: Andy Lutomirski <luto@...capital.net>, Will Drewry <wad@...omium.org>,
 linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v3 04/32] selftests: harness: Mark functions without
 prototypes static

On 4/11/25 2:00 PM, Thomas Weißschuh wrote:
> 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@...utronix.de>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@...labora.com>

> ---
>  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 2b350ed60b2bf1cbede8e3a9b4ac5fe716900144..5822bc0b86a3c623fd34830fb8b541b27672a00b 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];
> 


-- 
Regards,
Usama

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ