linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pxa: fix cpu_is_pxa*() not expanded to zero when not configured
@ 2010-09-07  4:09 Eric Miao
  2010-09-07  4:13 ` Marek Vasut
  2010-09-07  9:35 ` Sergei Shtylyov
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Miao @ 2010-09-07  4:09 UTC (permalink / raw)
  To: linux-arm-kernel

Marek,

Could you give this a run?

diff --git a/arch/arm/mach-pxa/include/mach/hardware.h
b/arch/arm/mach-pxa/include/mach/hardware.h
index 7f64d24..b036500 100644
--- a/arch/arm/mach-pxa/include/mach/hardware.h
+++ b/arch/arm/mach-pxa/include/mach/hardware.h
@@ -264,23 +264,35 @@
  * <= 0x2 for pxa21x/pxa25x/pxa26x/pxa27x
  * == 0x3 for pxa300/pxa310/pxa320
  */
+#if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x)
 #define __cpu_is_pxa2xx(id)				\
 	({						\
 		unsigned int _id = (id) >> 13 & 0x7;	\
 		_id <= 0x2;				\
 	 })
+#else
+#define __cpu_is_pxa2xx(id)	(0)
+#endif

+#ifdef CONFIG_PXA3xx
 #define __cpu_is_pxa3xx(id)				\
 	({						\
 		unsigned int _id = (id) >> 13 & 0x7;	\
 		_id == 0x3;				\
 	 })
+#else
+#define __cpu_is_pxa3xx(id)	(0)
+#endif

+#if defined(CONFIG_CPU_PXA930) || defined(CONFIG_CPU_PXA935)
 #define __cpu_is_pxa93x(id)				\
 	({						\
 		unsigned int _id = (id) >> 4 & 0xfff;	\
 		_id == 0x683 || _id == 0x693;		\
 	 })
+#else
+#define __cpu_is_pxa93x(id)	(0)
+#endif

 #define cpu_is_pxa2xx()					\
 	({						\

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

* [PATCH] pxa: fix cpu_is_pxa*() not expanded to zero when not configured
  2010-09-07  4:09 [PATCH] pxa: fix cpu_is_pxa*() not expanded to zero when not configured Eric Miao
@ 2010-09-07  4:13 ` Marek Vasut
  2010-09-07  9:35 ` Sergei Shtylyov
  1 sibling, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2010-09-07  4:13 UTC (permalink / raw)
  To: linux-arm-kernel

Dne ?t 7. z??? 2010 06:09:46 Eric Miao napsal(a):
> Marek,
> 
> Could you give this a run?

Fixed the problem.

Tested-by: Marek Vasut <marek.vasut@gmail.com>
> 
> diff --git a/arch/arm/mach-pxa/include/mach/hardware.h
> b/arch/arm/mach-pxa/include/mach/hardware.h
> index 7f64d24..b036500 100644
> --- a/arch/arm/mach-pxa/include/mach/hardware.h
> +++ b/arch/arm/mach-pxa/include/mach/hardware.h
> @@ -264,23 +264,35 @@
>   * <= 0x2 for pxa21x/pxa25x/pxa26x/pxa27x
>   * == 0x3 for pxa300/pxa310/pxa320
>   */
> +#if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x)
>  #define __cpu_is_pxa2xx(id)				\
>  	({						\
>  		unsigned int _id = (id) >> 13 & 0x7;	\
>  		_id <= 0x2;				\
>  	 })
> +#else
> +#define __cpu_is_pxa2xx(id)	(0)
> +#endif
> 
> +#ifdef CONFIG_PXA3xx
>  #define __cpu_is_pxa3xx(id)				\
>  	({						\
>  		unsigned int _id = (id) >> 13 & 0x7;	\
>  		_id == 0x3;				\
>  	 })
> +#else
> +#define __cpu_is_pxa3xx(id)	(0)
> +#endif
> 
> +#if defined(CONFIG_CPU_PXA930) || defined(CONFIG_CPU_PXA935)
>  #define __cpu_is_pxa93x(id)				\
>  	({						\
>  		unsigned int _id = (id) >> 4 & 0xfff;	\
>  		_id == 0x683 || _id == 0x693;		\
>  	 })
> +#else
> +#define __cpu_is_pxa93x(id)	(0)
> +#endif
> 
>  #define cpu_is_pxa2xx()					\
>  	({						\

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

* [PATCH] pxa: fix cpu_is_pxa*() not expanded to zero when not configured
  2010-09-07  4:09 [PATCH] pxa: fix cpu_is_pxa*() not expanded to zero when not configured Eric Miao
  2010-09-07  4:13 ` Marek Vasut
@ 2010-09-07  9:35 ` Sergei Shtylyov
  2010-09-07  9:48   ` Eric Miao
  1 sibling, 1 reply; 4+ messages in thread
From: Sergei Shtylyov @ 2010-09-07  9:35 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 07-09-2010 8:09, Eric Miao wrote:

> Could you give this a run?

> diff --git a/arch/arm/mach-pxa/include/mach/hardware.h
> b/arch/arm/mach-pxa/include/mach/hardware.h
> index 7f64d24..b036500 100644
> --- a/arch/arm/mach-pxa/include/mach/hardware.h
> +++ b/arch/arm/mach-pxa/include/mach/hardware.h
> @@ -264,23 +264,35 @@
>    *<= 0x2 for pxa21x/pxa25x/pxa26x/pxa27x
>    * == 0x3 for pxa300/pxa310/pxa320
>    */
> +#if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x)
>   #define __cpu_is_pxa2xx(id)				\
>   	({						\
>   		unsigned int _id = (id)>>  13&  0x7;	\
>   		_id<= 0x2;				\
>   	 })
> +#else
> +#define __cpu_is_pxa2xx(id)	(0)

    Why enclose 0 in parens?

WBR, Sergei

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

* [PATCH] pxa: fix cpu_is_pxa*() not expanded to zero when not configured
  2010-09-07  9:35 ` Sergei Shtylyov
@ 2010-09-07  9:48   ` Eric Miao
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Miao @ 2010-09-07  9:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Sep 7, 2010 at 5:35 PM, Sergei Shtylyov <sshtylyov@mvista.com> wrote:
> Hello.
>
> On 07-09-2010 8:09, Eric Miao wrote:
>
>> Could you give this a run?
>
>> diff --git a/arch/arm/mach-pxa/include/mach/hardware.h
>> b/arch/arm/mach-pxa/include/mach/hardware.h
>> index 7f64d24..b036500 100644
>> --- a/arch/arm/mach-pxa/include/mach/hardware.h
>> +++ b/arch/arm/mach-pxa/include/mach/hardware.h
>> @@ -264,23 +264,35 @@
>> ? *<= 0x2 for pxa21x/pxa25x/pxa26x/pxa27x
>> ? * == 0x3 for pxa300/pxa310/pxa320
>> ? */
>> +#if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x)
>> ?#define __cpu_is_pxa2xx(id) ? ? ? ? ? ? ? ? ? ? ? ? ? \
>> ? ? ? ?({ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
>> ? ? ? ? ? ? ? ?unsigned int _id = (id)>> ?13& ?0x7; ? ?\
>> ? ? ? ? ? ? ? ?_id<= 0x2; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
>> ? ? ? ? })
>> +#else
>> +#define __cpu_is_pxa2xx(id) ? ?(0)
>
> ? Why enclose 0 in parens?
>

Just one of some coding style habits. Constant in parens in #define
will always be a bit safer.

> WBR, Sergei
>

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

end of thread, other threads:[~2010-09-07  9:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-07  4:09 [PATCH] pxa: fix cpu_is_pxa*() not expanded to zero when not configured Eric Miao
2010-09-07  4:13 ` Marek Vasut
2010-09-07  9:35 ` Sergei Shtylyov
2010-09-07  9:48   ` Eric Miao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).