Skip to contentSkip to conversation

pxa: fix cpu_is_pxa*() not expanded to zero when not configured

PATCH New Eric Miao 3 participants 4 messages Sep 7, 2010

Subsystems (3)
lore
Share & tools
lore

Eric Miao

author
#0 lore raw

PATCH 1/1 pxa: fix cpu_is_pxa*() not expanded to zero when not configured

Marek,

Could you give this a run?

(quoted diff) +0 -0

b/arch/arm/mach-pxa/include/mach/hardware.h
index 7f64d24..b036500 100644

arch/arm/mach-pxa/include/mach/hardware.h +12 -0
@@ -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()					\
 	({						\
#1 lore raw

PATCH 1/1 pxa: fix cpu_is_pxa*() not expanded to zero when not configured

Dne ?t 7. z??? 2010 06:09:46 Eric Miao napsal(a):

Quoted 3 lines

Marek,

Could you give this a run?

Fixed the problem.

Quoted 42 lines
arch/arm/mach-pxa/include/mach/hardware.h +12 -0
index 7f64d24..b036500 100644
@@ -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()					\
 	({						\
#2 lore raw

PATCH 1/1 pxa: fix cpu_is_pxa*() not expanded to zero when not configured

In reply to Eric Miao

Hello.

Quoted 9 lines · Eric Miao

Could you give this a run?

arch/arm/mach-pxa/include/mach/hardware.h +0 -0
index 7f64d24..b036500 100644
@@ -264,23 +264,35 @@
   *<= 0x2 for pxa21x/pxa25x/pxa26x/pxa27x

arch/arm/mach-pxa/include/mach/hardware.h line 274

Quoted 10 lines
arch/arm/mach-pxa/include/mach/hardware.h +3 -0
   * == 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

author
#3 lore raw

PATCH 1/1 pxa: fix cpu_is_pxa*() not expanded to zero when not configured

Quoted 17 lines · Sergei Shtylyov

Hello.

Quoted 13 lines · Eric Miao

Could you give this a run?

arch/arm/mach-pxa/include/mach/hardware.h +0 -0
index 7f64d24..b036500 100644
@@ -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) ? ? ? ? ? ? ? ? ? ? ? ? ? \

Quoted 9 lines

arch/arm/mach-pxa/include/mach/hardware.h

Quoted 6 lines

? ? ? ?({ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? ? ? ? ? ? ?unsigned int _id = (id)>> ?13& ?0x7; ? ?\
? ? ? ? ? ? ? ?_id<= 0x2; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? ? ? })

arch/arm/mach-pxa/include/mach/hardware.h +2 -0
+#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.

Quoted 2 lines

WBR, Sergei