diff mbox series

[13/36] tty: serial: 8250: 8250_port: Staticify functions referenced by pointers

Message ID 20201104193549.4026187-14-lee.jones@linaro.org
State New
Headers show
Series [01/36] tty: serdev: core: Remove unused variable 'dummy' | expand

Commit Message

Lee Jones Nov. 4, 2020, 7:35 p.m. UTC
Fixes the following W=1 kernel build warning(s):

 drivers/tty/serial/8250/8250_port.c:349:14: warning: no previous prototype for ‘au_serial_in’ [-Wmissing-prototypes]
 drivers/tty/serial/8250/8250_port.c:359:6: warning: no previous prototype for ‘au_serial_out’ [-Wmissing-prototypes]

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: Mike Hudson <Exoray@isys.ca>
Cc: linux-serial@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/tty/serial/8250/8250_port.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Greg KH Nov. 6, 2020, 9:53 a.m. UTC | #1
On Wed, Nov 04, 2020 at 07:35:26PM +0000, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/tty/serial/8250/8250_port.c:349:14: warning: no previous prototype for ‘au_serial_in’ [-Wmissing-prototypes]
>  drivers/tty/serial/8250/8250_port.c:359:6: warning: no previous prototype for ‘au_serial_out’ [-Wmissing-prototypes]
> 
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Jiri Slaby <jirislaby@kernel.org>
> Cc: Mike Hudson <Exoray@isys.ca>
> Cc: linux-serial@vger.kernel.org
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/tty/serial/8250/8250_port.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

And now I get build errors of:
	ld: drivers/tty/serial/8250/8250_early.o: in function `early_au_setup':
	8250_early.c:(.init.text+0x7): undefined reference to `au_serial_in'
	ld: 8250_early.c:(.init.text+0xf): undefined reference to `au_serial_out'
	make: *** [Makefile:1164: vmlinux] Error 1

Always test-build your patches, perhaps W=1 was wrong here...

thanks,

greg k-h
Lee Jones Nov. 6, 2020, 10:05 a.m. UTC | #2
On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:

> On Wed, Nov 04, 2020 at 07:35:26PM +0000, Lee Jones wrote:
> > Fixes the following W=1 kernel build warning(s):
> > 
> >  drivers/tty/serial/8250/8250_port.c:349:14: warning: no previous prototype for ‘au_serial_in’ [-Wmissing-prototypes]
> >  drivers/tty/serial/8250/8250_port.c:359:6: warning: no previous prototype for ‘au_serial_out’ [-Wmissing-prototypes]
> > 
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Cc: Jiri Slaby <jirislaby@kernel.org>
> > Cc: Mike Hudson <Exoray@isys.ca>
> > Cc: linux-serial@vger.kernel.org
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> > ---
> >  drivers/tty/serial/8250/8250_port.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> And now I get build errors of:
> 	ld: drivers/tty/serial/8250/8250_early.o: in function `early_au_setup':
> 	8250_early.c:(.init.text+0x7): undefined reference to `au_serial_in'
> 	ld: 8250_early.c:(.init.text+0xf): undefined reference to `au_serial_out'
> 	make: *** [Makefile:1164: vmlinux] Error 1
> 
> Always test-build your patches, perhaps W=1 was wrong here...

I *always* test build my sets before posting.

/investigating
Lee Jones Nov. 6, 2020, 10:16 a.m. UTC | #3
On Fri, 06 Nov 2020, Lee Jones wrote:

> On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:

> 

> > On Wed, Nov 04, 2020 at 07:35:26PM +0000, Lee Jones wrote:

> > > Fixes the following W=1 kernel build warning(s):

> > > 

> > >  drivers/tty/serial/8250/8250_port.c:349:14: warning: no previous prototype for ‘au_serial_in’ [-Wmissing-prototypes]

> > >  drivers/tty/serial/8250/8250_port.c:359:6: warning: no previous prototype for ‘au_serial_out’ [-Wmissing-prototypes]

> > > 

> > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

> > > Cc: Jiri Slaby <jirislaby@kernel.org>

> > > Cc: Mike Hudson <Exoray@isys.ca>

> > > Cc: linux-serial@vger.kernel.org

> > > Signed-off-by: Lee Jones <lee.jones@linaro.org>

> > > ---

> > >  drivers/tty/serial/8250/8250_port.c | 4 ++--

> > >  1 file changed, 2 insertions(+), 2 deletions(-)

> > 

> > And now I get build errors of:

> > 	ld: drivers/tty/serial/8250/8250_early.o: in function `early_au_setup':

> > 	8250_early.c:(.init.text+0x7): undefined reference to `au_serial_in'

