Linux-m68k Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] m68k - annotate dummy read in Atari ROM port IO code as __maybe_unused
@ 2020-05-30 22:45 Michael Schmitz
  2020-06-29 18:38 ` Geert Uytterhoeven
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Schmitz @ 2020-05-30 22:45 UTC (permalink / raw)
  To: geert; +Cc: linux-m68k, 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.

Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
Reported-by: kbuild test robot <lkp@intel.com>
---
 arch/m68k/include/asm/raw_io.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/m68k/include/asm/raw_io.h b/arch/m68k/include/asm/raw_io.h
index 8a6dc6e..911826e 100644
--- a/arch/m68k/include/asm/raw_io.h
+++ b/arch/m68k/include/asm/raw_io.h
@@ -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)))); })
 
-- 
1.7.0.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] m68k - annotate dummy read in Atari ROM port IO code as __maybe_unused
  2020-05-30 22:45 [PATCH] m68k - annotate dummy read in Atari ROM port IO code as __maybe_unused Michael Schmitz
@ 2020-06-29 18:38 ` Geert Uytterhoeven
  0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2020-06-29 18:38 UTC (permalink / raw)
  To: Michael Schmitz; +Cc: Linux/m68k

On Sun, May 31, 2020 at 12:45 AM Michael Schmitz <schmitzmic@gmail.com> wrote:
> 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 ;-)

>
> Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
> Reported-by: kbuild test robot <lkp@intel.com>

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
i.e. will queue in the m68k for-v5.9 branch.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-30 22:45 [PATCH] m68k - annotate dummy read in Atari ROM port IO code as __maybe_unused Michael Schmitz
2020-06-29 18:38 ` Geert Uytterhoeven

Linux-m68k Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-m68k/0 linux-m68k/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-m68k linux-m68k/ https://lore.kernel.org/linux-m68k \
		linux-m68k@vger.kernel.org linux-m68k@lists.linux-m68k.org
	public-inbox-index linux-m68k

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-m68k


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git