Skip to contentSkip to conversation

parisc: io: Improve the outb(), outw() and outl() macros

PATCH Bart Van Assche 2 participants 2 messages Jan 5, 2022 – Jan 6, 2022 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 37 lines · Bart Van Assche

This patch fixes the following build error for source file drivers/scsi/pcmcia/sym53c500_cs.c:

In file included from ./include/linux/bug.h:5,

                  from ./include/linux/cpumask.h:14,
                  from ./include/linux/mm_types_task.h:14,
                  from ./include/linux/mm_types.h:5,
                  from ./include/linux/buildid.h:5,
                  from ./include/linux/module.h:14,
                  from drivers/scsi/pcmcia/sym53c500_cs.c:42:
drivers/scsi/pcmcia/sym53c500_cs.c: In function ‘SYM53C500_intr’:
./arch/parisc/include/asm/bug.h:28:2: error: expected expression before ‘do’
    28 |  do {        \
       |  ^~

./arch/parisc/include/asm/io.h:276:20: note: in expansion of macro ‘BUG’
276 | #define outb(x, y) BUG()
| ^~~
drivers/scsi/pcmcia/sym53c500_cs.c:124:19: note: in expansion of macro ‘outb’
124 | #define REG0(x) (outb(C4_IMG, (x) + CONFIG4))
| ^~~~
drivers/scsi/pcmcia/sym53c500_cs.c:362:2: note: in expansion of macro ‘REG0’

   362 |  REG0(port_base);
       |  ^~~~
---
  arch/parisc/include/asm/io.h | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
arch/parisc/include/asm/io.h +0 -0
index 0b5259102319..837ddddbac6a 100644
@@ -273,9 +273,9 @@ static inline int inl(unsigned long addr)
  	return -1;
  }

arch/parisc/include/asm/io.h static inline int inl(unsigned long addr) · line 281

Quoted 10 lines
arch/parisc/include/asm/io.h +3 -3
 
-#define outb(x, y)	BUG()
-#define outw(x, y)	BUG()
-#define outl(x, y)	BUG()
+#define outb(x, y)	({(void)(x); (void)(y); BUG(); 0;})
+#define outw(x, y)	({(void)(x); (void)(y); BUG(); 0;})
+#define outl(x, y)	({(void)(x); (void)(y); BUG(); 0;})
  #endif
 
  /*

(+Helge Deller and linux-parisc)

Ping?

#2 lore raw
Quoted 49 lines · Bart Van Assche
Quoted 35 lines · Bart Van Assche

This patch fixes the following build error for source file drivers/scsi/pcmcia/sym53c500_cs.c:

In file included from ./include/linux/bug.h:5,
                  from ./include/linux/cpumask.h:14,
                  from ./include/linux/mm_types_task.h:14,
                  from ./include/linux/mm_types.h:5,
                  from ./include/linux/buildid.h:5,
                  from ./include/linux/module.h:14,
                  from drivers/scsi/pcmcia/sym53c500_cs.c:42:
drivers/scsi/pcmcia/sym53c500_cs.c: In function ‘SYM53C500_intr’:
./arch/parisc/include/asm/bug.h:28:2: error: expected expression before ‘do’ 28 |  do {        \
       |  ^~
./arch/parisc/include/asm/io.h:276:20: note: in expansion of macro ‘BUG’ 276 | #define outb(x, y) BUG()
       |                    ^~~ drivers/scsi/pcmcia/sym53c500_cs.c:124:19: note: in expansion of macro ‘outb’ 124 | #define REG0(x)  (outb(C4_IMG, (x) + CONFIG4))
       |                   ^~~~ drivers/scsi/pcmcia/sym53c500_cs.c:362:2: note: in expansion of macro ‘REG0’ 362 |  REG0(port_base);
       |  ^~~~

---
  arch/parisc/include/asm/io.h | 6 +++---

  1 file changed, 3 insertions(+), 3 deletions(-)
arch/parisc/include/asm/io.h +0 -0
index 0b5259102319..837ddddbac6a 100644
@@ -273,9 +273,9 @@ static inline int inl(unsigned long addr)
       return -1;

arch/parisc/include/asm/io.h static inline int inl(unsigned long addr) · line 281

Quoted 10 lines
arch/parisc/include/asm/io.h +3 -2
   }
   -#define outb(x, y)    BUG()
-#define outw(x, y)    BUG()
-#define outl(x, y)    BUG()
+#define outb(x, y)    ({(void)(x); (void)(y); BUG(); 0;})
+#define outw(x, y)    ({(void)(x); (void)(y); BUG(); 0;})
+#define outl(x, y)    ({(void)(x); (void)(y); BUG(); 0;})
   #endif
     /*
 

(+Helge Deller and linux-parisc)

Quoted 1 line

Ping?

I fail to find the original patch mail in the archives....
Can you please resend it (not forward inlined) to the [email protected] mailing list, then it shows up in patchwork [*] and I can apply it to the for-next tree.

Helge

[*] https://patchwork.kernel.org/project/linux-parisc/list/