> > 	ld: 8250_early.c:(.init.text+0xf): undefined reference to `au_serial_out'

> > 	make: *** [Makefile:1164: vmlinux] Error 1

> > 

> 

> I *always* test build my sets before posting.

> 

> /investigating


What config failed for you?

It looks as though SERIAL_8250_CONSOLE is a bool and doesn't appear to
be compiled with allmodconfig builds for any architecture that I test
against (Arm, Arm64, MIPS, PPC, x86).

> > perhaps W=1 was wrong here...


NEVER! ;)

The prototype just needs moving is all.

I'll fix the issue and re-post an alternative patch.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
Greg KH Nov. 6, 2020, 10:20 a.m. UTC | #4
On Fri, Nov 06, 2020 at 10:05:52AM +0000, Lee Jones wrote:
> On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:
> 
> > On Wed, Nov 04, 2020 at 07:35:26PM +0000, Lee Jones wrote:
> > > Fixes the following W=1 kernel build warning(s):
> > > 
> > >  drivers/tty/serial/8250/8250_port.c:349:14: warning: no previous prototype for ‘au_serial_in’ [-Wmissing-prototypes]
> > >  drivers/tty/serial/8250/8250_port.c:359:6: warning: no previous prototype for ‘au_serial_out’ [-Wmissing-prototypes]
> > > 
> > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > Cc: Jiri Slaby <jirislaby@kernel.org>
> > > Cc: Mike Hudson <Exoray@isys.ca>
> > > Cc: linux-serial@vger.kernel.org
> > > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> > > ---
> > >  drivers/tty/serial/8250/8250_port.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > And now I get build errors of:
> > 	ld: drivers/tty/serial/8250/8250_early.o: in function `early_au_setup':
> > 	8250_early.c:(.init.text+0x7): undefined reference to `au_serial_in'
> > 	ld: 8250_early.c:(.init.text+0xf): undefined reference to `au_serial_out'
> > 	make: *** [Makefile:1164: vmlinux] Error 1
> > 
> > Always test-build your patches, perhaps W=1 was wrong here...
> 
> I *always* test build my sets before posting.

Great, then I should have rephrased it as:
	Always test-build your patches and fix the error found in them
	before sending.

:)
Greg KH Nov. 6, 2020, 10:39 a.m. UTC | #5
On Fri, Nov 06, 2020 at 10:16:46AM +0000, Lee Jones wrote:
> On Fri, 06 Nov 2020, Lee Jones wrote:

> 

> > On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:

> > 

> > > On Wed, Nov 04, 2020 at 07:35:26PM +0000, Lee Jones wrote:

> > > > Fixes the following W=1 kernel build warning(s):

> > > > 

> > > >  drivers/tty/serial/8250/8250_port.c:349:14: warning: no previous prototype for ‘au_serial_in’ [-Wmissing-prototypes]

> > > >  drivers/tty/serial/8250/8250_port.c:359:6: warning: no previous prototype for ‘au_serial_out’ [-Wmissing-prototypes]

> > > > 

> > > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

> > > > Cc: Jiri Slaby <jirislaby@kernel.org>

> > > > Cc: Mike Hudson <Exoray@isys.ca>

> > > > Cc: linux-serial@vger.kernel.org

> > > > Signed-off-by: Lee Jones <lee.jones@linaro.org>

> > > > ---

> > > >  drivers/tty/serial/8250/8250_port.c | 4 ++--

> > > >  1 file changed, 2 insertions(+), 2 deletions(-)

> > > 

> > > And now I get build errors of:

> > > 	ld: drivers/tty/serial/8250/8250_early.o: in function `early_au_setup':

> > > 	8250_early.c:(.init.text+0x7): undefined reference to `au_serial_in'

