m68knommu: __force type casts for raw IO access
Subsystems (2)
Greg Ungerer
maintainerPATCH 4/5 m68knommu: __force type casts for raw IO access
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 <[email protected]>
CC Marc Kleine-Budde <[email protected]>
CC Luc Van Oostenryck <[email protected]>
Signed-off-by Greg Ungerer <[email protected]>
--- arch/m68k/include/asm/io_no.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/m68k/include/asm/io_no.h +6 -6
@@ -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 )/*
Signature · 1 line
2.25.1
Quoted 26 lines · Greg Ungerer
Bring the m68knommu raw IO functions into line with the m68k raw IO access functions and
__forcecasting of the address component. This is primarily to fix sparse warnings on use of these raw macros.Reported-by kernel test robot <[email protected]>CC Marc Kleine-Budde <[email protected]>CC Luc Van Oostenryck <[email protected]>Signed-off-by Greg Ungerer <[email protected]>--- arch/m68k/include/asm/io_no.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)arch/m68k/include/asm/io_no.h +2
-2@@ -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) \
arch/m68k/include/asm/io_no.h line 26
Quoted 10 lines
arch/m68k/include/asm/io_no.h +4
-4- ({ 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 <[email protected]>
-- Luc