diff mbox series

[3/5] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY

Message ID 1583509356-8265-3-git-send-email-Anson.Huang@nxp.com (mailing list archive)
State Rejected
Headers show
Series [1/5] firmware: imx: add COMPILE_TEST support | expand

Commit Message

Anson Huang March 6, 2020, 3:42 p.m. UTC
Add COMPILE_TEST support to i.MX SC keyboard driver for better compile
testing coverage.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 drivers/input/keyboard/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dmitry Torokhov March 6, 2020, 7:33 p.m. UTC | #1
On Fri, Mar 06, 2020 at 11:42:34PM +0800, Anson Huang wrote:
> Add COMPILE_TEST support to i.MX SC keyboard driver for better compile
> testing coverage.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

Applied, thank you.

> ---
>  drivers/input/keyboard/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
> index 4706ff0..81e26f6 100644
> --- a/drivers/input/keyboard/Kconfig
> +++ b/drivers/input/keyboard/Kconfig
> @@ -467,7 +467,7 @@ config KEYBOARD_IMX
>  
>  config KEYBOARD_IMX_SC_KEY
>  	tristate "IMX SCU Key Driver"
> -	depends on IMX_SCU
> +	depends on IMX_SCU || COMPILE_TEST
>  	help
>  	  This is the system controller key driver for NXP i.MX SoCs with
>  	  system controller inside.
> -- 
> 2.7.4
>
Dmitry Torokhov March 6, 2020, 8:05 p.m. UTC | #2
On Fri, Mar 6, 2020 at 11:33 AM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> On Fri, Mar 06, 2020 at 11:42:34PM +0800, Anson Huang wrote:
> > Add COMPILE_TEST support to i.MX SC keyboard driver for better compile
> > testing coverage.
> >
> > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
>
> Applied, thank you.

Actually, not:

