Skip to contentSkip to conversation

h8300: Register: add prefix "H8_" to IER

PATCH In review Chen Gang 1 participant 3 messages Aug 29, 2013 – Aug 30, 2013

lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH 1/1 h8300: Register: add prefix "H8_" to IER

IER is so common used (e.g. "include/media/saa7146.h", "drivers/isdn /hisax/hisax.h"), need add prefix for it, or it may be overridden (can not pass compiling with allmodconfig for h8300).

The related error:

CC [M] drivers/isdn/hisax/config.o
In file included from arch/h8300/include/asm/io.h:9:0,
from drivers/isdn/hisax/hisax.h:12,
from drivers/isdn/hisax/config.c:21:
arch/h8300/include/asm/regs306x.h:73:14: error: expected identifier or '(' before numeric constant

   #define IER  0xFEE015
                ^
  drivers/isdn/hisax/hisax.h:574:9: note: in expansion of macro 'IER'
    u_char IER;
           ^
---
 arch/h8300/include/asm/irq.h      |    4 ++--
 arch/h8300/include/asm/regs267x.h |    2 +-
 arch/h8300/include/asm/regs306x.h |    2 +-
 arch/h8300/platform/h8300h/irq.c  |    4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)
arch/h8300/include/asm/irq.h +2 -2
index 13d7c60..0964676 100644
@@ -14,7 +14,7 @@
 #define EXT_IRQ6 18
 #define EXT_IRQ7 19
 #define EXT_IRQS 5
-#define IER_REGS *(volatile unsigned char *)IER
+#define IER_REGS *(volatile unsigned char *)H8_IER
 #endif
 #if defined(CONFIG_CPU_H8S)
 #define NR_IRQS 128
@@ -36,7 +36,7 @@
 #define EXT_IRQ15 31
 #define EXT_IRQS 15
 
-#define IER_REGS *(volatile unsigned short *)IER
+#define IER_REGS *(volatile unsigned short *)H8_IER
 #endif
 
 static __inline__ int irq_canonicalize(int irq)
arch/h8300/include/asm/regs267x.h +1 -1
index 1bff731..0137ef0 100644
@@ -131,7 +131,7 @@
 #define ISCRL 0xFFFE1C
 
 #define INTCR 0xFFFF31
-#define IER   0xFFFF32
+#define H8_IER   0xFFFF32
 #define IERH  0xFFFF32
 #define IERL  0xFFFF33
 #define ISR   0xFFFF34
arch/h8300/include/asm/regs306x.h +1 -1
index 027dd63..046bb61 100644
@@ -70,7 +70,7 @@
 #define DTCR1B  0xFFFF3F
 
 #define ISCR 0xFEE014
-#define IER  0xFEE015
+#define H8_IER  0xFEE015
 #define ISR  0xFEE016
 #define IPRA 0xFEE018
 #define IPRB 0xFEE019
arch/h8300/platform/h8300h/irq.c +2 -2
index 0a50353..ae1e01a 100644
@@ -70,12 +70,12 @@ void h8300_disable_irq_pin(unsigned int irq)
 	case EXT_IRQ1:
 	case EXT_IRQ2:
 	case EXT_IRQ3:
-		*(volatile unsigned char *)IER &= ~bitmask;
+		*(volatile unsigned char *)H8_IER &= ~bitmask;
 		H8300_GPIO_FREE(H8300_GPIO_P8, bitmask);
 		break ;
 	case EXT_IRQ4:
 	case EXT_IRQ5:
-		*(volatile unsigned char *)IER &= ~bitmask;
+		*(volatile unsigned char *)H8_IER &= ~bitmask;
 		H8300_GPIO_FREE(H8300_GPIO_P9, bitmask);
 		break;
 	}
Signature · 1 line
1.7.7.6
author
#1 lore raw

All the other h8300 register macros also face the same risk, but not cause compiling error now (but may cause warning -- I did not check the related warnings).

If suitable to change all of them with prefix "H8_", please let me know, I will send the related patch for it.

Thanks.

Quoted 93 lines · Chen Gang

IER is so common used (e.g. "include/media/saa7146.h", "drivers/isdn /hisax/hisax.h"), need add prefix for it, or it may be overridden (can not pass compiling with allmodconfig for h8300).

The related error:

CC [M] drivers/isdn/hisax/config.o
In file included from arch/h8300/include/asm/io.h:9:0,
from drivers/isdn/hisax/hisax.h:12,
from drivers/isdn/hisax/config.c:21:
arch/h8300/include/asm/regs306x.h:73:14: error: expected identifier or '(' before numeric constant

   #define IER  0xFEE015
                ^
  drivers/isdn/hisax/hisax.h:574:9: note: in expansion of macro 'IER'
    u_char IER;
           ^
---
 arch/h8300/include/asm/irq.h      |    4 ++--
 arch/h8300/include/asm/regs267x.h |    2 +-
 arch/h8300/include/asm/regs306x.h |    2 +-
 arch/h8300/platform/h8300h/irq.c  |    4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)
arch/h8300/include/asm/irq.h +2 -2
index 13d7c60..0964676 100644
@@ -14,7 +14,7 @@
 #define EXT_IRQ6 18
 #define EXT_IRQ7 19
 #define EXT_IRQS 5
-#define IER_REGS *(volatile unsigned char *)IER
+#define IER_REGS *(volatile unsigned char *)H8_IER
 #endif
 #if defined(CONFIG_CPU_H8S)
 #define NR_IRQS 128
@@ -36,7 +36,7 @@
 #define EXT_IRQ15 31
 #define EXT_IRQS 15
 
