linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ia64: clean-up header dependency and build process, fix build warning
@ 2020-08-29  5:15 Masahiro Yamada
  2020-08-29  5:15 ` [PATCH 2/3] ia64: remove unneeded header includes from <asm/mca.h> Masahiro Yamada
  2020-12-04  5:43 ` [PATCH 0/3] ia64: clean-up header dependency and build process, fix build warning Masahiro Yamada
  0 siblings, 2 replies; 5+ messages in thread
From: Masahiro Yamada @ 2020-08-29  5:15 UTC (permalink / raw)
  To: Tony Luck, Fenghua Yu, linux-ia64
  Cc: Randy Dunlap, linux-kbuild, Masahiro Yamada, Andrew Morton,
	Ard Biesheuvel, Arnd Bergmann, Dmitry Safonov, afzal mohammed,
	linux-efi, linux-kernel


Randy Dunlap reports the following warning with CONFIG_IA64_PALINFO=m:

../scripts/Makefile.build:68: 'arch/ia64/kernel/palinfo.ko' will not be built even though obj-m is specified.
../scripts/Makefile.build:69: You cannot use subdir-y/m to visit a module Makefile. Use obj-y/m instead.

This comes from the fact Kbuild descends into arch/ia64/kernel/ twice.

First, to generate <generated/nr-irqs.h>,
Second, to build kernel and module objects.

The warning is emitted in the first descend because it is not the
intended usage.

I looked into the code closely, and noticed arch/ia64/kernel/nr-irqs.c
was not needed in the first place.

It was separated out of arch/ia64/kernel/asm-offsets.c just because
<asm/mca.h> was including too many bogus headers.

IA64 is not actively maintained, and there exists unneeded obsolete code.

The first two patches are the outcome when I played with ARCH=ia64 builds,
but not prerequisites for 3/3. Anyway I believe they are nice cleanups
and folded in this patch set.

3/3 is the important one to fix the false positive warning,
and it is a nice cleanup too.



Masahiro Yamada (3):
  ia64: do not typedef struct pal_min_state_area_s
  ia64: remove unneeded header includes from <asm/mca.h>
  ia64: remove generated/nr-irqs.h generation to fix build warning

 arch/ia64/Makefile             |  6 ------
 arch/ia64/include/asm/irq.h    |  4 +++-
 arch/ia64/include/asm/mca.h    | 11 ++++-------
 arch/ia64/include/asm/pal.h    |  4 ++--
 arch/ia64/include/asm/sal.h    |  2 +-
 arch/ia64/kernel/Makefile      |  5 -----
 arch/ia64/kernel/asm-offsets.c | 18 +++++++++---------
 arch/ia64/kernel/efi.c         |  1 +
 arch/ia64/kernel/mca.c         |  5 +++--
 arch/ia64/kernel/mca_drv.c     |  2 +-
 arch/ia64/kernel/nr-irqs.c     | 22 ----------------------
 11 files changed, 24 insertions(+), 56 deletions(-)
 delete mode 100644 arch/ia64/kernel/nr-irqs.c

-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/3] ia64: remove unneeded header includes from <asm/mca.h>
  2020-08-29  5:15 [PATCH 0/3] ia64: clean-up header dependency and build process, fix build warning Masahiro Yamada
@ 2020-08-29  5:15 ` Masahiro Yamada
  2020-08-29 18:20   ` Randy Dunlap
  2020-08-31 15:00   ` Ard Biesheuvel
  2020-12-04  5:43 ` [PATCH 0/3] ia64: clean-up header dependency and build process, fix build warning Masahiro Yamada
  1 sibling, 2 replies; 5+ messages in thread
From: Masahiro Yamada @ 2020-08-29  5:15 UTC (permalink / raw)
  To: Tony Luck, Fenghua Yu, linux-ia64
  Cc: Randy Dunlap, linux-kbuild, Masahiro Yamada, Andrew Morton,
	Ard Biesheuvel, Dmitry Safonov, afzal mohammed, linux-efi,
	linux-kernel

<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(-)

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/3] ia64: remove unneeded header includes from <asm/mca.h>
  2020-08-29  5:15 ` [PATCH 2/3] ia64: remove unneeded header includes from <asm/mca.h> Masahiro Yamada
@ 2020-08-29 18:20   ` Randy Dunlap
  2020-08-31 15:00   ` Ard Biesheuvel
  1 sibling, 0 replies; 5+ messages in thread
From: Randy Dunlap @ 2020-08-29 18:20 UTC (permalink / raw)
  To: Masahiro Yamada, Tony Luck, Fenghua Yu, linux-ia64
  Cc: linux-kbuild, Andrew Morton, Ard Biesheuvel, Dmitry Safonov,
	afzal mohammed, linux-efi, linux-kernel

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.
-- 
~Randy


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/3] ia64: remove unneeded header includes from <asm/mca.h>
  2020-08-29  5:15 ` [PATCH 2/3] ia64: remove unneeded header includes from <asm/mca.h> Masahiro Yamada
  2020-08-29 18:20   ` Randy Dunlap
@ 2020-08-31 15:00   ` Ard Biesheuvel
  1 sibling, 0 replies; 5+ messages in thread
