Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Kevin Brodsky <kevin.brodsky@arm.com>
To: Catalin Marinas <catalin.marinas@arm.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kselftest@vger.kernel.org
Cc: Shuah Khan <skhan@linuxfoundation.org>, Joey Gouly <joey.gouly@arm.com>
Subject: Re: [PATCH] selftests/mm: Fix unused function warning for aarch64_write_signal_pkey()
Date: Fri, 8 Nov 2024 14:12:09 +0100	[thread overview]
Message-ID: <d3db93f4-679f-43f7-93b2-9eb33f53f855@arm.com> (raw)
In-Reply-To: <20241108110549.1185923-1-catalin.marinas@arm.com>

On 08/11/2024 12:05, Catalin Marinas wrote:
> Since commit 49f59573e9e0 ("selftests/mm: Enable pkey_sighandler_tests
> on arm64"), pkey_sighandler_tests.c (which includes pkey-arm64.h via
> pkey-helpers.h) ends up compiled for arm64. Since it doesn't use
> aarch64_write_signal_pkey(), the compiler warns:
>
> In file included from pkey-helpers.h:106,
>                  from pkey_sighandler_tests.c:31:
> pkey-arm64.h:130:13: warning: ‘aarch64_write_signal_pkey’ defined but not used [-Wunused-function]
>   130 | static void aarch64_write_signal_pkey(ucontext_t *uctxt, u64 pkey)
>       |             ^~~~~~~~~~~~~~~~~~~~~~~~~
>
> Make the aarch64_write_signal_pkey() a 'static inline void' function to
> avoid the compiler warning.
>
> Fixes: f5b5ea51f78f ("selftests: mm: make protection_keys test work on arm64")
> Cc: Shuah Khan <skhan@linuxfoundation.org>
> Cc: Joey Gouly <joey.gouly@arm.com>
> Cc: Kevin Brodsky <kevin.brodsky@arm.com>
> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

I've got this diff locally, didn't realise it was my patches that
revealed the issue otherwise I'd have posted it earlier. Either way:

Reviewed-by: Kevin Brodsky <kevin.brodsky@arm.com>

- Kevin

> ---
>
> I'll add this on top of the arm64 for-next/pkey-signal branch together with
> Kevin's other patches.
>
>  tools/testing/selftests/mm/pkey-arm64.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/mm/pkey-arm64.h b/tools/testing/selftests/mm/pkey-arm64.h
> index d57fbeace38f..d9d2100eafc0 100644
> --- a/tools/testing/selftests/mm/pkey-arm64.h
> +++ b/tools/testing/selftests/mm/pkey-arm64.h
> @@ -127,7 +127,7 @@ static inline u64 get_pkey_bits(u64 reg, int pkey)
>  	return 0;
>  }
>  
> -static void aarch64_write_signal_pkey(ucontext_t *uctxt, u64 pkey)
> +static inline void aarch64_write_signal_pkey(ucontext_t *uctxt, u64 pkey)
>  {
>  	struct _aarch64_ctx *ctx = GET_UC_RESV_HEAD(uctxt);
>  	struct poe_context *poe_ctx =


  reply	other threads:[~2024-11-08 13:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-08 11:05 [PATCH] selftests/mm: Fix unused function warning for aarch64_write_signal_pkey() Catalin Marinas
2024-11-08 13:12 ` Kevin Brodsky [this message]
2024-11-12 16:10 ` Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d3db93f4-679f-43f7-93b2-9eb33f53f855@arm.com \
    --to=kevin.brodsky@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=joey.gouly@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox