2023-05-23 09:00:48

by Herve Codina

[permalink] [raw]
Subject: [PATCH v2 2/2] serial: cpm_uart: Fix a COMPILE_TEST dependency

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.

This lead to:
depends on CPM2 || CPM1 || (PPC32 && CPM2 && COMPILE_TEST)

This dependency does not make sense anymore and can be simplified
removing all the COMPILE_TEST part.

Signed-off-by: Herve Codina <[email protected]>
Reported-by: kernel test robot <[email protected]>
Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Fixes: e3e7b13bffae ("serial: allow COMPILE_TEST for some drivers")
---
drivers/tty/serial/Kconfig | 2 +-
drivers/tty/serial/cpm_uart/cpm_uart.h | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 625358f44419..de092bc1289e 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
select SERIAL_CORE
help
This driver supports the SCC and SMC serial ports on Motorola
diff --git a/drivers/tty/serial/cpm_uart/cpm_uart.h b/drivers/tty/serial/cpm_uart/cpm_uart.h
index 0577618e78c0..46c03ed71c31 100644
--- a/drivers/tty/serial/cpm_uart/cpm_uart.h
+++ b/drivers/tty/serial/cpm_uart/cpm_uart.h
@@ -19,8 +19,6 @@ struct gpio_desc;
#include "cpm_uart_cpm2.h"
#elif defined(CONFIG_CPM1)
#include "cpm_uart_cpm1.h"
-#elif defined(CONFIG_COMPILE_TEST)
-#include "cpm_uart_cpm2.h"
#endif

#define SERIAL_CPM_MAJOR 204
--
2.40.1



2023-05-23 09:16:18

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] serial: cpm_uart: Fix a COMPILE_TEST dependency

On 23. 05. 23, 10:59, 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.
>
> This lead to:
> depends on CPM2 || CPM1 || (PPC32 && CPM2 && COMPILE_TEST)
>
> This dependency does not make sense anymore and can be simplified
> removing all the COMPILE_TEST part.

Then it's the same as my revert:
https://lore.kernel.org/all/[email protected]/

:D

But nevermind.

> Signed-off-by: Herve Codina <[email protected]>
> Reported-by: kernel test robot <[email protected]>
> Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/
> Fixes: e3e7b13bffae ("serial: allow COMPILE_TEST for some drivers")
> ---
> drivers/tty/serial/Kconfig | 2 +-
> drivers/tty/serial/cpm_uart/cpm_uart.h | 2 --
> 2 files changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
> index 625358f44419..de092bc1289e 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
> select SERIAL_CORE
> help
> This driver supports the SCC and SMC serial ports on Motorola
> diff --git a/drivers/tty/serial/cpm_uart/cpm_uart.h b/drivers/tty/serial/cpm_uart/cpm_uart.h
> index 0577618e78c0..46c03ed71c31 100644
> --- a/drivers/tty/serial/cpm_uart/cpm_uart.h
> +++ b/drivers/tty/serial/cpm_uart/cpm_uart.h
> @@ -19,8 +19,6 @@ struct gpio_desc;
> #include "cpm_uart_cpm2.h"
> #elif defined(CONFIG_CPM1)
> #include "cpm_uart_cpm1.h"
> -#elif defined(CONFIG_COMPILE_TEST)
> -#include "cpm_uart_cpm2.h"
> #endif
>
> #define SERIAL_CPM_MAJOR 204

--
js
suse labs


2023-05-23 09:42:42

by Herve Codina

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] serial: cpm_uart: Fix a COMPILE_TEST dependency

On Tue, 23 May 2023 11:13:02 +0200
Jiri Slaby <[email protected]> wrote:

> On 23. 05. 23, 10:59, 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.
> >
> > This lead to:
> > depends on CPM2 || CPM1 || (PPC32 && CPM2 && COMPILE_TEST)
> >
> > This dependency does not make sense anymore and can be simplified
> > removing all the COMPILE_TEST part.
>
> Then it's the same as my revert:
> https://lore.kernel.org/all/[email protected]/
>
> :D
>
> But nevermind.

Sorry, I didn't look at your revert.

Do you want a new iteration adding (same as your revert) ?
Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
Reported-by: Randy Dunlap <[email protected]>
Reported-by: Stephen Rothwell <[email protected]>

Best regards,
Hervé

>
> > Signed-off-by: Herve Codina <[email protected]>
> > Reported-by: kernel test robot <[email protected]>
> > Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/
> > Fixes: e3e7b13bffae ("serial: allow COMPILE_TEST for some drivers")
> > ---
> > drivers/tty/serial/Kconfig | 2 +-
> > drivers/tty/serial/cpm_uart/cpm_uart.h | 2 --
> > 2 files changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
> > index 625358f44419..de092bc1289e 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
> > select SERIAL_CORE
> > help
> > This driver supports the SCC and SMC serial ports on Motorola
> > diff --git a/drivers/tty/serial/cpm_uart/cpm_uart.h b/drivers/tty/serial/cpm_uart/cpm_uart.h
> > index 0577618e78c0..46c03ed71c31 100644
> > --- a/drivers/tty/serial/cpm_uart/cpm_uart.h
> > +++ b/drivers/tty/serial/cpm_uart/cpm_uart.h
> > @@ -19,8 +19,6 @@ struct gpio_desc;
> > #include "cpm_uart_cpm2.h"
> > #elif defined(CONFIG_CPM1)
> > #include "cpm_uart_cpm1.h"
> > -#elif defined(CONFIG_COMPILE_TEST)
> > -#include "cpm_uart_cpm2.h"
> > #endif
> >
> > #define SERIAL_CPM_MAJOR 204
>