Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fix the broken annotations in fsldma

a) every bitwise declaration will give a unique type; use typedefs.

b) no need to bother with the stuff pointed to by iomem pointers,
unless it's accessed directly. noderef will force us to use helpers
anyway.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Al Viro and committed by
Linus Torvalds
a4e6d5d3 f0bb3cfd

+27 -20
+27 -20
drivers/dma/fsldma.h
··· 75 75 #define FSL_DMA_DGSR_EOSI 0x02 76 76 #define FSL_DMA_DGSR_EOLSI 0x01 77 77 78 + typedef u64 __bitwise v64; 79 + typedef u32 __bitwise v32; 80 + 78 81 struct fsl_dma_ld_hw { 79 - u64 __bitwise src_addr; 80 - u64 __bitwise dst_addr; 81 - u64 __bitwise next_ln_addr; 82 - u32 __bitwise count; 83 - u32 __bitwise reserve; 82 + v64 src_addr; 83 + v64 dst_addr; 84 + v64 next_ln_addr; 85 + v32 count; 86 + v32 reserve; 84 87 } __attribute__((aligned(32))); 85 88 86 89 struct fsl_desc_sw { ··· 95 92 } __attribute__((aligned(32))); 96 93 97 94 struct fsl_dma_chan_regs { 98 - u32 __bitwise mr; /* 0x00 - Mode Register */ 99 - u32 __bitwise sr; /* 0x04 - Status Register */ 100 - u64 __bitwise cdar; /* 0x08 - Current descriptor address register */ 101 - u64 __bitwise sar; /* 0x10 - Source Address Register */ 102 - u64 __bitwise dar; /* 0x18 - Destination Address Register */ 103 - u32 __bitwise bcr; /* 0x20 - Byte Count Register */ 104 - u64 __bitwise ndar; /* 0x24 - Next Descriptor Address Register */ 95 + u32 mr; /* 0x00 - Mode Register */ 96 + u32 sr; /* 0x04 - Status Register */ 97 + u64 cdar; /* 0x08 - Current descriptor address register */ 98 + u64 sar; /* 0x10 - Source Address Register */ 99 + u64 dar; /* 0x18 - Destination Address Register */ 100 + u32 bcr; /* 0x20 - Byte Count Register */ 101 + u64 ndar; /* 0x24 - Next Descriptor Address Register */ 105 102 }; 106 103 107 104 struct fsl_dma_chan; ··· 154 151 #ifndef __powerpc64__ 155 152 static u64 in_be64(const u64 __iomem *addr) 156 153 { 157 - return ((u64)in_be32((u32 *)addr) << 32) | (in_be32((u32 *)addr + 1)); 154 + return ((u64)in_be32((u32 __iomem *)addr) << 32) | 155 + (in_be32((u32 __iomem *)addr + 1)); 158 156 } 159 157 160 158 static void out_be64(u64 __iomem *addr, u64 val) 161 159 { 162 - out_be32((u32 *)addr, val >> 32); 163 - out_be32((u32 *)addr + 1, (u32)val); 160 + out_be32((u32 __iomem *)addr, val >> 32); 161 + out_be32((u32 __iomem *)addr + 1, (u32)val); 164 162 } 165 163 166 164 /* There is no asm instructions for 64 bits reverse loads and stores */ 167 165 static u64 in_le64(const u64 __iomem *addr) 168 166 { 169 - return ((u64)in_le32((u32 *)addr + 1) << 32) | (in_le32((u32 *)addr)); 167 + return ((u64)in_le32((u32 __iomem *)addr + 1) << 32) | 168 + (in_le32((u32 __iomem *)addr)); 170 169 } 171 170 172 171 static void out_le64(u64 __iomem *addr, u64 val) 173 172 { 174 - out_le32((u32 *)addr + 1, val >> 32); 175 - out_le32((u32 *)addr, (u32)val); 173 + out_le32((u32 __iomem *)addr + 1, val >> 32); 174 + out_le32((u32 __iomem *)addr, (u32)val); 176 175 } 177 176 #endif 178 177 ··· 187 182 188 183 #define DMA_TO_CPU(fsl_chan, d, width) \ 189 184 (((fsl_chan)->feature & FSL_DMA_BIG_ENDIAN) ? \ 190 - be##width##_to_cpu(d) : le##width##_to_cpu(d)) 185 + be##width##_to_cpu((__force __be##width)(v##width)d) : \ 186 + le##width##_to_cpu((__force __le##width)(v##width)d)) 191 187 #define CPU_TO_DMA(fsl_chan, c, width) \ 192 188 (((fsl_chan)->feature & FSL_DMA_BIG_ENDIAN) ? \ 193 - cpu_to_be##width(c) : cpu_to_le##width(c)) 189 + (__force v##width)cpu_to_be##width(c) : \ 190 + (__force v##width)cpu_to_le##width(c)) 194 191 195 192 #endif /* __DMA_FSLDMA_H */