[2/2] serial: cpm_uart: Fix a COMPILE_TEST dependency

Message ID 20230522082048.21216-3-herve.codina@bootlin.com
State New
Headers
Series Fix COMPILE_TEST dependencies for CPM uart, TSA and QMC |

Commit Message

Herve Codina May 22, 2023, 8:20 a.m. UTC
  In a COMPILE_TEST configuration, the cpm_uart driver uses symbols from
the cpm_uart_cpm2.c file. This file is compiled only when CONFIG_CPM2 is
set.

Without this dependency, the linker fails with some missing symbols for
COMPILE_TEST configuration that needs SERIAL_CPM without enabling CPM2.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/oe-kbuild-all/202305160221.9XgweObz-lkp@intel.com/
Fixes: e3e7b13bffae ("serial: allow COMPILE_TEST for some drivers")
---
 drivers/tty/serial/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Jiri Slaby May 23, 2023, 7:52 a.m. UTC | #1
On 22. 05. 23, 10:20, Herve Codina wrote:
> In a COMPILE_TEST configuration, the cpm_uart driver uses symbols from
> the cpm_uart_cpm2.c file. This file is compiled only when CONFIG_CPM2 is
> set.
> 
> Without this dependency, the linker fails with some missing symbols for
> COMPILE_TEST configuration that needs SERIAL_CPM without enabling CPM2.
> 
> Signed-off-by: Herve Codina <herve.codina@bootlin.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Link: https://lore.kernel.org/oe-kbuild-all/202305160221.9XgweObz-lkp@intel.com/
> Fixes: e3e7b13bffae ("serial: allow COMPILE_TEST for some drivers")
> ---
>   drivers/tty/serial/Kconfig | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
> index 625358f44419..68a9d9db9144 100644
> --- a/drivers/tty/serial/Kconfig
> +++ b/drivers/tty/serial/Kconfig
> @@ -769,7 +769,7 @@ config SERIAL_PMACZILOG_CONSOLE
>   
>   config SERIAL_CPM
>   	tristate "CPM SCC/SMC serial port support"
> -	depends on CPM2 || CPM1 || (PPC32 && COMPILE_TEST)
> +	depends on CPM2 || CPM1 || (PPC32 && CPM2 && COMPILE_TEST)

Actually, does this makes sense? I mean, the last part after "||" is now 
superfluous and doesn't help anything, right?

>   	select SERIAL_CORE
>   	help
>   	  This driver supports the SCC and SMC serial ports on Motorola
  
Herve Codina May 23, 2023, 8:36 a.m. UTC | #2
On Tue, 23 May 2023 09:52:00 +0200
Jiri Slaby <jirislaby@kernel.org> wrote:

> On 22. 05. 23, 10:20, Herve Codina wrote:
> > In a COMPILE_TEST configuration, the cpm_uart driver uses symbols from
> > the cpm_uart_cpm2.c file. This file is compiled only when CONFIG_CPM2 is
> > set.
> > 
> > Without this dependency, the linker fails with some missing symbols for
> > COMPILE_TEST configuration that needs SERIAL_CPM without enabling CPM2.
> > 
> > Signed-off-by: Herve Codina <herve.codina@bootlin.com>
> > Reported-by: kernel test robot <lkp@intel.com>
> > Link: https://lore.kernel.org/oe-kbuild-all/202305160221.9XgweObz-lkp@intel.com/
> > Fixes: e3e7b13bffae ("serial: allow COMPILE_TEST for some drivers")
> > ---
> >   drivers/tty/serial/Kconfig | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
> > index 625358f44419..68a9d9db9144 100644
> > --- a/drivers/tty/serial/Kconfig
> > +++ b/drivers/tty/serial/Kconfig
> > @@ -769,7 +769,7 @@ config SERIAL_PMACZILOG_CONSOLE
> >   
> >   config SERIAL_CPM
> >   	tristate "CPM SCC/SMC serial port support"
> > -	depends on CPM2 || CPM1 || (PPC32 && COMPILE_TEST)
> > +	depends on CPM2 || CPM1 || (PPC32 && CPM2 && COMPILE_TEST)  
> 
> Actually, does this makes sense? I mean, the last part after "||" is now 
> superfluous and doesn't help anything, right?

Indeed, I will remove all the (PPC32 && CPM2 && COMPILE_TEST) in the next
iteration.
I will also remove the '#elif defined(CONFIG_COMPILE_TEST)' case in the
cpm_uart.h file.

Best regards,
Hervé

> 
> >   	select SERIAL_CORE
> >   	help
> >   	  This driver supports the SCC and SMC serial ports on Motorola  
>
  

Patch

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 625358f44419..68a9d9db9144 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -769,7 +769,7 @@  config SERIAL_PMACZILOG_CONSOLE
 
 config SERIAL_CPM
 	tristate "CPM SCC/SMC serial port support"
-	depends on CPM2 || CPM1 || (PPC32 && COMPILE_TEST)
+	depends on CPM2 || CPM1 || (PPC32 && CPM2 && COMPILE_TEST)
 	select SERIAL_CORE
 	help
 	  This driver supports the SCC and SMC serial ports on Motorola