From: Ard Biesheuvel @ 2020-08-31 15:00 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Tony Luck, Fenghua Yu, linux-ia64, Randy Dunlap, linux-kbuild,
	Andrew Morton, Dmitry Safonov, afzal mohammed, linux-efi,
	Linux Kernel Mailing List

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
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] ia64: clean-up header dependency and build process, fix build warning
  2020-08-29  5:15 [PATCH 0/3] ia64: clean-up header dependency and build process, fix build warning Masahiro Yamada
  2020-08-29  5:15 ` [PATCH 2/3] ia64: remove unneeded header includes from <asm/mca.h> Masahiro Yamada
@ 2020-12-04  5:43 ` Masahiro Yamada
  1 sibling, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2020-12-04  5:43 UTC (permalink / raw)
  To: Tony Luck, Fenghua Yu, linux-ia64
  Cc: Randy Dunlap, Linux Kbuild mailing list, Andrew Morton,
	Ard Biesheuvel, Arnd Bergmann, Dmitry Safonov, afzal mohammed,
	linux-efi, Linux Kernel Mailing List

Hi, IA64 maintainers,

Could you check this series, please?
The build warning is still remaining.



On Sat, Aug 29, 2020 at 2:16 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
>
> Randy Dunlap reports the following warning with CONFIG_IA64_PALINFO=m:
>
> ../scripts/Makefile.build:68: 'arch/ia64/kernel/palinfo.ko' will not be built even though obj-m is specified.
> ../scripts/Makefile.build:69: You cannot use subdir-y/m to visit a module Makefile. Use obj-y/m instead.
>
> This comes from the fact Kbuild descends into arch/ia64/kernel/ twice.
>
> First, to generate <generated/nr-irqs.h>,
> Second, to build kernel and module objects.
>
> The warning is emitted in the first descend because it is not the
> intended usage.
>
> I looked into the code closely, and noticed arch/ia64/kernel/nr-irqs.c
> was not needed in the first place.
>
> It was separated out of arch/ia64/kernel/asm-offsets.c just because
> <asm/mca.h> was including too many bogus headers.
>
> IA64 is not actively maintained, and there exists unneeded obsolete code.
>
> The first two patches are the outcome when I played with ARCH=ia64 builds,
> but not prerequisites for 3/3. Anyway I believe they are nice cleanups
> and folded in this patch set.
>
> 3/3 is the important one to fix the false positive warning,
> and it is a nice cleanup too.
>
>
>
> Masahiro Yamada (3):
>   ia64: do not typedef struct pal_min_state_area_s
>   ia64: remove unneeded header includes from <asm/mca.h>
>   ia64: remove generated/nr-irqs.h generation to fix build warning
>
>  arch/ia64/Makefile             |  6 ------
>  arch/ia64/include/asm/irq.h    |  4 +++-
>  arch/ia64/include/asm/mca.h    | 11 ++++-------
>  arch/ia64/include/asm/pal.h    |  4 ++--
>  arch/ia64/include/asm/sal.h    |  2 +-
>  arch/ia64/kernel/Makefile      |  5 -----
>  arch/ia64/kernel/asm-offsets.c | 18 +++++++++---------
>  arch/ia64/kernel/efi.c         |  1 +
>  arch/ia64/kernel/mca.c         |  5 +++--
>  arch/ia64/kernel/mca_drv.c     |  2 +-
>  arch/ia64/kernel/nr-irqs.c     | 22 ----------------------
>  11 files changed, 24 insertions(+), 56 deletions(-)
>  delete mode 100644 arch/ia64/kernel/nr-irqs.c
>
> --
> 2.25.1
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-04  5:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-29  5:15 [PATCH 0/3] ia64: clean-up header dependency and build process, fix build warning Masahiro Yamada
2020-08-29  5:15 ` [PATCH 2/3] ia64: remove unneeded header includes from <asm/mca.h> Masahiro Yamada
2020-08-29 18:20   ` Randy Dunlap
2020-08-31 15:00   ` Ard Biesheuvel
2020-12-04  5:43 ` [PATCH 0/3] ia64: clean-up header dependency and build process, fix build warning Masahiro Yamada

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 NNTP newsgroup(s).