]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ia64: remove generated/nr-irqs.h generation to fix build warning
authorMasahiro Yamada <masahiroy@kernel.org>
Sat, 29 Aug 2020 05:15:24 +0000 (14:15 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Thu, 11 Feb 2021 20:11:19 +0000 (05:11 +0900)
Randy reports the following warning when building ARCH=ia64 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 message is actually false-positive, and you can get palinfo.ko
correctly built. It is emitted in the archprepare stage, where Kbuild
descends into arch/ia64/kernel to generate include/generated/nr-irqs.h
instead of any kind of kernel objects.

arch/ia64/kernel/nr-irqs.c was introduced by commit 213060a4d699
("[IA64] pvops: paravirtualize NR_IRQS") to pre-calculate:

   NR_IRQS = max(IA64_NATIVE_NR_IRQS, XEN_NR_IRQS, FOO_NR_IRQS...)

Since commit d52eefb47d4e ("ia64/xen: Remove Xen support for ia64"), this
union contains just one field, making NR_IRQS and IA64_NATIVE_NR_IRQS
always match.

So, the following hard-coding now works:

  #define NR_IRQS                IA64_NATIVE_NR_IRQS

If you need to re-introduce NR_IRQS = max(...) gimmick in the future,
please try to implement it in asm-offsets.c instead of a separate file.
It will be possible because the header inclusion has been consolidated
to make asm-offsets.c independent of <asm/irqs.h>.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
arch/ia64/Makefile
arch/ia64/include/asm/irq.h
arch/ia64/kernel/Makefile
arch/ia64/kernel/nr-irqs.c [deleted file]

index 45d5368d6a99c895d6ac815868baf5896a31b4ff..b950a23d5219bda0332ff3b49b7caf36f244a4cc 100644 (file)
@@ -86,9 +86,3 @@ define archhelp
   echo '  install      - Install compressed kernel image'
   echo '* unwcheck     - Check vmlinux for invalid unwind info'
 endef
-
-archprepare: make_nr_irqs_h
-PHONY += make_nr_irqs_h
-
-make_nr_irqs_h:
-       $(Q)$(MAKE) $(build)=arch/ia64/kernel include/generated/nr-irqs.h
index 5acf52e908722c0a3cbeaaba96ed7e310a042707..0eccf33dfe8be99e7a22c1061fd2d2e88e66cc0a 100644 (file)
@@ -14,7 +14,9 @@
 
 #include <linux/types.h>
 #include <linux/cpumask.h>
-#include <generated/nr-irqs.h>
+#include <asm/native/irq.h>
+
+#define NR_IRQS                IA64_NATIVE_NR_IRQS
 
 static __inline__ int
 irq_canonicalize (int irq)
index c89bd5f8cbf8311975c7bcbb181a635010cf8387..78717819131cc2bc2a8101d0247ab7bf04c11dbf 100644 (file)
@@ -47,8 +47,3 @@ CFLAGS_traps.o  += -mfixed-range=f2-f5,f16-f31
 
 # The gate DSO image is built using a special linker script.
 include $(src)/Makefile.gate
-
-include/generated/nr-irqs.h: arch/$(SRCARCH)/kernel/nr-irqs.s FORCE
-       $(call filechk,offsets,__ASM_NR_IRQS_H__)
-
-targets += nr-irqs.s
diff --git a/arch/ia64/kernel/nr-irqs.c b/arch/ia64/kernel/nr-irqs.c
deleted file mode 100644 (file)
index f2633b2..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * calculate
- * NR_IRQS = max(IA64_NATIVE_NR_IRQS, XEN_NR_IRQS, FOO_NR_IRQS...)
- * depending on config.
- * This must be calculated before processing asm-offset.c.
- */
-
-#define ASM_OFFSETS_C 1
-
-#include <linux/kbuild.h>
-#include <linux/threads.h>
-#include <asm/native/irq.h>
-
-void foo(void)
-{
-       union paravirt_nr_irqs_max {
-               char ia64_native_nr_irqs[IA64_NATIVE_NR_IRQS];
-       };
-
-       DEFINE(NR_IRQS, sizeof (union paravirt_nr_irqs_max));
-}