Re: [PATCH v5 12/36] bit_spinlock: Include missing <asm/processor.h>
Bart Van Assche <[email protected]> Fri, 19 Dec 2025 12:38:32 -0800
| Newsgroups | org.kernel.vger.linux-sparse,dev.linux.lists.llvm,org.kernel.vger.linux-crypto,org.kernel.vger.linux-doc,org.kernel.vger.linux-kbuild,org.kernel.vger.linux-kernel,org.kernel.vger.linux-security-module,org.kernel.vger.linux-wireless,org.kernel.vger.rcu,org.kvack.linux-mm |
|---|---|
| Message-ID | <[email protected]> |
On 12/19/25 7:40 AM, Marco Elver wrote: > Including <linux/bit_spinlock.h> into an empty TU will result in the > compiler complaining: > > ./include/linux/bit_spinlock.h:34:4: error: call to undeclared function 'cpu_relax'; <...> > 34 | cpu_relax(); > | ^ > 1 error generated. > > Include <asm/processor.h> to allow including bit_spinlock.h where > <asm/processor.h> is not otherwise included. > > Signed-off-by: Marco Elver <[email protected]> > --- > include/linux/bit_spinlock.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/include/linux/bit_spinlock.h b/include/linux/bit_spinlock.h > index c0989b5b0407..59e345f74b0e 100644 > --- a/include/linux/bit_spinlock.h > +++ b/include/linux/bit_spinlock.h > @@ -7,6 +7,8 @@ > #include <linux/atomic.h> > #include <linux/bug.h> > > +#include <asm/processor.h> /* for cpu_relax() */ > + > /* > * bit-based spin_lock() > * The abbreviation "TU" is uncommon so it's probably a good idea to expand it. Anyway: Reviewed-by: Bart Van Assche <[email protected]>