diff mbox series

[2/3] ia64: remove unneeded header includes from <asm/mca.h>

Message ID 20200829051524.706585-3-masahiroy@kernel.org
State New
Headers show
Series None | expand

Commit Message

Masahiro Yamada Aug. 29, 2020, 5:15 a.m. UTC
<asm/mca.h> includes too many unneeded headers.

This commit cuts off a lot of header includes.

What we need to include are:

 - <linux/percpu.h> for DECLARE_PER_CPU(u64, ia64_mca_pal_base)
 - <linux/threads.h> for NR_CPUS
 - <linux/types.h> for u8, u64, size_t, etc.
 - <asm/ptrace.h> for KERNEL_STACK_SIZE

The other header includes are actually unneeded.

<asm/mca.h> previously included 436 headers, and now it includes
only 138. I confirmed <asm/mca.h> is still self-contained.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 arch/ia64/include/asm/mca.h | 9 +++------
 arch/ia64/kernel/efi.c      | 1 +
 arch/ia64/kernel/mca.c      | 1 +
 3 files changed, 5 insertions(+), 6 deletions(-)

Comments

Randy Dunlap Aug. 29, 2020, 6:20 p.m. UTC | #1
On 8/28/20 10:15 PM, Masahiro Yamada wrote:
> <asm/mca.h> includes too many unneeded headers.
> 
> This commit cuts off a lot of header includes.
> 
> What we need to include are:
> 
>  - <linux/percpu.h> for DECLARE_PER_CPU(u64, ia64_mca_pal_base)
>  - <linux/threads.h> for NR_CPUS
>  - <linux/types.h> for u8, u64, size_t, etc.
>  - <asm/ptrace.h> for KERNEL_STACK_SIZE
> 
> The other header includes are actually unneeded.
> 
> <asm/mca.h> previously included 436 headers, and now it includes
> only 138. I confirmed <asm/mca.h> is still self-contained.

Nice!

> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Reviewed-by: Randy Dunlap <rdunlap@infradead.org>

> ---
> 
>  arch/ia64/include/asm/mca.h | 9 +++------
>  arch/ia64/kernel/efi.c      | 1 +
>  arch/ia64/kernel/mca.c      | 1 +
>  3 files changed, 5 insertions(+), 6 deletions(-)
> 


thanks.
Ard Biesheuvel Aug. 31, 2020, 3 p.m. UTC | #2
On Sat, 29 Aug 2020 at 08:16, Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> <asm/mca.h> includes too many unneeded headers.
>
> This commit cuts off a lot of header includes.
>
> What we need to include are:
>
>  - <linux/percpu.h> for DECLARE_PER_CPU(u64, ia64_mca_pal_base)
>  - <linux/threads.h> for NR_CPUS
>  - <linux/types.h> for u8, u64, size_t, etc.
>  - <asm/ptrace.h> for KERNEL_STACK_SIZE
>
> The other header includes are actually unneeded.
>
> <asm/mca.h> previously included 436 headers, and now it includes
> only 138. I confirmed <asm/mca.h> is still self-contained.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Acked-by: Ard Biesheuvel <ardb@kernel.org>

> ---
>
>  arch/ia64/include/asm/mca.h | 9 +++------
>  arch/ia64/kernel/efi.c      | 1 +
>  arch/ia64/kernel/mca.c      | 1 +
>  3 files changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/arch/ia64/include/asm/mca.h b/arch/ia64/include/asm/mca.h
> index c92b9c15962c..05805249296c 100644
> --- a/arch/ia64/include/asm/mca.h
> +++ b/arch/ia64/include/asm/mca.h
> @@ -14,13 +14,10 @@
>
>  #if !defined(__ASSEMBLY__)
>
> -#include <linux/interrupt.h>
> +#include <linux/percpu.h>
> +#include <linux/threads.h>
>  #include <linux/types.h>
> -
> -#include <asm/param.h>
> -#include <asm/sal.h>
> -#include <asm/processor.h>
> -#include <asm/mca_asm.h>
> +#include <asm/ptrace.h>
>
>  #define IA64_MCA_RENDEZ_TIMEOUT                (20 * 1000)     /* value in milliseconds - 20 seconds */
>
> diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
> index f932b25fb817..b6bb718ed1ff 100644
> --- a/arch/ia64/kernel/efi.c
> +++ b/arch/ia64/kernel/efi.c
> @@ -39,6 +39,7 @@
>  #include <asm/meminit.h>
>  #include <asm/processor.h>
>  #include <asm/mca.h>
> +#include <asm/sal.h>
>  #include <asm/setup.h>
>  #include <asm/tlbflush.h>
>
> diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
> index 17151269d655..3911c561d2bb 100644
> --- a/arch/ia64/kernel/mca.c
> +++ b/arch/ia64/kernel/mca.c
> @@ -96,6 +96,7 @@
>  #include <asm/ptrace.h>
>  #include <asm/sal.h>
>  #include <asm/mca.h>
> +#include <asm/mca_asm.h>
>  #include <asm/kexec.h>
>
>  #include <asm/irq.h>
> --
> 2.25.1
>
diff mbox series

Patch

diff --git a/arch/ia64/include/asm/mca.h b/arch/ia64/include/asm/mca.h
index c92b9c15962c..05805249296c 100644
--- a/arch/ia64/include/asm/mca.h
+++ b/arch/ia64/include/asm/mca.h
@@ -14,13 +14,10 @@ 
 
 #if !defined(__ASSEMBLY__)
 
-#include <linux/interrupt.h>
+#include <linux/percpu.h>
+#include <linux/threads.h>
 #include <linux/types.h>
-
-#include <asm/param.h>
-#include <asm/sal.h>
-#include <asm/processor.h>
-#include <asm/mca_asm.h>
+#include <asm/ptrace.h>
 
 #define IA64_MCA_RENDEZ_TIMEOUT		(20 * 1000)	/* value in milliseconds - 20 seconds */
 
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
index f932b25fb817..b6bb718ed1ff 100644
--- a/arch/ia64/kernel/efi.c
+++ b/arch/ia64/kernel/efi.c
@@ -39,6 +39,7 @@ 
 #include <asm/meminit.h>
 #include <asm/processor.h>
 #include <asm/mca.h>
+#include <asm/sal.h>
 #include <asm/setup.h>
 #include <asm/tlbflush.h>
 
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index 17151269d655..3911c561d2bb 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -96,6 +96,7 @@ 
 #include <asm/ptrace.h>
 #include <asm/sal.h>
 #include <asm/mca.h>
+#include <asm/mca_asm.h>
 #include <asm/kexec.h>
 
 #include <asm/irq.h>