* [PATCH] MIPS: loongson2ef: don't build serial.o unconditionally
@ 2021-08-05 0:02 Randy Dunlap
2021-08-05 9:02 ` Thomas Bogendoerfer
0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2021-08-05 0:02 UTC (permalink / raw)
To: linux-kernel
Cc: Randy Dunlap, kernel test robot, Jiaxun Yang,
Thomas Bogendoerfer, linux-mips
LOONGSON_UART_BASE depends on EARLY_PRINTK || SERIAL_8250, but when
neither of these Kconfig symbols is set, the kernel build has errors:
../arch/mips/loongson2ef/common/serial.c: In function 'serial_init':
../arch/mips/loongson2ef/common/serial.c:66:25: error: 'loongson_uart_base' undeclared (first use in this function)
66 | loongson_uart_base;
../arch/mips/loongson2ef/common/serial.c:66:25: note: each undeclared identifier is reported only once for each function it appears in
../arch/mips/loongson2ef/common/serial.c:68:41: error: '_loongson_uart_base' undeclared (first use in this function)
68 | (void __iomem *)_loongson_uart_base;
Fix this by building serial.o only when one (or both) of these
Kconfig symbols is enabled.
Tested with:
(a) EARLY_PRINTK=y, SERIAL_8250 not set;
(b) EARLY_PRINTK=y, SERIAL_8250=y;
(c) EARLY_PRINTK=y, SERIAL_8250=m.
(d) EARLY_PRINTK not set, SERIAL_8250=y;
(e) EARLY_PRINTK not set, SERIAL_8250=m;
(f) EARLY_PRINTK not set, SERIAL_8250 not set.
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-mips@vger.kernel.org
---
arch/mips/loongson2ef/common/Makefile | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- linext-20210803.orig/arch/mips/loongson2ef/common/Makefile
+++ linext-20210803/arch/mips/loongson2ef/common/Makefile
@@ -4,12 +4,14 @@
#
obj-y += setup.o init.o env.o time.o reset.o irq.o \
- bonito-irq.o mem.o machtype.o platform.o serial.o
+ bonito-irq.o mem.o machtype.o platform.o
obj-$(CONFIG_PCI) += pci.o
#
# Serial port support
#
+obj-$(CONFIG_LOONGSON_UART_BASE) += serial.o
+obj-$(CONFIG_EARLY_PRINTK) += serial.o
obj-$(CONFIG_LOONGSON_UART_BASE) += uart_base.o
obj-$(CONFIG_LOONGSON_MC146818) += rtc.o
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] MIPS: loongson2ef: don't build serial.o unconditionally
2021-08-05 0:02 [PATCH] MIPS: loongson2ef: don't build serial.o unconditionally Randy Dunlap
@ 2021-08-05 9:02 ` Thomas Bogendoerfer
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Bogendoerfer @ 2021-08-05 9:02 UTC (permalink / raw)
To: Randy Dunlap; +Cc: linux-kernel, kernel test robot, Jiaxun Yang, linux-mips
On Wed, Aug 04, 2021 at 05:02:16PM -0700, Randy Dunlap wrote:
> LOONGSON_UART_BASE depends on EARLY_PRINTK || SERIAL_8250, but when
> neither of these Kconfig symbols is set, the kernel build has errors:
>
> ../arch/mips/loongson2ef/common/serial.c: In function 'serial_init':
> ../arch/mips/loongson2ef/common/serial.c:66:25: error: 'loongson_uart_base' undeclared (first use in this function)
> 66 | loongson_uart_base;
> ../arch/mips/loongson2ef/common/serial.c:66:25: note: each undeclared identifier is reported only once for each function it appears in
> ../arch/mips/loongson2ef/common/serial.c:68:41: error: '_loongson_uart_base' undeclared (first use in this function)
> 68 | (void __iomem *)_loongson_uart_base;
>
> Fix this by building serial.o only when one (or both) of these
> Kconfig symbols is enabled.
>
> Tested with:
> (a) EARLY_PRINTK=y, SERIAL_8250 not set;
> (b) EARLY_PRINTK=y, SERIAL_8250=y;
> (c) EARLY_PRINTK=y, SERIAL_8250=m.
> (d) EARLY_PRINTK not set, SERIAL_8250=y;
> (e) EARLY_PRINTK not set, SERIAL_8250=m;
> (f) EARLY_PRINTK not set, SERIAL_8250 not set.
>
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Reported-by: kernel test robot <lkp@intel.com>
> Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Cc: linux-mips@vger.kernel.org
> ---
> arch/mips/loongson2ef/common/Makefile | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
applied to mips-next.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-05 9:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-05 0:02 [PATCH] MIPS: loongson2ef: don't build serial.o unconditionally Randy Dunlap
2021-08-05 9:02 ` Thomas Bogendoerfer
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.