On Wed, Apr 10, 2024 at 4:26 PM John Stultz <jstu...@google.com> wrote:
>
> After commit 6d029c25b71f ("selftests/timers/posix_timers:
> Reimplement check_timer_distribution()") I started seeing the
> following warning building with an older gcc:
>
> posix_timers.c:250:2: warning: format not a string literal and no format 
> arguments [-Wformat-security]
>   250 |  ksft_print_msg(errmsg);
>       |  ^~~~~~~~~~~~~~
>
> Fix this up by changing it to ksft_print_msg("%s", errmsg)
>
> Cc: Shuah Khan <sh...@kernel.org>
> Cc: Anna-Maria Behnsen <anna-ma...@linutronix.de>
> Cc: Frederic Weisbecker <frede...@kernel.org>
> Cc: Thomas Gleixner <t...@linutronix.de>
> Cc: Stephen Boyd <sb...@kernel.org>
> Cc: Nathan Chancellor <nat...@kernel.org>
> Cc: Nick Desaulniers <ndesaulni...@google.com>
> Cc: Bill Wendling <mo...@google.com>
> Cc: Justin Stitt <justinst...@google.com>
> Cc: Oleg Nesterov <o...@redhat.com>
> Cc: Andrew Morton <a...@linux-foundation.org>
> Cc: Edward Liaw <edl...@google.com>
> Cc: Carlos Llamas <cmlla...@google.com>
> Cc: kernel-t...@android.com
> Cc: linux-kselftest@vger.kernel.org
> Fixes: 6d029c25b71f ("selftests/timers/posix_timers: Reimplement 
> check_timer_distribution()")
> Signed-off-by: John Stultz <jstu...@google.com>

Yep, makes sense.

Acked-by: Justin Stitt <justinst...@google.com>

> ---
>  tools/testing/selftests/timers/posix_timers.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/timers/posix_timers.c 
> b/tools/testing/selftests/timers/posix_timers.c
> index d86a0e00711e..348f47176e0a 100644
> --- a/tools/testing/selftests/timers/posix_timers.c
> +++ b/tools/testing/selftests/timers/posix_timers.c
> @@ -247,7 +247,7 @@ static int check_timer_distribution(void)
>                 ksft_test_result_skip("check signal distribution (old 
> kernel)\n");
>         return 0;
>  err:
> -       ksft_print_msg(errmsg);
> +       ksft_print_msg("%s", errmsg);
>         return -1;
>  }
>
> --
> 2.44.0.478.gd926399ef9-goog
>

Reply via email to