> > > 	ld: 8250_early.c:(.init.text+0xf): undefined reference to `au_serial_out'

> > > 	make: *** [Makefile:1164: vmlinux] Error 1

> > > 

> > 

> > I *always* test build my sets before posting.

> > 

> > /investigating

> 

> What config failed for you?

> 

> It looks as though SERIAL_8250_CONSOLE is a bool and doesn't appear to

> be compiled with allmodconfig builds for any architecture that I test

> against (Arm, Arm64, MIPS, PPC, x86).


I build on x86, and here's what I have set:

CONFIG_SERIAL_EARLYCON=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
CONFIG_SERIAL_8250_PNP=y
CONFIG_SERIAL_8250_16550A_VARIANTS=y
CONFIG_SERIAL_8250_FINTEK=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_DMA=y
CONFIG_SERIAL_8250_PCI=y
CONFIG_SERIAL_8250_EXAR=y
CONFIG_SERIAL_8250_NR_UARTS=16
CONFIG_SERIAL_8250_RUNTIME_UARTS=8
CONFIG_SERIAL_8250_EXTENDED=y
# CONFIG_SERIAL_8250_MANY_PORTS is not set
# CONFIG_SERIAL_8250_SHARE_IRQ is not set
# CONFIG_SERIAL_8250_DETECT_IRQ is not set
# CONFIG_SERIAL_8250_RSA is not set
CONFIG_SERIAL_8250_DWLIB=y
CONFIG_SERIAL_8250_DW=m
CONFIG_SERIAL_8250_RT288X=y
CONFIG_SERIAL_8250_UNIPHIER=m
CONFIG_SERIAL_8250_LPSS=y
CONFIG_SERIAL_8250_MID=y
CONFIG_SERIAL_8250_TEGRA=m
Lee Jones Nov. 6, 2020, 10:47 a.m. UTC | #6
On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:

> On Fri, Nov 06, 2020 at 10:05:52AM +0000, Lee Jones wrote:
> > On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:
> > 
> > > On Wed, Nov 04, 2020 at 07:35:26PM +0000, Lee Jones wrote:
> > > > Fixes the following W=1 kernel build warning(s):
> > > > 
> > > >  drivers/tty/serial/8250/8250_port.c:349:14: warning: no previous prototype for ‘au_serial_in’ [-Wmissing-prototypes]
> > > >  drivers/tty/serial/8250/8250_port.c:359:6: warning: no previous prototype for ‘au_serial_out’ [-Wmissing-prototypes]
> > > > 
> > > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > > Cc: Jiri Slaby <jirislaby@kernel.org>
> > > > Cc: Mike Hudson <Exoray@isys.ca>
> > > > Cc: linux-serial@vger.kernel.org
> > > > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> > > > ---
> > > >  drivers/tty/serial/8250/8250_port.c | 4 ++--
> > > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > And now I get build errors of:
> > > 	ld: drivers/tty/serial/8250/8250_early.o: in function `early_au_setup':
> > > 	8250_early.c:(.init.text+0x7): undefined reference to `au_serial_in'
> > > 	ld: 8250_early.c:(.init.text+0xf): undefined reference to `au_serial_out'
> > > 	make: *** [Makefile:1164: vmlinux] Error 1
> > > 
> > > Always test-build your patches, perhaps W=1 was wrong here...
> > 
> > I *always* test build my sets before posting.
> 
> Great, then I should have rephrased it as:
> 	Always test-build your patches and fix the error found in them
> 	before sending.

Yes, very funny! ;)

Obviously, all of that was implied in my first reply.

The problem is not a lack of testing, it's the testing method.

I thought allmodconfig would be enough, but it appears not.

Currently investigating with allyesconfig as a drop-in replacement.
Lee Jones Nov. 6, 2020, 10:48 a.m. UTC | #7
On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:

> On Fri, Nov 06, 2020 at 10:16:46AM +0000, Lee Jones wrote:

> > On Fri, 06 Nov 2020, Lee Jones wrote:

> > 

> > > On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:

> > > 

> > > > On Wed, Nov 04, 2020 at 07:35:26PM +0000, Lee Jones wrote:

> > > > > Fixes the following W=1 kernel build warning(s):

> > > > > 

> > > > >  drivers/tty/serial/8250/8250_port.c:349:14: warning: no previous prototype for ‘au_serial_in’ [-Wmissing-prototypes]

> > > > >  drivers/tty/serial/8250/8250_port.c:359:6: warning: no previous prototype for ‘au_serial_out’ [-Wmissing-prototypes]

> > > > > 

> > > > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

> > > > > Cc: Jiri Slaby <jirislaby@kernel.org>

> > > > > Cc: Mike Hudson <Exoray@isys.ca>

> > > > > Cc: linux-serial@vger.kernel.org

> > > > > Signed-off-by: Lee Jones <lee.jones@linaro.org>

> > > > > ---

> > > > >  drivers/tty/serial/8250/8250_port.c | 4 ++--

> > > > >  1 file changed, 2 insertions(+), 2 deletions(-)

> > > > 

> > > > And now I get build errors of:

> > > > 	ld: drivers/tty/serial/8250/8250_early.o: in function `early_au_setup':

> > > > 	8250_early.c:(.init.text+0x7): undefined reference to `au_serial_in'

