Skip to contentSkip to conversation

m68k - annotate dummy read in Atari ROM port IO code as __maybe_unused

PATCH In review Michael Schmitz 2 participants 2 messages May 30, 2020 – Jun 29, 2020 m68k architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 m68k - annotate dummy read in Atari ROM port IO code as __maybe_unused

The Atari ROM port IO code uses dummy variables to implement writes (not supported by the hardware) as reads that encode the write data in part of the address. The value read from the ROM port in this operation is discarded.

Annotate dummy variables as __maybe_unused to avoid a compiler warning.

---
 arch/m68k/include/asm/raw_io.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
arch/m68k/include/asm/raw_io.h +3 -3
index 8a6dc6e..911826e 100644
@@ -80,14 +80,14 @@
 	({ u16 __v = le16_to_cpu(*(__force volatile u16 *) (addr)); __v; })
 
 #define rom_out_8(addr, b)	\
-	({u8 __w, __v = (b);  u32 _addr = ((u32) (addr)); \
+	({u8 __maybe_unused __w, __v = (b);  u32 _addr = ((u32) (addr)); \
 	__w = ((*(__force volatile u8 *)  ((_addr | 0x10000) + (__v<<1)))); })
 #define rom_out_be16(addr, w)	\
-	({u16 __w, __v = (w); u32 _addr = ((u32) (addr)); \
+	({u16 __maybe_unused __w, __v = (w); u32 _addr = ((u32) (addr)); \
 	__w = ((*(__force volatile u16 *) ((_addr & 0xFFFF0000UL) + ((__v & 0xFF)<<1)))); \
 	__w = ((*(__force volatile u16 *) ((_addr | 0x10000) + ((__v >> 8)<<1)))); })
 #define rom_out_le16(addr, w)	\
-	({u16 __w, __v = (w); u32 _addr = ((u32) (addr)); \
+	({u16 __maybe_unused __w, __v = (w); u32 _addr = ((u32) (addr)); \
 	__w = ((*(__force volatile u16 *) ((_addr & 0xFFFF0000UL) + ((__v >> 8)<<1)))); \
 	__w = ((*(__force volatile u16 *) ((_addr | 0x10000) + ((__v & 0xFF)<<1)))); })
 
Signature · 1 line
1.7.0.4
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Michael Schmitz

The Atari ROM port IO code uses dummy variables to implement writes (not supported by the hardware) as reads that encode the write data in part of the address. The value read from the ROM port in this operation is discarded.

Annotate dummy variables as __maybe_unused to avoid a compiler warning.

will add "with W=1".

(took me a while to discover, upgraded my cross-compiler in vain ;-)

Quoted 3 lines

i.e. will queue in the m68k for-v5.9 branch.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds