Skip to content

Commit 30b5e6e

Browse files
committed
m68k: atari: Make Atari ROM port I/O write macros return void
The macros implementing Atari ROM port I/O writes do not cast away their output, unlike similar implementations for other I/O buses. When they are combined using conditional expressions in the definitions of outb() and friends, this triggers sparse warnings like: drivers/net/appletalk/cops.c:382:17: error: incompatible types in conditional expression (different base types): drivers/net/appletalk/cops.c:382:17: unsigned char drivers/net/appletalk/cops.c:382:17: void Fix this by adding casts to "void". Reported-by: kernel test robot <[email protected]> Reported-by: Guenter Roeck <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Reviewed-by: Michael Schmitz <[email protected]> Link: https://lore.kernel.org/r/c15bedc83d90a14fffcd5b1b6bfb32b8a80282c5.1653057096.git.geert@linux-m68k.org
1 parent ed6bc6b commit 30b5e6e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/m68k/include/asm/raw_io.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@
8080
({ u16 __v = le16_to_cpu(*(__force volatile u16 *) (addr)); __v; })
8181

8282
#define rom_out_8(addr, b) \
83-
({u8 __maybe_unused __w, __v = (b); u32 _addr = ((u32) (addr)); \
83+
(void)({u8 __maybe_unused __w, __v = (b); u32 _addr = ((u32) (addr)); \
8484
__w = ((*(__force volatile u8 *) ((_addr | 0x10000) + (__v<<1)))); })
8585
#define rom_out_be16(addr, w) \
86-
({u16 __maybe_unused __w, __v = (w); u32 _addr = ((u32) (addr)); \
86+
(void)({u16 __maybe_unused __w, __v = (w); u32 _addr = ((u32) (addr)); \
8787
__w = ((*(__force volatile u16 *) ((_addr & 0xFFFF0000UL) + ((__v & 0xFF)<<1)))); \
8888
__w = ((*(__force volatile u16 *) ((_addr | 0x10000) + ((__v >> 8)<<1)))); })
8989
#define rom_out_le16(addr, w) \
90-
({u16 __maybe_unused __w, __v = (w); u32 _addr = ((u32) (addr)); \
90+
(void)({u16 __maybe_unused __w, __v = (w); u32 _addr = ((u32) (addr)); \
9191
__w = ((*(__force volatile u16 *) ((_addr & 0xFFFF0000UL) + ((__v >> 8)<<1)))); \
9292
__w = ((*(__force volatile u16 *) ((_addr | 0x10000) + ((__v & 0xFF)<<1)))); })
9393

0 commit comments

Comments
 (0)