[PATCH] soc: imx: Kconfig: force using OF when COMPILE_TEST

Shawn Guo shawnguo at kernel.org
Tue Jun 23 08:16:28 EDT 2020


On Wed, Jun 17, 2020 at 02:05:33AM +0000, Peng Fan wrote:
> > Subject: Re: [PATCH] soc: imx: Kconfig: force using OF when COMPILE_TEST
> > 
> > On 2020-06-16 16:59, Uwe Kleine-König wrote:
> > > On Mon, Jun 15, 2020 at 06:21:25PM +0800, peng.fan at nxp.com wrote:
> > >> From: Peng Fan <peng.fan at nxp.com>
> > >>
> > >> Fix the build warning with x86_64-randconfig
> > >>>> drivers/soc/imx/soc-imx8m.c:150:34: warning: unused variable
> > >>>> 'imx8_soc_match' [-Wunused-const-variable]
> > >> static const struct of_device_id imx8_soc_match[] = { ^
> > >>
> > >> Fixes: fc40200ebf82 ("soc: imx: increase build coverage for imx8m soc
> > >> driver")
> > >> Reported-by: kernel test robot <lkp at intel.com>
> > >> Signed-off-by: Peng Fan <peng.fan at nxp.com>
> > >> ---
> > >>   drivers/soc/imx/Kconfig | 2 +-
> > >>   1 file changed, 1 insertion(+), 1 deletion(-)
> > >>
> > >> diff --git a/drivers/soc/imx/Kconfig b/drivers/soc/imx/Kconfig index
> > >> d515d2cc20ed..aadf13c9d396 100644
> > >> --- a/drivers/soc/imx/Kconfig
> > >> +++ b/drivers/soc/imx/Kconfig
> > >> @@ -19,7 +19,7 @@ config IMX_SCU_SOC
> > >>
> > >>   config SOC_IMX8M
> > >>   	bool "i.MX8M SoC family support"
> > >> -	depends on ARCH_MXC || COMPILE_TEST
> > >> +	depends on ARCH_MXC || (COMPILE_TEST && OF)
> > >
> > > A bit prettier (IMHO) would be:
> > >
> > > config SOC_IMX8M
> > >   	bool "i.MX8M SoC family support"
> > >   	depends on ARCH_MXC || COMPILE_TEST
> > > +	depends on OF
> > >   	default ARCH_MXC && ARM64
> > >   	select SOC_BUS
> > >   	help
> > 
> > That's not just prettier, it's logically correct. If some code needs OF to build
> > correctly, then it depends on OF, regardless of *why* it's being built at any
> > given time.
> > 
> > That said, if the only issue in this particular case is the warning above, then it's
> > hardly a real dependency; simply marking the of_device_id data as
> > __maybe_unused (like various other drivers do) should suffice. Limiting
> > COMPILE_TEST coverage instead of actually fixing simple issues that it
> > exposes seems a bit backwards...
> 
> ok, I'll use __maybe_unused in v2,

Has v2 been posted, or am I missing it?

Shawn

> but it actually not make sense to compile
> this file for x86_64.



More information about the linux-arm-kernel mailing list