Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: 8250: Move hp300_setup_serial_console() to <linux/serial_8250.h>

If CONFIG_SERIAL_8250_HP300=y and CONFIG_SERIAL_8250_CONSOLE=y (e.g.
m68k/allyesconfig):

drivers/tty/serial/8250/8250_hp300.c:91:12: error: no previous prototype for ‘hp300_setup_serial_console’ [-Werror=missing-prototypes]
91 | int __init hp300_setup_serial_console(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~

Fix this by moving the existing prototype in arch/m68k/hp300/config.c to
<linux/serial_8250.h>, so it is visible to both caller and implementor.
While at it, provide a dummy in case CONFIG_SERIAL_8250_CONSOLE is not
enabled, to reduce #ifdef clutter in the caller.

Exposed by commit 0fcb70851fbfea17 ("Makefile.extrawarn: turn on
missing-prototypes globally").

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/c17469f8e47b2ef49234a85a7a14882ddf374e41.1704892597.git.geert@linux-m68k.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Geert Uytterhoeven and committed by
Greg Kroah-Hartman
85725449 c01e71b4

+7 -5
+1 -5
arch/m68k/hp300/config.c
··· 10 10 11 11 #include <linux/module.h> 12 12 #include <linux/init.h> 13 + #include <linux/serial_8250.h> 13 14 #include <linux/string.h> 14 15 #include <linux/kernel.h> 15 16 #include <linux/console.h> ··· 68 67 static char hp300_model_name[13] = "HP9000/"; 69 68 70 69 extern void hp300_reset(void); 71 - #ifdef CONFIG_SERIAL_8250_CONSOLE 72 - extern int hp300_setup_serial_console(void) __init; 73 - #endif 74 70 75 71 int __init hp300_parse_bootinfo(const struct bi_record *record) 76 72 { ··· 261 263 } else { 262 264 panic("Unknown HP9000 Model"); 263 265 } 264 - #ifdef CONFIG_SERIAL_8250_CONSOLE 265 266 hp300_setup_serial_console(); 266 - #endif 267 267 }
+6
include/linux/serial_8250.h
··· 210 210 void serial8250_set_isa_configurator(void (*v)(int port, struct uart_port *up, 211 211 u32 *capabilities)); 212 212 213 + #ifdef CONFIG_SERIAL_8250_CONSOLE 214 + extern int hp300_setup_serial_console(void) __init; 215 + #else 216 + static inline int hp300_setup_serial_console(void) { return 0; } 217 + #endif 218 + 213 219 #ifdef CONFIG_SERIAL_8250_RT288X 214 220 int rt288x_setup(struct uart_port *p); 215 221 int au_platform_setup(struct plat_serial8250_port *p);