[PATCH 1/4] x86/smp: Explicitly include <linux/thread_info.h>

Kevin Brodsky posted 4 patches 1 year ago
There is a newer version of this series
[PATCH 1/4] x86/smp: Explicitly include <linux/thread_info.h>
Posted by Kevin Brodsky 1 year ago
Including <asm/thread_info.h> directly relies on
<linux/thread_info.h> having already been included, because the
former needs the BAD_STACK/NOT_STACK constants defined in the
latter.

A subsequent patch will break that assumption in a file that
includes asm/smp.h. Include the full <linux/thread_info.h> to avoid
getting into troubles.

Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
---
 arch/x86/include/asm/smp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
index ca073f40698f..88e72b414bfa 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -6,7 +6,7 @@
 
 #include <asm/cpumask.h>
 #include <asm/current.h>
-#include <asm/thread_info.h>
+#include <linux/thread_info.h>
 
 DECLARE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_sibling_map);
 DECLARE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_core_map);
-- 
2.47.0
Re: [PATCH 1/4] x86/smp: Explicitly include <linux/thread_info.h>
Posted by Borislav Petkov 1 year ago
On Tue, Dec 10, 2024 at 06:46:07PM +0000, Kevin Brodsky wrote:
> diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
> index ca073f40698f..88e72b414bfa 100644
> --- a/arch/x86/include/asm/smp.h
> +++ b/arch/x86/include/asm/smp.h
> @@ -6,7 +6,7 @@
>  
>  #include <asm/cpumask.h>
>  #include <asm/current.h>
> -#include <asm/thread_info.h>
> +#include <linux/thread_info.h>

linux/ namespace headers come before asm/ ones, I'd say.

But, more importantly, why is this 4 patches instead of 2:

1. Remove unused __set_memory_prot
2. Fixup include hell

?

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette