Skip to content

Commit 005b73d

Browse files
author
Greg Ungerer
committed
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]> Reviewed-by: Luc Van Oostenryck <[email protected]> Signed-off-by: Greg Ungerer <[email protected]>
1 parent cc0fec1 commit 005b73d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

arch/m68k/include/asm/io_no.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
* that behavior here first before we include asm-generic/io.h.
1515
*/
1616
#define __raw_readb(addr) \
17-
({ unsigned char __v = (*(volatile unsigned char *) (addr)); __v; })
17+
({ u8 __v = (*(__force volatile u8 *) (addr)); __v; })
1818
#define __raw_readw(addr) \
19-
({ unsigned short __v = (*(volatile unsigned short *) (addr)); __v; })
19+
({ u16 __v = (*(__force volatile u16 *) (addr)); __v; })
2020
#define __raw_readl(addr) \
21-
({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; })
21+
({ u32 __v = (*(__force volatile u32 *) (addr)); __v; })
2222

23-
#define __raw_writeb(b, addr) (void)((*(volatile unsigned char *) (addr)) = (b))
24-
#define __raw_writew(b, addr) (void)((*(volatile unsigned short *) (addr)) = (b))
25-
#define __raw_writel(b, addr) (void)((*(volatile unsigned int *) (addr)) = (b))
23+
#define __raw_writeb(b, addr) (void)((*(__force volatile u8 *) (addr)) = (b))
24+
#define __raw_writew(b, addr) (void)((*(__force volatile u16 *) (addr)) = (b))
25+
#define __raw_writel(b, addr) (void)((*(__force volatile u32 *) (addr)) = (b))
2626

2727
#if defined(CONFIG_COLDFIRE)
2828
/*

0 commit comments

Comments
 (0)