> > > > 	ld: 8250_early.c:(.init.text+0xf): undefined reference to `au_serial_out'

> > > > 	make: *** [Makefile:1164: vmlinux] Error 1

> > > > 

> > > 

> > > I *always* test build my sets before posting.

> > > 

> > > /investigating

> > 

> > What config failed for you?

> > 

> > It looks as though SERIAL_8250_CONSOLE is a bool and doesn't appear to

> > be compiled with allmodconfig builds for any architecture that I test

> > against (Arm, Arm64, MIPS, PPC, x86).

> 

> I build on x86, and here's what I have set:

> 

> CONFIG_SERIAL_EARLYCON=y

> CONFIG_SERIAL_8250=y

> CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y

> CONFIG_SERIAL_8250_PNP=y

> CONFIG_SERIAL_8250_16550A_VARIANTS=y

> CONFIG_SERIAL_8250_FINTEK=y

> CONFIG_SERIAL_8250_CONSOLE=y

> CONFIG_SERIAL_8250_DMA=y

> CONFIG_SERIAL_8250_PCI=y

> CONFIG_SERIAL_8250_EXAR=y

> CONFIG_SERIAL_8250_NR_UARTS=16

> CONFIG_SERIAL_8250_RUNTIME_UARTS=8

> CONFIG_SERIAL_8250_EXTENDED=y

> # CONFIG_SERIAL_8250_MANY_PORTS is not set

> # CONFIG_SERIAL_8250_SHARE_IRQ is not set

> # CONFIG_SERIAL_8250_DETECT_IRQ is not set

> # CONFIG_SERIAL_8250_RSA is not set

> CONFIG_SERIAL_8250_DWLIB=y

> CONFIG_SERIAL_8250_DW=m

> CONFIG_SERIAL_8250_RT288X=y

> CONFIG_SERIAL_8250_UNIPHIER=m

> CONFIG_SERIAL_8250_LPSS=y

> CONFIG_SERIAL_8250_MID=y

> CONFIG_SERIAL_8250_TEGRA=m


Is that from the default defconfig?  Or something bespoke?

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
Greg KH Nov. 6, 2020, 10:55 a.m. UTC | #8
On Fri, Nov 06, 2020 at 10:48:10AM +0000, Lee Jones wrote:
> On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:
> 
> > On Fri, Nov 06, 2020 at 10:16:46AM +0000, Lee Jones wrote:
> > > On Fri, 06 Nov 2020, Lee Jones wrote:
> > > 
> > > > On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:
> > > > 
> > > > > On Wed, Nov 04, 2020 at 07:35:26PM +0000, Lee Jones wrote:
> > > > > > Fixes the following W=1 kernel build warning(s):
> > > > > > 
> > > > > >  drivers/tty/serial/8250/8250_port.c:349:14: warning: no previous prototype for ‘au_serial_in’ [-Wmissing-prototypes]
> > > > > >  drivers/tty/serial/8250/8250_port.c:359:6: warning: no previous prototype for ‘au_serial_out’ [-Wmissing-prototypes]
> > > > > > 
> > > > > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > > > > Cc: Jiri Slaby <jirislaby@kernel.org>
> > > > > > Cc: Mike Hudson <Exoray@isys.ca>
> > > > > > Cc: linux-serial@vger.kernel.org
> > > > > > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> > > > > > ---
> > > > > >  drivers/tty/serial/8250/8250_port.c | 4 ++--
> > > > > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > > > 
> > > > > And now I get build errors of:
> > > > > 	ld: drivers/tty/serial/8250/8250_early.o: in function `early_au_setup':
> > > > > 	8250_early.c:(.init.text+0x7): undefined reference to `au_serial_in'
> > > > > 	ld: 8250_early.c:(.init.text+0xf): undefined reference to `au_serial_out'
> > > > > 	make: *** [Makefile:1164: vmlinux] Error 1
> > > > > 
> > > > 
> > > > I *always* test build my sets before posting.
> > > > 
> > > > /investigating
> > > 
> > > What config failed for you?
> > > 
> > > It looks as though SERIAL_8250_CONSOLE is a bool and doesn't appear to
> > > be compiled with allmodconfig builds for any architecture that I test
> > > against (Arm, Arm64, MIPS, PPC, x86).
> > 
> > I build on x86, and here's what I have set:
> > 
> > CONFIG_SERIAL_EARLYCON=y
> > CONFIG_SERIAL_8250=y
> > CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
> > CONFIG_SERIAL_8250_PNP=y
> > CONFIG_SERIAL_8250_16550A_VARIANTS=y
> > CONFIG_SERIAL_8250_FINTEK=y
> > CONFIG_SERIAL_8250_CONSOLE=y
> > CONFIG_SERIAL_8250_DMA=y
> > CONFIG_SERIAL_8250_PCI=y
> > CONFIG_SERIAL_8250_EXAR=y
> > CONFIG_SERIAL_8250_NR_UARTS=16
> > CONFIG_SERIAL_8250_RUNTIME_UARTS=8
> > CONFIG_SERIAL_8250_EXTENDED=y
> > # CONFIG_SERIAL_8250_MANY_PORTS is not set
> > # CONFIG_SERIAL_8250_SHARE_IRQ is not set
> > # CONFIG_SERIAL_8250_DETECT_IRQ is not set
> > # CONFIG_SERIAL_8250_RSA is not set
> > CONFIG_SERIAL_8250_DWLIB=y
> > CONFIG_SERIAL_8250_DW=m
> > CONFIG_SERIAL_8250_RT288X=y
> > CONFIG_SERIAL_8250_UNIPHIER=m
> > CONFIG_SERIAL_8250_LPSS=y
> > CONFIG_SERIAL_8250_MID=y
> > CONFIG_SERIAL_8250_TEGRA=m
> 
> Is that from the default defconfig?  Or something bespoke?

