linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/5] m68knommu: __force type casts for raw IO access
@ 2020-06-15  7:16 Greg Ungerer
  2020-06-15 16:44 ` Luc Van Oostenryck
  0 siblings, 1 reply; 2+ messages in thread
From: Greg Ungerer @ 2020-06-15  7:16 UTC (permalink / raw)
  To: linux-m68k
  Cc: Greg Ungerer, kernel test robot, Marc Kleine-Budde, Luc Van Oostenryck

Bring the m68knommu raw IO functions into line with the m68k raw IO
access functions and __force casting of the address component. This
is primarily to fix sparse warnings on use of these raw macros.

Reported-by: kernel test robot <lkp@intel.com>
CC: Marc Kleine-Budde <mkl@pengutronix.de>
CC: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
---
 arch/m68k/include/asm/io_no.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/m68k/include/asm/io_no.h b/arch/m68k/include/asm/io_no.h
index 0498192e1d98..1bc739f1f1ad 100644
--- a/arch/m68k/include/asm/io_no.h
+++ b/arch/m68k/include/asm/io_no.h
@@ -14,15 +14,15 @@
  * that behavior here first before we include asm-generic/io.h.
  */
 #define __raw_readb(addr) \
-    ({ unsigned char __v = (*(volatile unsigned char *) (addr)); __v; })
+    ({ u8 __v = (*(__force volatile u8 *) (addr)); __v; })
 #define __raw_readw(addr) \
-    ({ unsigned short __v = (*(volatile unsigned short *) (addr)); __v; })
+    ({ u16 __v = (*(__force volatile u16 *) (addr)); __v; })
 #define __raw_readl(addr) \
-    ({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; })
+    ({ u32 __v = (*(__force volatile u32 *) (addr)); __v; })
 
-#define __raw_writeb(b, addr) (void)((*(volatile unsigned char *) (addr)) = (b))
-#define __raw_writew(b, addr) (void)((*(volatile unsigned short *) (addr)) = (b))
-#define __raw_writel(b, addr) (void)((*(volatile unsigned int *) (addr)) = (b))
+#define __raw_writeb(b, addr) (void)((*(__force volatile u8 *) (addr)) = (b))
+#define __raw_writew(b, addr) (void)((*(__force volatile u16 *) (addr)) = (b))
+#define __raw_writel(b, addr) (void)((*(__force volatile u32 *) (addr)) = (b))
 
 #if defined(CONFIG_COLDFIRE)
 /*
-- 
2.25.1


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

* Re: [PATCH 4/5] m68knommu: __force type casts for raw IO access
  2020-06-15  7:16 [PATCH 4/5] m68knommu: __force type casts for raw IO access Greg Ungerer
@ 2020-06-15 16:44 ` Luc Van Oostenryck
  0 siblings, 0 replies; 2+ messages in thread
From: Luc Van Oostenryck @ 2020-06-15 16:44 UTC (permalink / raw)
  To: Greg Ungerer; +Cc: linux-m68k, kernel test robot, Marc Kleine-Budde

On Mon, Jun 15, 2020 at 05:16:18PM +1000, Greg Ungerer wrote:
> Bring the m68knommu raw IO functions into line with the m68k raw IO
> access functions and __force casting of the address component. This
> is primarily to fix sparse warnings on use of these raw macros.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> CC: Marc Kleine-Budde <mkl@pengutronix.de>
> CC: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
> ---
>  arch/m68k/include/asm/io_no.h | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/m68k/include/asm/io_no.h b/arch/m68k/include/asm/io_no.h
> index 0498192e1d98..1bc739f1f1ad 100644
> --- a/arch/m68k/include/asm/io_no.h
> +++ b/arch/m68k/include/asm/io_no.h
> @@ -14,15 +14,15 @@
>   * that behavior here first before we include asm-generic/io.h.
>   */
>  #define __raw_readb(addr) \
> -    ({ unsigned char __v = (*(volatile unsigned char *) (addr)); __v; })
> +    ({ u8 __v = (*(__force volatile u8 *) (addr)); __v; })
>  #define __raw_readw(addr) \
> -    ({ unsigned short __v = (*(volatile unsigned short *) (addr)); __v; })
> +    ({ u16 __v = (*(__force volatile u16 *) (addr)); __v; })
>  #define __raw_readl(addr) \
> -    ({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; })
> +    ({ u32 __v = (*(__force volatile u32 *) (addr)); __v; })
>  
> -#define __raw_writeb(b, addr) (void)((*(volatile unsigned char *) (addr)) = (b))
> -#define __raw_writew(b, addr) (void)((*(volatile unsigned short *) (addr)) = (b))
> -#define __raw_writel(b, addr) (void)((*(volatile unsigned int *) (addr)) = (b))
> +#define __raw_writeb(b, addr) (void)((*(__force volatile u8 *) (addr)) = (b))
> +#define __raw_writew(b, addr) (void)((*(__force volatile u16 *) (addr)) = (b))
> +#define __raw_writel(b, addr) (void)((*(__force volatile u32 *) (addr)) = (b))
>  

Look good to me. Feel free to add my
Reviewed-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>

-- Luc

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

end of thread, other threads:[~2020-06-15 16:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-15  7:16 [PATCH 4/5] m68knommu: __force type casts for raw IO access Greg Ungerer
2020-06-15 16:44 ` Luc Van Oostenryck

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).