[PATCH v5 12/36] bit_spinlock: Include missing <asm/processor.h>
Bart Van Assche
bvanassche at acm.org
Fri Dec 19 20:38:32 UTC 2025
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 <elver at google.com>
> ---
> 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 <bvanassche at acm.org>
More information about the Linux-security-module-archive
mailing list