From: "Arnd Bergmann" <arnd@arndb.de>
To: "Mark Rutland" <mark.rutland@arm.com>,
linux-arm-kernel@lists.infradead.org
Cc: "Mark Brown" <broonie@kernel.org>,
"Catalin Marinas" <catalin.marinas@arm.com>,
"Marc Zyngier" <maz@kernel.org>, "Will Deacon" <will@kernel.org>
Subject: Re: [PATCH] arm64/fpsimd: Avoid warning when sve_to_fpsimd() is unused
Date: Sat, 03 May 2025 16:10:43 +0200 [thread overview]
Message-ID: <bb9783ec-126d-4938-a6f3-dd5930f1c3b6@app.fastmail.com> (raw)
In-Reply-To: <20250430173240.4023627-1-mark.rutland@arm.com>
On Wed, Apr 30, 2025, at 19:32, Mark Rutland wrote:
>
> diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
> index b0874402f7ecc..422b9d43b1e64 100644
> --- a/arch/arm64/kernel/fpsimd.c
> +++ b/arch/arm64/kernel/fpsimd.c
> @@ -649,7 +649,7 @@ static void __fpsimd_to_sve(void *sst, struct
> user_fpsimd_state const *fst,
> * task->thread.uw.fpsimd_state must be up to date before calling this
> * function.
> */
> -static void fpsimd_to_sve(struct task_struct *task)
> +static inline void fpsimd_to_sve(struct task_struct *task)
> {
> unsigned int vq;
> void *sst = task->thread.sve_state;
I just sent a different patch (adding an #ifdef) before I
saw this one is already applied.
Avoiding the #ifdef does make your version nicer, though this
may come back later, since I think this would still be a warning
at W=1 level, see this bit in linux/compiler.h:
/*
* GCC does not warn about unused static inline functions for -Wunused-function.
* Suppress the warning in clang as well by using __maybe_unused, but enable it
* for W=1 build. This will allow clang to find unused functions. Remove the
* __inline_maybe_unused entirely after fixing most of -Wunused-function warnings.
*/
#ifdef KBUILD_EXTRA_WARN1
#define __inline_maybe_unused
#else
#define __inline_maybe_unused __maybe_unused
#endif
#define inline inline __gnu_inline __inline_maybe_unused notrace
IIRC, gcc never warns for unused inline functions, but clang warns
about them when they are defined in a .c file rather than a header.
Arnd
next prev parent reply other threads:[~2025-05-03 14:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-30 17:32 [PATCH] arm64/fpsimd: Avoid warning when sve_to_fpsimd() is unused Mark Rutland
2025-04-30 18:13 ` Catalin Marinas
2025-05-03 14:10 ` Arnd Bergmann [this message]
2025-05-03 14:52 ` Mark Rutland
2025-05-03 15:26 ` Arnd Bergmann
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=bb9783ec-126d-4938-a6f3-dd5930f1c3b6@app.fastmail.com \
--to=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=will@kernel.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