No idea, bespoke I guess, it's grown over the years as what I use for
testing the tty.git tree.  Odd that I have some 8250 options turned off,
no idea why that is...

greg k-h
Lee Jones Nov. 6, 2020, 11:12 a.m. UTC | #9
On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:

> On Fri, Nov 06, 2020 at 10:48:10AM +0000, Lee Jones wrote:

> > On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:

> > 

> > > On Fri, Nov 06, 2020 at 10:16:46AM +0000, Lee Jones wrote:

> > > > On Fri, 06 Nov 2020, Lee Jones wrote:

> > > > 

> > > > > On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:

> > > > > 

> > > > > > On Wed, Nov 04, 2020 at 07:35:26PM +0000, Lee Jones wrote:

> > > > > > > Fixes the following W=1 kernel build warning(s):

> > > > > > > 

> > > > > > >  drivers/tty/serial/8250/8250_port.c:349:14: warning: no previous prototype for ‘au_serial_in’ [-Wmissing-prototypes]

> > > > > > >  drivers/tty/serial/8250/8250_port.c:359:6: warning: no previous prototype for ‘au_serial_out’ [-Wmissing-prototypes]

> > > > > > > 

> > > > > > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

> > > > > > > Cc: Jiri Slaby <jirislaby@kernel.org>

> > > > > > > Cc: Mike Hudson <Exoray@isys.ca>

> > > > > > > Cc: linux-serial@vger.kernel.org

> > > > > > > Signed-off-by: Lee Jones <lee.jones@linaro.org>

> > > > > > > ---

> > > > > > >  drivers/tty/serial/8250/8250_port.c | 4 ++--

> > > > > > >  1 file changed, 2 insertions(+), 2 deletions(-)

> > > > > > 

> > > > > > And now I get build errors of:

> > > > > > 	ld: drivers/tty/serial/8250/8250_early.o: in function `early_au_setup':

> > > > > > 	8250_early.c:(.init.text+0x7): undefined reference to `au_serial_in'

