linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vincent Whitchurch <vincent.whitchurch@axis.com>
To: Yoshinori Sato <ysato@users.sourceforge.jp>,
	Rich Felker <dalias@libc.org>
Cc: <kernel@axis.com>, <hch@lst.de>,
	Vincent Whitchurch <vincent.whitchurch@axis.com>,
	kernel test robot <lkp@intel.com>, <linux-sh@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH] sh: make !MMU iounmap an inline function
Date: Thu, 14 Apr 2022 10:12:57 +0200	[thread overview]
Message-ID: <20220414081257.1487499-1-vincent.whitchurch@axis.com> (raw)

The current definition of sh's !MMU iounmap makes it unusable in certain
kinds of code, such as this instance caught by 0day on a patch posted to
the mailing lists:

 In file included from include/linux/io.h:13,
                  from drivers/mtd/devices/phram.c:21:
 drivers/mtd/devices/phram.c: In function 'register_device':
 arch/sh/include/asm/io.h:274:33: error: expected expression before 'do'
   274 | #define iounmap(addr)           do { } while (0)
       |                                 ^~
 drivers/mtd/devices/phram.c:150:44: note: in expansion of macro 'iounmap'
   150 |         cached ? memunmap(new->mtd.priv) : iounmap(new->mtd.priv);
       |                                            ^~~~~~~

Make it an inline function as it was earlier.

Link: https://lore.kernel.org/lkml/202204131446.omJ5mC54-lkp@intel.com/
Fixes: 13f1fc870dd747131 ("sh: move the ioremap implementation out of line")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
---
 arch/sh/include/asm/io.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h
index cf9a3ec32406..6bb978cf2ece 100644
--- a/arch/sh/include/asm/io.h
+++ b/arch/sh/include/asm/io.h
@@ -271,7 +271,7 @@ static inline void __iomem *ioremap_prot(phys_addr_t offset, unsigned long size,
 #endif /* CONFIG_HAVE_IOREMAP_PROT */
 
 #else /* CONFIG_MMU */
-#define iounmap(addr)		do { } while (0)
+static inline void iounmap(void __iomem *addr) {};
 #define ioremap(offset, size)	((void __iomem *)(unsigned long)(offset))
 #endif /* CONFIG_MMU */
 
-- 
2.34.1


             reply	other threads:[~2022-04-14  8:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-14  8:12 Vincent Whitchurch [this message]
2022-04-15 19:21 ` [PATCH] sh: make !MMU iounmap an inline function Rob Landley
2022-04-19  9:42   ` Geert Uytterhoeven
2022-04-19 12:21     ` John Paul Adrian Glaubitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220414081257.1487499-1-vincent.whitchurch@axis.com \
    --to=vincent.whitchurch@axis.com \
    --cc=dalias@libc.org \
    --cc=hch@lst.de \
    --cc=kernel@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=ysato@users.sourceforge.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).