All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: imx: build cpu_is_imx6sl function conditionally
@ 2014-07-03 14:22 Arnd Bergmann
  2014-07-03 14:35 ` Shawn Guo
  2014-07-03 17:51 ` Sergei Shtylyov
  0 siblings, 2 replies; 4+ messages in thread
From: Arnd Bergmann @ 2014-07-03 14:22 UTC (permalink / raw)
  To: linux-arm-kernel

imx6q_pm_enter calls imx6sl_set_wait_clk when run on an imx6sl
based machine. However if support for imx6sl is not enabled
at compile time, this prevents us from building the kernel and
we get this link error instead:

arch/arm/mach-imx/built-in.o: In function `imx6q_pm_enter':
:(.text+0x4b84): undefined reference to `imx6sl_set_wait_clk'

This makes the cpu_is_imx6sl function conditionally return false
if imx6sl is disabled at compile-time, which matches what the
older cpu_is_mx* macros did. We have similar inline functions for
the other imx6 variants, but so far I have not run into a case
where the extra #ifdef is necessary.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/arch/arm/mach-imx/mxc.h b/arch/arm/mach-imx/mxc.h
index 75d6a37..b03b808 100644
--- a/arch/arm/mach-imx/mxc.h
+++ b/arch/arm/mach-imx/mxc.h
@@ -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;
+#endif
 }
 
 static inline bool cpu_is_imx6dl(void)

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] ARM: imx: build cpu_is_imx6sl function conditionally
  2014-07-03 14:22 [PATCH] ARM: imx: build cpu_is_imx6sl function conditionally Arnd Bergmann
@ 2014-07-03 14:35 ` Shawn Guo
  2014-07-03 17:51 ` Sergei Shtylyov
  1 sibling, 0 replies; 4+ messages in thread
From: Shawn Guo @ 2014-07-03 14:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jul 03, 2014 at 04:22:54PM +0200, Arnd Bergmann wrote:
> imx6q_pm_enter calls imx6sl_set_wait_clk when run on an imx6sl
> based machine. However if support for imx6sl is not enabled
> at compile time, this prevents us from building the kernel and
> we get this link error instead:
> 
> arch/arm/mach-imx/built-in.o: In function `imx6q_pm_enter':
> :(.text+0x4b84): undefined reference to `imx6sl_set_wait_clk'
> 
> This makes the cpu_is_imx6sl function conditionally return false
> if imx6sl is disabled at compile-time, which matches what the
> older cpu_is_mx* macros did. We have similar inline functions for
> the other imx6 variants, but so far I have not run into a case
> where the extra #ifdef is necessary.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ARM: imx: build cpu_is_imx6sl function conditionally
  2014-07-03 14:22 [PATCH] ARM: imx: build cpu_is_imx6sl function conditionally Arnd Bergmann
  2014-07-03 14:35 ` Shawn Guo
@ 2014-07-03 17:51 ` Sergei Shtylyov
  2014-07-04  1:59   ` Shawn Guo
  1 sibling, 1 reply; 4+ messages in thread
From: Sergei Shtylyov @ 2014-07-03 17:51 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 07/03/2014 06:22 PM, Arnd Bergmann wrote:

> imx6q_pm_enter calls imx6sl_set_wait_clk when run on an imx6sl
> based machine. However if support for imx6sl is not enabled
> at compile time, this prevents us from building the kernel and
> we get this link error instead:

> arch/arm/mach-imx/built-in.o: In function `imx6q_pm_enter':
> :(.text+0x4b84): undefined reference to `imx6sl_set_wait_clk'

> This makes the cpu_is_imx6sl function conditionally return false
> if imx6sl is disabled at compile-time, which matches what the
> older cpu_is_mx* macros did. We have similar inline functions for
> the other imx6 variants, but so far I have not run into a case
> where the extra #ifdef is necessary.

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

> diff --git a/arch/arm/mach-imx/mxc.h b/arch/arm/mach-imx/mxc.h
> index 75d6a37..b03b808 100644
> --- a/arch/arm/mach-imx/mxc.h
> +++ b/arch/arm/mach-imx/mxc.h
> @@ -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.

>   }

WBR, Sergei

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ARM: imx: build cpu_is_imx6sl function conditionally
  2014-07-03 17:51 ` Sergei Shtylyov
@ 2014-07-04  1:59   ` Shawn Guo
  0 siblings, 0 replies; 4+ messages in thread
From: Shawn Guo @ 2014-07-04  1:59 UTC (permalink / raw)
  To: linux-arm-kernel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-04  1:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-03 14:22 [PATCH] ARM: imx: build cpu_is_imx6sl function conditionally Arnd Bergmann
2014-07-03 14:35 ` Shawn Guo
2014-07-03 17:51 ` Sergei Shtylyov
2014-07-04  1:59   ` Shawn Guo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.