-#define IER_REGS *(volatile unsigned short *)IER
+#define IER_REGS *(volatile unsigned short *)H8_IER
 #endif
 
 static __inline__ int irq_canonicalize(int irq)
arch/h8300/include/asm/regs267x.h +1 -1
index 1bff731..0137ef0 100644
@@ -131,7 +131,7 @@
 #define ISCRL 0xFFFE1C
 
 #define INTCR 0xFFFF31
-#define IER   0xFFFF32
+#define H8_IER   0xFFFF32
 #define IERH  0xFFFF32
 #define IERL  0xFFFF33
 #define ISR   0xFFFF34
arch/h8300/include/asm/regs306x.h +1 -1
index 027dd63..046bb61 100644
@@ -70,7 +70,7 @@
 #define DTCR1B  0xFFFF3F
 
 #define ISCR 0xFEE014
-#define IER  0xFEE015
+#define H8_IER  0xFEE015
 #define ISR  0xFEE016
 #define IPRA 0xFEE018
 #define IPRB 0xFEE019
arch/h8300/platform/h8300h/irq.c +2 -2
index 0a50353..ae1e01a 100644
@@ -70,12 +70,12 @@ void h8300_disable_irq_pin(unsigned int irq)
 	case EXT_IRQ1:
 	case EXT_IRQ2:
 	case EXT_IRQ3:
-		*(volatile unsigned char *)IER &= ~bitmask;
+		*(volatile unsigned char *)H8_IER &= ~bitmask;
 		H8300_GPIO_FREE(H8300_GPIO_P8, bitmask);
 		break ;
 	case EXT_IRQ4:
 	case EXT_IRQ5:
-		*(volatile unsigned char *)IER &= ~bitmask;
+		*(volatile unsigned char *)H8_IER &= ~bitmask;
 		H8300_GPIO_FREE(H8300_GPIO_P9, bitmask);
 		break;
 	}
Signature · 1 line
Chen Gang
author
#2 lore raw
In reply to Chen Gang

For register ISR, also need add prefix, or it will cause issue too.

I will send patch v2 for it (may others also need prefix) after finish allmodconfig.

Thanks.

Quoted 93 lines · Chen Gang

IER is so common used (e.g. "include/media/saa7146.h", "drivers/isdn /hisax/hisax.h"), need add prefix for it, or it may be overridden (can not pass compiling with allmodconfig for h8300).

The related error:

CC [M] drivers/isdn/hisax/config.o
In file included from arch/h8300/include/asm/io.h:9:0,
from drivers/isdn/hisax/hisax.h:12,
from drivers/isdn/hisax/config.c:21:
arch/h8300/include/asm/regs306x.h:73:14: error: expected identifier or '(' before numeric constant

   #define IER  0xFEE015
                ^
  drivers/isdn/hisax/hisax.h:574:9: note: in expansion of macro 'IER'
    u_char IER;
           ^
---
 arch/h8300/include/asm/irq.h      |    4 ++--
 arch/h8300/include/asm/regs267x.h |    2 +-
 arch/h8300/include/asm/regs306x.h |    2 +-
 arch/h8300/platform/h8300h/irq.c  |    4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)
arch/h8300/include/asm/irq.h +2 -2
index 13d7c60..0964676 100644
@@ -14,7 +14,7 @@
 #define EXT_IRQ6 18
 #define EXT_IRQ7 19
 #define EXT_IRQS 5
-#define IER_REGS *(volatile unsigned char *)IER
+#define IER_REGS *(volatile unsigned char *)H8_IER
 #endif
 #if defined(CONFIG_CPU_H8S)
 #define NR_IRQS 128
@@ -36,7 +36,7 @@
 #define EXT_IRQ15 31
 #define EXT_IRQS 15
 
-#define IER_REGS *(volatile unsigned short *)IER
+#define IER_REGS *(volatile unsigned short *)H8_IER
 #endif
 
 static __inline__ int irq_canonicalize(int irq)
arch/h8300/include/asm/regs267x.h +1 -1
index 1bff731..0137ef0 100644
@@ -131,7 +131,7 @@
 #define ISCRL 0xFFFE1C
 
 #define INTCR 0xFFFF31
-#define IER   0xFFFF32
+#define H8_IER   0xFFFF32
 #define IERH  0xFFFF32
 #define IERL  0xFFFF33
 #define ISR   0xFFFF34
arch/h8300/include/asm/regs306x.h +1 -1
index 027dd63..046bb61 100644
@@ -70,7 +70,7 @@
 #define DTCR1B  0xFFFF3F
 
 #define ISCR 0xFEE014
-#define IER  0xFEE015
+#define H8_IER  0xFEE015
 #define ISR  0xFEE016
 #define IPRA 0xFEE018
 #define IPRB 0xFEE019
arch/h8300/platform/h8300h/irq.c +2 -2
index 0a50353..ae1e01a 100644
@@ -70,12 +70,12 @@ void h8300_disable_irq_pin(unsigned int irq)
 	case EXT_IRQ1:
 	case EXT_IRQ2:
 	case EXT_IRQ3:
-		*(volatile unsigned char *)IER &= ~bitmask;
+		*(volatile unsigned char *)H8_IER &= ~bitmask;
 		H8300_GPIO_FREE(H8300_GPIO_P8, bitmask);
 		break ;
 	case EXT_IRQ4:
 	case EXT_IRQ5:
-		*(volatile unsigned char *)IER &= ~bitmask;
+		*(volatile unsigned char *)H8_IER &= ~bitmask;
 		H8300_GPIO_FREE(H8300_GPIO_P9, bitmask);
 		break;
 	}
Signature · 1 line
Chen Gang