All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sh: make !MMU iounmap an inline function
@ 2022-04-14  8:12 Vincent Whitchurch
  2022-04-15 19:21 ` Rob Landley
  0 siblings, 1 reply; 4+ messages in thread
From: Vincent Whitchurch @ 2022-04-14  8:12 UTC (permalink / raw)
  To: Yoshinori Sato, Rich Felker
  Cc: kernel, hch, Vincent Whitchurch, kernel test robot, linux-sh,
	linux-kernel

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


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

* Re: [PATCH] sh: make !MMU iounmap an inline function
  2022-04-14  8:12 [PATCH] sh: make !MMU iounmap an inline function Vincent Whitchurch
@ 2022-04-15 19:21 ` Rob Landley
  2022-04-19  9:42   ` Geert Uytterhoeven
  0 siblings, 1 reply; 4+ messages in thread
From: Rob Landley @ 2022-04-15 19:21 UTC (permalink / raw)
  To: Vincent Whitchurch, Yoshinori Sato, Rich Felker
  Cc: kernel, hch, kernel test robot, linux-sh, linux-kernel

On 4/14/22 03:12, Vincent Whitchurch wrote:
> 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>

Tested-by: Rob Landley <rob@landley.net>

Worked For Me.

Rob

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

* Re: [PATCH] sh: make !MMU iounmap an inline function
  2022-04-15 19:21 ` Rob Landley
@ 2022-04-19  9:42   ` Geert Uytterhoeven
  2022-04-19 12:21     ` John Paul Adrian Glaubitz
  0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2022-04-19  9:42 UTC (permalink / raw)
  To: Rich Felker, Yoshinori Sato
  Cc: Vincent Whitchurch, kernel, Christoph Hellwig, kernel test robot,
	Linux-sh list, Linux Kernel Mailing List, Rob Landley,
	Andrew Morton, Arnd Bergmann

Hi Rich, Sato-san,

On Sat, Apr 16, 2022 at 12:01 AM Rob Landley <rob@landley.net> wrote:
> On 4/14/22 03:12, Vincent Whitchurch wrote:
> > 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>
>
> Tested-by: Rob Landley <rob@landley.net>
>
> Worked For Me.

Can we please get any of [1], [2], [3], or [4] applied and sent
upstream, so people can stop wasting time on recreating and
resubmitting similar patches all the time?

Thank you!

[1] PATCH] sh: Fix set but not used warnings with !CONFIG_MMU
    https://lore.kernel.org/r/20201208182117.163642-2-sam@ravnborg.org
[2] [PATCH] sh: make iounmap() a static inline again
    https://lore.kernel.org/r/20220105085746.1116726-1-mkl@pengutronix.de
[3] [PATCH] sh: Convert nommu io{re,un}map() to static inline functions
    https://lore.kernel.org/r/4ed0a7a0d3fa912a5b44c451884818f2c138ef42.1644914600.git.geert+renesas@glider.be/
[4] [PATCH] sh: make !MMU iounmap an inline function
    https://lore.kernel.org/r/20220414081257.1487499-1-vincent.whitchurch@axis.com/

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] 4+ messages in thread

* Re: [PATCH] sh: make !MMU iounmap an inline function
  2022-04-19  9:42   ` Geert Uytterhoeven
@ 2022-04-19 12:21     ` John Paul Adrian Glaubitz
  0 siblings, 0 replies; 4+ messages in thread
From: John Paul Adrian Glaubitz @ 2022-04-19 12:21 UTC (permalink / raw)
  To: Geert Uytterhoeven, Rich Felker, Yoshinori Sato
  Cc: Vincent Whitchurch, kernel, Christoph Hellwig, kernel test robot,
	Linux-sh list, Linux Kernel Mailing List, Rob Landley,
	Andrew Morton, Arnd Bergmann

Hi Geert!

On 4/19/22 11:42, Geert Uytterhoeven wrote:
> Hi Rich, Sato-san,
> 
> On Sat, Apr 16, 2022 at 12:01 AM Rob Landley <rob@landley.net> wrote:
>> On 4/14/22 03:12, Vincent Whitchurch wrote:
>>> 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>
>>
>> Tested-by: Rob Landley <rob@landley.net>
>>
>> Worked For Me.
> 
> Can we please get any of [1], [2], [3], or [4] applied and sent
> upstream, so people can stop wasting time on recreating and
> resubmitting similar patches all the time?

I agree. Those patches shouldn't be sent in vain. I very much appreciate everyone
sending in patches to improve Linux support for SH which is why I find it saddening
that the maintainers don't find enough time to review the patches.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913


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

end of thread, other threads:[~2022-04-19 12:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-14  8:12 [PATCH] sh: make !MMU iounmap an inline function Vincent Whitchurch
2022-04-15 19:21 ` Rob Landley
2022-04-19  9:42   ` Geert Uytterhoeven
2022-04-19 12:21     ` John Paul Adrian Glaubitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.