> > > > > > 	ld: 8250_early.c:(.init.text+0xf): undefined reference to `au_serial_out'

> > > > > > 	make: *** [Makefile:1164: vmlinux] Error 1

> > > > > > 

> > > > > 

> > > > > I *always* test build my sets before posting.

> > > > > 

> > > > > /investigating

> > > > 

> > > > What config failed for you?

> > > > 

> > > > It looks as though SERIAL_8250_CONSOLE is a bool and doesn't appear to

> > > > be compiled with allmodconfig builds for any architecture that I test

> > > > against (Arm, Arm64, MIPS, PPC, x86).

> > > 

> > > I build on x86, and here's what I have set:

> > > 

> > > CONFIG_SERIAL_EARLYCON=y

> > > CONFIG_SERIAL_8250=y

> > > CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y

> > > CONFIG_SERIAL_8250_PNP=y

> > > CONFIG_SERIAL_8250_16550A_VARIANTS=y

> > > CONFIG_SERIAL_8250_FINTEK=y

> > > CONFIG_SERIAL_8250_CONSOLE=y

> > > CONFIG_SERIAL_8250_DMA=y

> > > CONFIG_SERIAL_8250_PCI=y

> > > CONFIG_SERIAL_8250_EXAR=y

> > > CONFIG_SERIAL_8250_NR_UARTS=16

> > > CONFIG_SERIAL_8250_RUNTIME_UARTS=8

> > > CONFIG_SERIAL_8250_EXTENDED=y

> > > # CONFIG_SERIAL_8250_MANY_PORTS is not set

> > > # CONFIG_SERIAL_8250_SHARE_IRQ is not set

> > > # CONFIG_SERIAL_8250_DETECT_IRQ is not set

> > > # CONFIG_SERIAL_8250_RSA is not set

> > > CONFIG_SERIAL_8250_DWLIB=y

> > > CONFIG_SERIAL_8250_DW=m

> > > CONFIG_SERIAL_8250_RT288X=y

> > > CONFIG_SERIAL_8250_UNIPHIER=m

> > > CONFIG_SERIAL_8250_LPSS=y

> > > CONFIG_SERIAL_8250_MID=y

> > > CONFIG_SERIAL_8250_TEGRA=m

> > 

> > Is that from the default defconfig?  Or something bespoke?

> 

> No idea, bespoke I guess, it's grown over the years as what I use for

> testing the tty.git tree.  Odd that I have some 8250 options turned off,

> no idea why that is...


Not as strange as this.

I cannot recreate the issue or work out why:

# THE OUTPUT
#   *_port.o and *_early.o were both built

$ ls -l ../builds/build-x86/drivers/tty/serial/8250/
total 1196
-rw-rw-r-- 1 lee lee  36376 Nov  6 10:52 8250_aspeed_vuart.o
-rw-rw-r-- 1 lee lee  17696 Nov  6 10:52 8250_bcm2835aux.o
-rw-rw-r-- 1 lee lee  90896 Nov  6 10:52 8250_core.o
-rw-rw-r-- 1 lee lee  34184 Nov  6 10:52 8250_dma.o
-rw-rw-r-- 1 lee lee  11840 Nov  6 10:52 8250_dwlib.o
-rw-rw-r-- 1 lee lee  50472 Nov  6 10:52 8250_dw.o
-rw-rw-r-- 1 lee lee  16496 Nov  6 10:52 8250_early.o
-rw-rw-r-- 1 lee lee  49376 Nov  6 10:52 8250_exar.o
-rw-rw-r-- 1 lee lee  20256 Nov  6 10:52 8250_fintek.o
-rw-rw-r-- 1 lee lee  26976 Nov  6 10:52 8250_ingenic.o
-rw-rw-r-- 1 lee lee  18904 Nov  6 10:52 8250_lpc18xx.o
-rw-rw-r-- 1 lee lee  21712 Nov  6 10:52 8250_lpss.o
-rw-rw-r-- 1 lee lee  18768 Nov  6 10:52 8250_men_mcb.o
-rw-rw-r-- 1 lee lee  25880 Nov  6 10:52 8250_mid.o
-rw-rw-r-- 1 lee lee  30880 Nov  6 10:52 8250_of.o
-rw-rw-r-- 1 lee lee 142776 Nov  6 10:52 8250_pci.o
-rw-rw-r-- 1 lee lee  23240 Nov  6 10:52 8250_pnp.o
-rw-rw-r-- 1 lee lee 214088 Nov  6 10:52 8250_port.o
-rw-rw-r-- 1 lee lee  18992 Nov  6 10:52 8250_tegra.o
-rw-rw-r-- 1 lee lee  23736 Nov  6 10:52 8250_uniphier.o
-rw-rw-r-- 1 lee lee   1626 Nov  6 10:52 built-in.a
-rw-rw-r-- 1 lee lee      0 Nov  6 10:52 modules.order
-rw-rw-r-- 1 lee lee  94280 Nov  6 10:52 serial_cs.o

# THE BUILD

 locally noclean x86 w1 drivers/tty debug
 
 Running locally
 
 ********************
 * Building for X86 *
 ********************
 
 rm -rf ../builds/build-x86/drivers/tty/
 
 make -f Makefile -j24 KBUILD_OUTPUT=../builds/build-x86 allyesconfig
 make -f Makefile -j24 KBUILD_OUTPUT=../builds/build-x86  W=1  drivers/tty/
 
 make[1]: Entering directory '/home/lee/projects/linux/builds/build-x86'
   SYNC    include/config/auto.conf.cmd
   GEN     Makefile
   GEN     Makefile
   DESCEND  objtool
   CALL    scripts/atomic/check-atomics.sh
   CALL    scripts/checksyscalls.sh
   CC      drivers/tty/tty_io.o
   CC      drivers/tty/n_tty.o
   CC      drivers/tty/tty_ioctl.o
   CC      drivers/tty/tty_ldisc.o
   CC      drivers/tty/tty_buffer.o
   CC      drivers/tty/tty_port.o
   CC      drivers/tty/vt/vt_ioctl.o
   CC      drivers/tty/tty_mutex.o
   CC      drivers/tty/hvc/hvc_console.o
   CC      drivers/tty/vt/selection.o
   CC      drivers/tty/vt/vc_screen.o
   CC      drivers/tty/hvc/hvc_irq.o
   CC      drivers/tty/ipwireless/hardware.o
   CC      drivers/tty/serdev/core.o
   CC      drivers/tty/tty_ldsem.o
   CC      drivers/tty/vt/keyboard.o
   CC      drivers/tty/serdev/serdev-ttyport.o
   CC      drivers/tty/hvc/hvc_xen.o
   CC      drivers/tty/tty_baudrate.o
   CC      drivers/tty/ipwireless/main.o
   CC      drivers/tty/serial/serial_core.o
   CC      drivers/tty/serial/8250/8250_core.o
   CC      drivers/tty/serial/8250/8250_pnp.o
   CC      drivers/tty/serial/jsm/jsm_driver.o
   CC      drivers/tty/ipwireless/network.o
   CC      drivers/tty/ipwireless/tty.o
   CC      drivers/tty/serial/8250/8250_port.o
   CC      drivers/tty/vt/consolemap.o
   CC      drivers/tty/serial/jsm/jsm_neo.o
   CC      drivers/tty/serial/8250/8250_dma.o
   HOSTCC  drivers/tty/vt/conmakehash
   CC      drivers/tty/tty_jobctrl.o
   CC      drivers/tty/n_null.o
   CC      drivers/tty/serial/8250/8250_dwlib.o
   CC      drivers/tty/vt/vt.o
   AR      drivers/tty/ipwireless/built-in.a
   CC      drivers/tty/serial/jsm/jsm_tty.o
   CC      drivers/tty/serial/jsm/jsm_cls.o
   CC      drivers/tty/serial/earlycon.o
   CC      drivers/tty/pty.o
   SHIPPED drivers/tty/vt/defkeymap.c
   CC      drivers/tty/tty_audit.o
   CC      drivers/tty/vt/defkeymap.o
   CONMK   drivers/tty/vt/consolemap_deftbl.c
   CC      drivers/tty/vt/consolemap_deftbl.o
   CC      drivers/tty/serial/clps711x.o
   CC      drivers/tty/serial/8250/8250_fintek.o
   AR      drivers/tty/serial/jsm/built-in.a
   AR      drivers/tty/hvc/built-in.a
   CC      drivers/tty/serial/bcm63xx_uart.o
   CC      drivers/tty/serial/8250/8250_pci.o
   CC      drivers/tty/serial/samsung_tty.o
   CC      drivers/tty/serial/8250/8250_exar.o
   CC      drivers/tty/serial/max3100.o
   CC      drivers/tty/serial/max310x.o
   CC      drivers/tty/serial/lpc32xx_hs.o
   AR      drivers/tty/serdev/built-in.a
   CC      drivers/tty/serial/8250/serial_cs.o
   CC      drivers/tty/serial/8250/8250_aspeed_vuart.o
   CC      drivers/tty/sysrq.o
   CC      drivers/tty/n_hdlc.o
   CC      drivers/tty/n_gsm.o
   CC      drivers/tty/n_tracerouter.o
   CC      drivers/tty/n_tracesink.o
   CC      drivers/tty/serial/8250/8250_bcm2835aux.o
   CC      drivers/tty/serial/sh-sci.o
   CC      drivers/tty/cyclades.o
   CC      drivers/tty/serial/imx.o
   CC      drivers/tty/serial/imx_earlycon.o
   CC      drivers/tty/serial/8250/8250_early.o
   CC      drivers/tty/serial/8250/8250_men_mcb.o
   CC      drivers/tty/isicom.o
   CC      drivers/tty/moxa.o
   CC      drivers/tty/serial/8250/8250_dw.o
   AR      drivers/tty/vt/built-in.a
   CC      drivers/tty/mxser.o
   CC      drivers/tty/serial/sccnxp.o
   CC      drivers/tty/serial/8250/8250_lpc18xx.o
   CC      drivers/tty/serial/sc16is7xx.o
   CC      drivers/tty/serial/8250/8250_uniphier.o
   CC      drivers/tty/serial/atmel_serial.o
   CC      drivers/tty/serial/uartlite.o
   CC      drivers/tty/serial/8250/8250_ingenic.o
   CC      drivers/tty/serial/qcom_geni_serial.o
   CC      drivers/tty/serial/8250/8250_lpss.o
   CC      drivers/tty/serial/8250/8250_mid.o
   CC      drivers/tty/nozomi.o
   CC      drivers/tty/ttynull.o
   CC      drivers/tty/rocket.o
   CC      drivers/tty/synclink_gt.o
   CC      drivers/tty/serial/8250/8250_tegra.o
   CC      drivers/tty/serial/8250/8250_of.o
   CC      drivers/tty/goldfish.o
   CC      drivers/tty/serial/altera_uart.o
   CC      drivers/tty/serial/st-asc.o
   CC      drivers/tty/serial/ucc_uart.o
   CC      drivers/tty/serial/timbuart.o
   CC      drivers/tty/serial/altera_jtaguart.o
   CC      drivers/tty/serial/ifx6x60.o
   CC      drivers/tty/serial/pch_uart.o
   CC      drivers/tty/serial/mxs-auart.o
   CC      drivers/tty/serial/lantiq.o
   AR      drivers/tty/serial/8250/built-in.a
   CC      drivers/tty/serial/xilinx_uartps.o
   CC      drivers/tty/serial/arc_uart.o
   CC      drivers/tty/serial/rp2.o
   CC      drivers/tty/serial/fsl_lpuart.o
   CC      drivers/tty/serial/fsl_linflexuart.o
   CC      drivers/tty/serial/digicolor-usart.o
   CC      drivers/tty/serial/men_z135_uart.o
   CC      drivers/tty/serial/sprd_serial.o
   CC      drivers/tty/serial/stm32-usart.o
   CC      drivers/tty/serial/mvebu-uart.o
   CC      drivers/tty/serial/mps2-uart.o
   CC      drivers/tty/serial/owl-uart.o
   CC      drivers/tty/serial/rda-uart.o
   CC      drivers/tty/serial/milbeaut_usio.o
   CC      drivers/tty/serial/sifive.o
   CC      drivers/tty/serial/serial_mctrl_gpio.o
   CC      drivers/tty/serial/kgdb_nmi.o
   CC      drivers/tty/serial/kgdboc.o
   AR      drivers/tty/serial/built-in.a
   AR      drivers/tty/built-in.a
 make[1]: Leaving directory '/home/lee/projects/linux/builds/build-x86'
 
 ******************************
 * Checking for SPARSE errors *
 ******************************
 
 make -f Makefile -j24 KBUILD_OUTPUT=../builds/build-x86 C=1 W=1  drivers/tty/
 
 make[1]: Entering directory '/home/lee/projects/linux/builds/build-x86'
   GEN     Makefile
   DESCEND  objtool
   CALL    scripts/atomic/check-atomics.sh
   CALL    scripts/checksyscalls.sh
 make[1]: Leaving directory '/home/lee/projects/linux/builds/build-x86'
 
 ******************************
 * Checking for SMATCH errors *
 *   TODO: stdout => stderr   *
 ******************************
 
 make -f Makefile -j24 KBUILD_OUTPUT=../builds/build-x86 C=1 CHECK='smatch --no-data -p=kernel' W=1  drivers/tty/
 
 make[1]: Entering directory '/home/lee/projects/linux/builds/build-x86'
   GEN     Makefile
   DESCEND  objtool
   CALL    scripts/atomic/check-atomics.sh
   CALL    scripts/checksyscalls.sh
 make[1]: Leaving directory '/home/lee/projects/linux/builds/build-x86'

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
Jiri Slaby Nov. 6, 2020, 11:19 a.m. UTC | #10
On 06. 11. 20, 12:12, Lee Jones wrote:
> I cannot recreate the issue or work out why:
> 
> # THE OUTPUT
> #   *_port.o and *_early.o were both built
You have to _link_ to see linker errors ;).

Like make vmlinux
Lee Jones Nov. 6, 2020, 2:47 p.m. UTC | #11
On Fri, 06 Nov 2020, Jiri Slaby wrote:

> On 06. 11. 20, 12:12, Lee Jones wrote:

> > I cannot recreate the issue or work out why:

> > 

> > # THE OUTPUT

> > #   *_port.o and *_early.o were both built


> You have to _link_ to see linker errors ;).

> 

> Like make vmlinux


The default make that I am using does link:

  make -f Makefile -j24 KBUILD_OUTPUT=../builds/build-x86
  
But I do see what's happening now (thanks for the nudge).

The issue is being masked because I'm specifying a specific directory
to build.  I would have hoped that it would at least link into a
subsystem type object file, but it looks as though it's only being
*-ar'ed into an archive.

It appears linking is only done once at the very end of the compile,
which is kind of frustrating for my use-case.

This confused me because I know that I'd received linking errors
before.  However this must have been for files compiled as modules
(these are linked on-the-fly) rather than built-ins, which are only
linked once everything else has finished.

Not sure how I'm going to fix this yet, since compiling everything is
very time consuming, but I'll work something out.

Thanks again.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
diff mbox series

Patch

diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index b0af13074cd36..ebce4406dc289 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -346,7 +346,7 @@  static const s8 au_io_out_map[8] = {
 	-1,	/* UART_SCR (unmapped) */
 };
 
-unsigned int au_serial_in(struct uart_port *p, int offset)
+static unsigned int au_serial_in(struct uart_port *p, int offset)
 {
 	if (offset >= ARRAY_SIZE(au_io_in_map))
 		return UINT_MAX;
@@ -356,7 +356,7 @@  unsigned int au_serial_in(struct uart_port *p, int offset)
 	return __raw_readl(p->membase + (offset << p->regshift));
 }
 
-void au_serial_out(struct uart_port *p, int offset, int value)
+static void au_serial_out(struct uart_port *p, int offset, int value)
 {
 	if (offset >= ARRAY_SIZE(au_io_out_map))
 		return;