From: Waiman Long <longman@redhat.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
Boqun Feng <boqun.feng@gmail.com>, Arnd Bergmann <arnd@arndb.de>
Cc: linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org,
linux-s390@vger.kernel.org
Subject: Re: [PATCH v2] locking/spinlocks: Make __raw_* lock ops static
Date: Mon, 4 Mar 2024 12:41:27 -0500 [thread overview]
Message-ID: <76d4a653-3525-4359-bcdc-b5e80f63a426@redhat.com> (raw)
In-Reply-To: <78c366485bff13753de758fd27fb6b465ed2850a.1709549641.git.geert+renesas@glider.be>
On 3/4/24 05:56, Geert Uytterhoeven wrote:
> If CONFIG_GENERIC_LOCKBREAK=y and CONFIG_DEBUG_LOCK_ALLOC=n
> (e.g. sh/sdk7786_defconfig):
>
> kernel/locking/spinlock.c:68:17: warning: no previous prototype for '__raw_spin_lock' [-Wmissing-prototypes]
> kernel/locking/spinlock.c:80:26: warning: no previous prototype for '__raw_spin_lock_irqsave' [-Wmissing-prototypes]
> kernel/locking/spinlock.c:98:17: warning: no previous prototype for '__raw_spin_lock_irq' [-Wmissing-prototypes]
> kernel/locking/spinlock.c:103:17: warning: no previous prototype for '__raw_spin_lock_bh' [-Wmissing-prototypes]
> kernel/locking/spinlock.c:68:17: warning: no previous prototype for '__raw_read_lock' [-Wmissing-prototypes]
> kernel/locking/spinlock.c:80:26: warning: no previous prototype for '__raw_read_lock_irqsave' [-Wmissing-prototypes]
> kernel/locking/spinlock.c:98:17: warning: no previous prototype for '__raw_read_lock_irq' [-Wmissing-prototypes]
> kernel/locking/spinlock.c:103:17: warning: no previous prototype for '__raw_read_lock_bh' [-Wmissing-prototypes]
> kernel/locking/spinlock.c:68:17: warning: no previous prototype for '__raw_write_lock' [-Wmissing-prototypes]
> kernel/locking/spinlock.c:80:26: warning: no previous prototype for '__raw_write_lock_irqsave' [-Wmissing-prototypes]
> kernel/locking/spinlock.c:98:17: warning: no previous prototype for '__raw_write_lock_irq' [-Wmissing-prototypes]
> kernel/locking/spinlock.c:103:17: warning: no previous prototype for '__raw_write_lock_bh' [-Wmissing-prototypes]
>
> All __raw_* lock ops are internal functions without external callers.
> Hence fix this by making them static.
>
> Note that if CONFIG_GENERIC_LOCKBREAK=y, no lock ops are inlined, as all
> of CONFIG_INLINE_*_LOCK* depend on !GENERIC_LOCKBREAK.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Acked-by: Waiman Long <longman@redhat.com>
Thanks for updating the change log.
Cheers,
Longman
> ---
> Compile-tested on all defconfigs that have CONFIG_GENERIC_LOCKBREAK=y:
> - sh/sdk7786_defconfig,
> - sh/shx3_defconfig,
> - s390/debug_defconfig,
> and also on s390/debug_defconfig after changing:
> CONFIG_DEBUG_LOCK_ALLOC=n
> CONFIG_DEBUG_WW_MUTEX_SLOWPATH=n
> CONFIG_LOCK_STAT=n
> CONFIG_PROVE_LOCKING=n
>
> v2:
> - Add Acked-by,
> - Drop RFC,
> - Improve patch description.
> ---
> kernel/locking/spinlock.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/kernel/locking/spinlock.c b/kernel/locking/spinlock.c
> index 8475a0794f8c5ad2..7009b568e6255d64 100644
> --- a/kernel/locking/spinlock.c
> +++ b/kernel/locking/spinlock.c
> @@ -65,7 +65,7 @@ EXPORT_PER_CPU_SYMBOL(__mmiowb_state);
> * towards that other CPU that it should break the lock ASAP.
> */
> #define BUILD_LOCK_OPS(op, locktype) \
> -void __lockfunc __raw_##op##_lock(locktype##_t *lock) \
> +static void __lockfunc __raw_##op##_lock(locktype##_t *lock) \
> { \
> for (;;) { \
> preempt_disable(); \
> @@ -77,7 +77,7 @@ void __lockfunc __raw_##op##_lock(locktype##_t *lock) \
> } \
> } \
> \
> -unsigned long __lockfunc __raw_##op##_lock_irqsave(locktype##_t *lock) \
> +static unsigned long __lockfunc __raw_##op##_lock_irqsave(locktype##_t *lock) \
> { \
> unsigned long flags; \
> \
> @@ -95,12 +95,12 @@ unsigned long __lockfunc __raw_##op##_lock_irqsave(locktype##_t *lock) \
> return flags; \
> } \
> \
> -void __lockfunc __raw_##op##_lock_irq(locktype##_t *lock) \
> +static void __lockfunc __raw_##op##_lock_irq(locktype##_t *lock) \
> { \
> _raw_##op##_lock_irqsave(lock); \
> } \
> \
> -void __lockfunc __raw_##op##_lock_bh(locktype##_t *lock) \
> +static void __lockfunc __raw_##op##_lock_bh(locktype##_t *lock) \
> { \
> unsigned long flags; \
> \
prev parent reply other threads:[~2024-03-04 17:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-04 10:56 [PATCH v2] locking/spinlocks: Make __raw_* lock ops static Geert Uytterhoeven
2024-03-04 17:41 ` Waiman Long [this message]
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=76d4a653-3525-4359-bcdc-b5e80f63a426@redhat.com \
--to=longman@redhat.com \
--cc=arnd@arndb.de \
--cc=boqun.feng@gmail.com \
--cc=geert+renesas@glider.be \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).