ERROR: "imx_scu_irq_register_notifier"
[drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_get_handle" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_call_rpc" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_irq_unregister_notifier"
[drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_irq_group_enable"
[drivers/input/keyboard/imx_sc_key.ko] undefined!
make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
make: *** [Makefile:1282: modules] Error 2

If you want to enable compile test coverage you need to provide stubs
for the above functions.

Thanks.
Alexandre Belloni March 6, 2020, 9:15 p.m. UTC | #3
On 06/03/2020 12:05:42-0800, Dmitry Torokhov wrote:
> On Fri, Mar 6, 2020 at 11:33 AM Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> >
> > On Fri, Mar 06, 2020 at 11:42:34PM +0800, Anson Huang wrote:
> > > Add COMPILE_TEST support to i.MX SC keyboard driver for better compile
> > > testing coverage.
> > >
> > > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> >
> > Applied, thank you.
> 
> Actually, not:
> 
> ERROR: "imx_scu_irq_register_notifier"
> [drivers/input/keyboard/imx_sc_key.ko] undefined!
> ERROR: "imx_scu_get_handle" [drivers/input/keyboard/imx_sc_key.ko] undefined!
> ERROR: "imx_scu_call_rpc" [drivers/input/keyboard/imx_sc_key.ko] undefined!
> ERROR: "imx_scu_irq_unregister_notifier"
> [drivers/input/keyboard/imx_sc_key.ko] undefined!
> ERROR: "imx_scu_irq_group_enable"
> [drivers/input/keyboard/imx_sc_key.ko] undefined!
> make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
> make: *** [Makefile:1282: modules] Error 2
> 
> If you want to enable compile test coverage you need to provide stubs
> for the above functions.
> 

or select IMX_SCU

or leave out COMPILE_TEST from the individual drivers as having
COMPILE_TEST for IMX_SCU is enough to be able to select the drivers.

> Thanks.
> 
> -- 
> Dmitry
Anson Huang March 7, 2020, 12:18 a.m. UTC | #4
Hi, Dmitry

> Subject: Re: [PATCH 3/5] input: keyboard: add COMPILE_TEST support for
> KEYBOARD_IMX_SC_KEY
> 
> On Fri, Mar 6, 2020 at 11:33 AM Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> >
> > On Fri, Mar 06, 2020 at 11:42:34PM +0800, Anson Huang wrote:
> > > Add COMPILE_TEST support to i.MX SC keyboard driver for better
> > > compile testing coverage.
> > >
> > > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> >
> > Applied, thank you.
> 
> Actually, not:
> 
> ERROR: "imx_scu_irq_register_notifier"
> [drivers/input/keyboard/imx_sc_key.ko] undefined!
> ERROR: "imx_scu_get_handle" [drivers/input/keyboard/imx_sc_key.ko]
> undefined!
> ERROR: "imx_scu_call_rpc" [drivers/input/keyboard/imx_sc_key.ko]
> undefined!
> ERROR: "imx_scu_irq_unregister_notifier"
> [drivers/input/keyboard/imx_sc_key.ko] undefined!
> ERROR: "imx_scu_irq_group_enable"
> [drivers/input/keyboard/imx_sc_key.ko] undefined!
> make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
> make: *** [Makefile:1282: modules] Error 2
> 
> If you want to enable compile test coverage you need to provide stubs for
> the above functions.

These i.MX SCU drivers depends on IMX_SCU, I already add the COMPILE_TEST
to IMX_SCU driver as well, that is why I put these patches in a patch series. Maybe
I can add stubs as well to make sure build passed even when IMX_SCU is NOT compiled?
Will send V2 to add stubs, it makes more sense.

Thanks,
Anson
Dmitry Torokhov March 7, 2020, 12:51 a.m. UTC | #5
On Sat, Mar 07, 2020 at 12:18:38AM +0000, Anson Huang wrote:
> Hi, Dmitry
> 
> > Subject: Re: [PATCH 3/5] input: keyboard: add COMPILE_TEST support for
> > KEYBOARD_IMX_SC_KEY
> > 
> > On Fri, Mar 6, 2020 at 11:33 AM Dmitry Torokhov
> > <dmitry.torokhov@gmail.com> wrote:
> > >
> > > On Fri, Mar 06, 2020 at 11:42:34PM +0800, Anson Huang wrote:
> > > > Add COMPILE_TEST support to i.MX SC keyboard driver for better
> > > > compile testing coverage.
> > > >
> > > > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > >
> > > Applied, thank you.
> > 
> > Actually, not:
> > 
> > ERROR: "imx_scu_irq_register_notifier"
> > [drivers/input/keyboard/imx_sc_key.ko] undefined!
> > ERROR: "imx_scu_get_handle" [drivers/input/keyboard/imx_sc_key.ko]
> > undefined!
> > ERROR: "imx_scu_call_rpc" [drivers/input/keyboard/imx_sc_key.ko]
> > undefined!
> > ERROR: "imx_scu_irq_unregister_notifier"
> > [drivers/input/keyboard/imx_sc_key.ko] undefined!
> > ERROR: "imx_scu_irq_group_enable"
> > [drivers/input/keyboard/imx_sc_key.ko] undefined!
> > make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
> > make: *** [Makefile:1282: modules] Error 2
> > 
> > If you want to enable compile test coverage you need to provide stubs for
> > the above functions.
> 
> These i.MX SCU drivers depends on IMX_SCU, I already add the COMPILE_TEST
> to IMX_SCU driver as well, that is why I put these patches in a patch series.

Adding "|| COMPILE_TEST" you are removing hard dependency on IMX_SCU,
which as you can see can result in broken build.

> Maybe
> I can add stubs as well to make sure build passed even when IMX_SCU is NOT compiled?
> Will send V2 to add stubs, it makes more sense.

It is up to you whether you make IMX_SCU buildable with COMPILE_TEST
and leave the sub-driver as is, or add the stubs and make sub-drivers
buildable even without IMX_SCU being present.

Thanks.
Anson Huang March 7, 2020, 1:01 a.m. UTC | #6
Hi, Dmitry

> Subject: Re: [PATCH 3/5] input: keyboard: add COMPILE_TEST support for
> KEYBOARD_IMX_SC_KEY
> 
> On Sat, Mar 07, 2020 at 12:18:38AM +0000, Anson Huang wrote:
> > Hi, Dmitry
> >
> > > Subject: Re: [PATCH 3/5] input: keyboard: add COMPILE_TEST support
> > > for KEYBOARD_IMX_SC_KEY
> > >
> > > On Fri, Mar 6, 2020 at 11:33 AM Dmitry Torokhov
> > > <dmitry.torokhov@gmail.com> wrote:
> > > >
> > > > On Fri, Mar 06, 2020 at 11:42:34PM +0800, Anson Huang wrote:
> > > > > Add COMPILE_TEST support to i.MX SC keyboard driver for better
> > > > > compile testing coverage.
> > > > >
> > > > > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > > >
> > > > Applied, thank you.
> > >
> > > Actually, not:
> > >
> > > ERROR: "imx_scu_irq_register_notifier"
> > > [drivers/input/keyboard/imx_sc_key.ko] undefined!
> > > ERROR: "imx_scu_get_handle" [drivers/input/keyboard/imx_sc_key.ko]
> > > undefined!
> > > ERROR: "imx_scu_call_rpc" [drivers/input/keyboard/imx_sc_key.ko]
> > > undefined!
> > > ERROR: "imx_scu_irq_unregister_notifier"
> > > [drivers/input/keyboard/imx_sc_key.ko] undefined!
> > > ERROR: "imx_scu_irq_group_enable"
> > > [drivers/input/keyboard/imx_sc_key.ko] undefined!
> > > make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
> > > make: *** [Makefile:1282: modules] Error 2
> > >
> > > If you want to enable compile test coverage you need to provide
> > > stubs for the above functions.
> >
> > These i.MX SCU drivers depends on IMX_SCU, I already add the
> > COMPILE_TEST to IMX_SCU driver as well, that is why I put these patches in
> a patch series.
> 
> Adding "|| COMPILE_TEST" you are removing hard dependency on IMX_SCU,
> which as you can see can result in broken build.
> 
> > Maybe
> > I can add stubs as well to make sure build passed even when IMX_SCU is
> NOT compiled?
> > Will send V2 to add stubs, it makes more sense.
> 
> It is up to you whether you make IMX_SCU buildable with COMPILE_TEST and
> leave the sub-driver as is, or add the stubs and make sub-drivers buildable
> even without IMX_SCU being present.

Thank you, I already added COMPILE_TEST to IMX_SCU driver, and I will also add
stubs for those APIs in V2.

Thanks,
Anson
Anson Huang March 7, 2020, 1:36 a.m. UTC | #7
Hi, Alexandre

> Subject: Re: [PATCH 3/5] input: keyboard: add COMPILE_TEST support for
> KEYBOARD_IMX_SC_KEY
> 
> On 06/03/2020 12:05:42-0800, Dmitry Torokhov wrote:
> > On Fri, Mar 6, 2020 at 11:33 AM Dmitry Torokhov
> > <dmitry.torokhov@gmail.com> wrote:
> > >
> > > On Fri, Mar 06, 2020 at 11:42:34PM +0800, Anson Huang wrote:
> > > > Add COMPILE_TEST support to i.MX SC keyboard driver for better
> > > > compile testing coverage.
> > > >
> > > > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > >
> > > Applied, thank you.
> >
> > Actually, not:
> >
> > ERROR: "imx_scu_irq_register_notifier"
> > [drivers/input/keyboard/imx_sc_key.ko] undefined!
> > ERROR: "imx_scu_get_handle" [drivers/input/keyboard/imx_sc_key.ko]
> undefined!
> > ERROR: "imx_scu_call_rpc" [drivers/input/keyboard/imx_sc_key.ko]
> undefined!
> > ERROR: "imx_scu_irq_unregister_notifier"
> > [drivers/input/keyboard/imx_sc_key.ko] undefined!
> > ERROR: "imx_scu_irq_group_enable"
> > [drivers/input/keyboard/imx_sc_key.ko] undefined!
> > make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
> > make: *** [Makefile:1282: modules] Error 2
> >
> > If you want to enable compile test coverage you need to provide stubs
> > for the above functions.
> >
> 
> or select IMX_SCU
> 
> or leave out COMPILE_TEST from the individual drivers as having
> COMPILE_TEST for IMX_SCU is enough to be able to select the drivers.

Thanks, I already added the COMPILE_TEST for IMX_SCU which is in this same patch series,
without that IMX_SCU COMPILE_TEST patch, the build will failed, so in V2, I also added
the stubs into those IMX SCU APIs to make sure even IMX_SCU is NOT enabled, modules
with COMPILE_TEST can still pass build, please help review V2 patch set.

Thanks,
Anson
Alexandre Belloni March 7, 2020, 2:57 a.m. UTC | #8
On 07/03/2020 01:36:39+0000, Anson Huang wrote:
> Hi, Alexandre
> 
> > Subject: Re: [PATCH 3/5] input: keyboard: add COMPILE_TEST support for
> > KEYBOARD_IMX_SC_KEY
> > 
> > On 06/03/2020 12:05:42-0800, Dmitry Torokhov wrote:
> > > On Fri, Mar 6, 2020 at 11:33 AM Dmitry Torokhov
> > > <dmitry.torokhov@gmail.com> wrote:
> > > >
> > > > On Fri, Mar 06, 2020 at 11:42:34PM +0800, Anson Huang wrote:
> > > > > Add COMPILE_TEST support to i.MX SC keyboard driver for better
> > > > > compile testing coverage.
> > > > >
> > > > > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > > >
> > > > Applied, thank you.
> > >
> > > Actually, not:
> > >
> > > ERROR: "imx_scu_irq_register_notifier"
> > > [drivers/input/keyboard/imx_sc_key.ko] undefined!
> > > ERROR: "imx_scu_get_handle" [drivers/input/keyboard/imx_sc_key.ko]
> > undefined!
> > > ERROR: "imx_scu_call_rpc" [drivers/input/keyboard/imx_sc_key.ko]
> > undefined!
> > > ERROR: "imx_scu_irq_unregister_notifier"
> > > [drivers/input/keyboard/imx_sc_key.ko] undefined!
> > > ERROR: "imx_scu_irq_group_enable"
> > > [drivers/input/keyboard/imx_sc_key.ko] undefined!
> > > make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
> > > make: *** [Makefile:1282: modules] Error 2
> > >
> > > If you want to enable compile test coverage you need to provide stubs
> > > for the above functions.
> > >
> > 
> > or select IMX_SCU
> > 
> > or leave out COMPILE_TEST from the individual drivers as having
> > COMPILE_TEST for IMX_SCU is enough to be able to select the drivers.
> 
> Thanks, I already added the COMPILE_TEST for IMX_SCU which is in this same patch series,
> without that IMX_SCU COMPILE_TEST patch, the build will failed, so in V2, I also added
> the stubs into those IMX SCU APIs to make sure even IMX_SCU is NOT enabled, modules
> with COMPILE_TEST can still pass build, please help review V2 patch set.
> 

My point is that there is no need for the stubs. Simply have
COMPILE_TEST for IMX_SCU as this is enough to extend coverage to all the
drivers and significantly reduces the code size versus what you did in
v2.
Anson Huang March 7, 2020, 3:33 a.m. UTC | #9
Hi, Alexandre

> Subject: Re: [PATCH 3/5] input: keyboard: add COMPILE_TEST support for
> KEYBOARD_IMX_SC_KEY
> 
> On 07/03/2020 01:36:39+0000, Anson Huang wrote:
> > Hi, Alexandre
> >
> > > Subject: Re: [PATCH 3/5] input: keyboard: add COMPILE_TEST support
> > > for KEYBOARD_IMX_SC_KEY
> > >
> > > On 06/03/2020 12:05:42-0800, Dmitry Torokhov wrote:
> > > > On Fri, Mar 6, 2020 at 11:33 AM Dmitry Torokhov
> > > > <dmitry.torokhov@gmail.com> wrote:
> > > > >
> > > > > On Fri, Mar 06, 2020 at 11:42:34PM +0800, Anson Huang wrote:
> > > > > > Add COMPILE_TEST support to i.MX SC keyboard driver for better
> > > > > > compile testing coverage.
> > > > > >
> > > > > > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > > > >
> > > > > Applied, thank you.
> > > >
> > > > Actually, not:
> > > >
> > > > ERROR: "imx_scu_irq_register_notifier"
> > > > [drivers/input/keyboard/imx_sc_key.ko] undefined!
> > > > ERROR: "imx_scu_get_handle" [drivers/input/keyboard/imx_sc_key.ko]
> > > undefined!
> > > > ERROR: "imx_scu_call_rpc" [drivers/input/keyboard/imx_sc_key.ko]
> > > undefined!
> > > > ERROR: "imx_scu_irq_unregister_notifier"
> > > > [drivers/input/keyboard/imx_sc_key.ko] undefined!
> > > > ERROR: "imx_scu_irq_group_enable"
> > > > [drivers/input/keyboard/imx_sc_key.ko] undefined!
> > > > make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
> > > > make: *** [Makefile:1282: modules] Error 2
> > > >
> > > > If you want to enable compile test coverage you need to provide
> > > > stubs for the above functions.
> > > >
> > >
> > > or select IMX_SCU
> > >
> > > or leave out COMPILE_TEST from the individual drivers as having
> > > COMPILE_TEST for IMX_SCU is enough to be able to select the drivers.
> >
> > Thanks, I already added the COMPILE_TEST for IMX_SCU which is in this
> > same patch series, without that IMX_SCU COMPILE_TEST patch, the build
> > will failed, so in V2, I also added the stubs into those IMX SCU APIs
> > to make sure even IMX_SCU is NOT enabled, modules with COMPILE_TEST
> can still pass build, please help review V2 patch set.
> >
> 
> My point is that there is no need for the stubs. Simply have COMPILE_TEST
> for IMX_SCU as this is enough to extend coverage to all the drivers and
> significantly reduces the code size versus what you did in v2.

OK, then I think V1 patch set is already what you expected, patch 1/5 adds the COMPILE_TEST
for IMX_SCU. I think maintainers can just pick up the V1 patch set.

Thanks,
Anson
diff mbox series

Patch

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 4706ff0..81e26f6 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -467,7 +467,7 @@  config KEYBOARD_IMX
 
 config KEYBOARD_IMX_SC_KEY
 	tristate "IMX SCU Key Driver"
-	depends on IMX_SCU
+	depends on IMX_SCU || COMPILE_TEST
 	help
 	  This is the system controller key driver for NXP i.MX SoCs with
 	  system controller inside.