[PATCH] ARM: imx: build cpu_is_imx6sl function conditionally

Shawn Guo shawn.guo at freescale.com
Thu Jul 3 18:59:51 PDT 2014


On Thu, Jul 03, 2014 at 09:51:54PM +0400, Sergei Shtylyov wrote:
> >@@ -156,7 +156,11 @@ extern unsigned int __mxc_cpu_type;
> >  #ifndef __ASSEMBLY__
> >  static inline bool cpu_is_imx6sl(void)
> >  {
> >+#ifdef CONFIG_SOC_IMX6SL
> >  	return __mxc_cpu_type == MXC_CPU_IMX6SL;
> >+#else
> >+	return 0;
> 
>    s/0/false/.
> 
> >+#endif
> 
>    Also, #ifdef's in a function body are ugly.

Okay, I fixed it up as below.

#ifdef CONFIG_SOC_IMX6SL
static inline bool cpu_is_imx6sl(void)
{
        return __mxc_cpu_type == MXC_CPU_IMX6SL;
}
#else
static inline bool cpu_is_imx6sl(void)
{
        return false;
}
#endif

Shawn



More information about the linux-arm-kernel mailing list