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

powerpc: Fix a bunch of sparse warnings in the qe_lib

Mostly having to do with not marking things __iomem. And some failure
to use appropriate accessors to read MMIO regs.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

authored by

Andy Fleming and committed by
Kumar Gala
7e1cc9c5 4cd7e1cb

+18 -18
+3 -3
arch/powerpc/sysdev/qe_lib/qe.c
··· 64 64 phys_addr_t get_qe_base(void) 65 65 { 66 66 struct device_node *qe; 67 - unsigned int size; 67 + int size; 68 68 const u32 *prop; 69 69 70 70 if (qebase != -1) ··· 158 158 unsigned int qe_get_brg_clk(void) 159 159 { 160 160 struct device_node *qe; 161 - unsigned int size; 161 + int size; 162 162 const u32 *prop; 163 163 164 164 if (brg_clk) ··· 305 305 306 306 static int qe_sdma_init(void) 307 307 { 308 - struct sdma *sdma = &qe_immr->sdma; 308 + struct sdma __iomem *sdma = &qe_immr->sdma; 309 309 unsigned long sdma_buf_offset; 310 310 311 311 if (!sdma)
+3 -3
arch/powerpc/sysdev/qe_lib/ucc.c
··· 88 88 return 0; 89 89 } 90 90 91 - static void get_cmxucr_reg(unsigned int ucc_num, __be32 **cmxucr, 91 + static void get_cmxucr_reg(unsigned int ucc_num, __be32 __iomem **cmxucr, 92 92 unsigned int *reg_num, unsigned int *shift) 93 93 { 94 94 unsigned int cmx = ((ucc_num & 1) << 1) + (ucc_num > 3); ··· 100 100 101 101 int ucc_mux_set_grant_tsa_bkpt(unsigned int ucc_num, int set, u32 mask) 102 102 { 103 - __be32 *cmxucr; 103 + __be32 __iomem *cmxucr; 104 104 unsigned int reg_num; 105 105 unsigned int shift; 106 106 ··· 121 121 int ucc_set_qe_mux_rxtx(unsigned int ucc_num, enum qe_clock clock, 122 122 enum comm_dir mode) 123 123 { 124 - __be32 *cmxucr; 124 + __be32 __iomem *cmxucr; 125 125 unsigned int reg_num; 126 126 unsigned int shift; 127 127 u32 clock_bits = 0;
+8 -8
arch/powerpc/sysdev/qe_lib/ucc_fast.c
··· 46 46 printk(KERN_INFO "uccm : addr=0x%p, val=0x%08x\n", 47 47 &uccf->uf_regs->uccm, in_be32(&uccf->uf_regs->uccm)); 48 48 printk(KERN_INFO "uccs : addr=0x%p, val=0x%02x\n", 49 - &uccf->uf_regs->uccs, uccf->uf_regs->uccs); 49 + &uccf->uf_regs->uccs, in_8(&uccf->uf_regs->uccs)); 50 50 printk(KERN_INFO "urfb : addr=0x%p, val=0x%08x\n", 51 51 &uccf->uf_regs->urfb, in_be32(&uccf->uf_regs->urfb)); 52 52 printk(KERN_INFO "urfs : addr=0x%p, val=0x%04x\n", ··· 68 68 printk(KERN_INFO "urtry : addr=0x%p, val=0x%08x\n", 69 69 &uccf->uf_regs->urtry, in_be32(&uccf->uf_regs->urtry)); 70 70 printk(KERN_INFO "guemr : addr=0x%p, val=0x%02x\n", 71 - &uccf->uf_regs->guemr, uccf->uf_regs->guemr); 71 + &uccf->uf_regs->guemr, in_8(&uccf->uf_regs->guemr)); 72 72 } 73 73 EXPORT_SYMBOL(ucc_fast_dump_regs); 74 74 ··· 96 96 97 97 void ucc_fast_enable(struct ucc_fast_private * uccf, enum comm_dir mode) 98 98 { 99 - struct ucc_fast *uf_regs; 99 + struct ucc_fast __iomem *uf_regs; 100 100 u32 gumr; 101 101 102 102 uf_regs = uccf->uf_regs; ··· 117 117 118 118 void ucc_fast_disable(struct ucc_fast_private * uccf, enum comm_dir mode) 119 119 { 120 - struct ucc_fast *uf_regs; 120 + struct ucc_fast __iomem *uf_regs; 121 121 u32 gumr; 122 122 123 123 uf_regs = uccf->uf_regs; ··· 139 139 int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** uccf_ret) 140 140 { 141 141 struct ucc_fast_private *uccf; 142 - struct ucc_fast *uf_regs; 142 + struct ucc_fast __iomem *uf_regs; 143 143 u32 gumr; 144 144 int ret; 145 145 ··· 216 216 uccf->stopped_tx = 0; 217 217 uccf->stopped_rx = 0; 218 218 uf_regs = uccf->uf_regs; 219 - uccf->p_ucce = (u32 *) & (uf_regs->ucce); 220 - uccf->p_uccm = (u32 *) & (uf_regs->uccm); 219 + uccf->p_ucce = &uf_regs->ucce; 220 + uccf->p_uccm = &uf_regs->uccm; 221 221 #ifdef CONFIG_UGETH_TX_ON_DEMAND 222 - uccf->p_utodr = (u16 *) & (uf_regs->utodr); 222 + uccf->p_utodr = &uf_regs->utodr; 223 223 #endif 224 224 #ifdef STATISTICS 225 225 uccf->tx_frames = 0;
+4 -4
include/asm-powerpc/ucc_fast.h
··· 156 156 157 157 struct ucc_fast_private { 158 158 struct ucc_fast_info *uf_info; 159 - struct ucc_fast *uf_regs; /* a pointer to memory map of UCC regs. */ 160 - u32 *p_ucce; /* a pointer to the event register in memory. */ 161 - u32 *p_uccm; /* a pointer to the mask register in memory. */ 159 + struct ucc_fast __iomem *uf_regs; /* a pointer to the UCC regs. */ 160 + u32 __iomem *p_ucce; /* a pointer to the event register in memory. */ 161 + u32 __iomem *p_uccm; /* a pointer to the mask register in memory. */ 162 162 #ifdef CONFIG_UGETH_TX_ON_DEMAND 163 - u16 *p_utodr; /* pointer to the transmit on demand register */ 163 + u16 __iomem *p_utodr; /* pointer to the transmit on demand register */ 164 164 #endif 165 165 int enabled_tx; /* Whether channel is enabled for Tx (ENT) */ 166 166 int enabled_rx; /* Whether channel is enabled for Rx (ENR) */