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

[PATCH] ppc iomem annotations: ->io_base_virt

* ->io_base_virt in struct pci_controller is iomem pointer. Marked as such.
Most of the places that used it are already annotated to expect iomem.
* places that did gratitious (and wrong) casts a-la
isa_io_base = (unsigned long)ioremap(...);
hose->io_base_virt = (void *)isa_io_base;
turned into
hose->io_base_virt = ioremap(...);
isa_io_base = (unsigned long)hose->io_base_virt;
* pci_bus_io_base() annotated as returning iomem pointer.

Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Al Viro and committed by
Linus Torvalds
92a11f9e 9090e001

+19 -27
+1 -1
arch/ppc/kernel/pci.c
··· 1432 1432 return NULL; 1433 1433 } 1434 1434 1435 - void* 1435 + void __iomem * 1436 1436 pci_bus_io_base(unsigned int bus) 1437 1437 { 1438 1438 struct pci_controller *hose;
+2 -3
arch/ppc/platforms/4xx/ebony.c
··· 210 210 hose->io_space.end = EBONY_PCI_UPPER_IO; 211 211 hose->mem_space.start = EBONY_PCI_LOWER_MEM; 212 212 hose->mem_space.end = EBONY_PCI_UPPER_MEM; 213 - isa_io_base = 214 - (unsigned long)ioremap64(EBONY_PCI_IO_BASE, EBONY_PCI_IO_SIZE); 215 - hose->io_base_virt = (void *)isa_io_base; 213 + hose->io_base_virt = ioremap64(EBONY_PCI_IO_BASE, EBONY_PCI_IO_SIZE); 214 + isa_io_base = (unsigned long)hose->io_base_virt; 216 215 217 216 setup_indirect_pci(hose, 218 217 EBONY_PCI_CFGA_PLB32,
+2 -3
arch/ppc/platforms/4xx/luan.c
··· 223 223 hose->io_space.end = LUAN_PCIX_UPPER_IO; 224 224 hose->mem_space.start = lower_mem; 225 225 hose->mem_space.end = upper_mem; 226 - isa_io_base = 227 - (unsigned long)ioremap64(pcix_io_base, PCIX_IO_SIZE); 228 - hose->io_base_virt = (void *)isa_io_base; 226 + hose->io_base_virt = ioremap64(pcix_io_base, PCIX_IO_SIZE); 227 + isa_io_base = (unsigned long) hose->io_base_virt; 229 228 230 229 setup_indirect_pci(hose, cfga, cfgd); 231 230 hose->set_cfg_type = 1;
+2 -3
arch/ppc/platforms/4xx/ocotea.c
··· 227 227 hose->io_space.end = OCOTEA_PCI_UPPER_IO; 228 228 hose->mem_space.start = OCOTEA_PCI_LOWER_MEM; 229 229 hose->mem_space.end = OCOTEA_PCI_UPPER_MEM; 230 - isa_io_base = 231 - (unsigned long)ioremap64(OCOTEA_PCI_IO_BASE, OCOTEA_PCI_IO_SIZE); 232 - hose->io_base_virt = (void *)isa_io_base; 230 + hose->io_base_virt = ioremap64(OCOTEA_PCI_IO_BASE, OCOTEA_PCI_IO_SIZE); 231 + isa_io_base = (unsigned long) hose->io_base_virt; 233 232 234 233 setup_indirect_pci(hose, 235 234 OCOTEA_PCI_CFGA_PLB32,
+2 -3
arch/ppc/syslib/m8260_pci.c
··· 171 171 m8260_setup_pci(hose); 172 172 hose->pci_mem_offset = MPC826x_PCI_MEM_OFFSET; 173 173 174 - isa_io_base = 175 - (unsigned long) ioremap(MPC826x_PCI_IO_BASE, 174 + hose->io_base_virt = ioremap(MPC826x_PCI_IO_BASE, 176 175 MPC826x_PCI_IO_SIZE); 177 - hose->io_base_virt = (void *) isa_io_base; 176 + isa_io_base = (unsigned long) hose->io_base_virt; 178 177 179 178 /* setup resources */ 180 179 pci_init_resource(&hose->mem_resources[0],
+3 -5
arch/ppc/syslib/mpc52xx_pci.c
··· 205 205 206 206 hose->pci_mem_offset = MPC52xx_PCI_MEM_OFFSET; 207 207 208 - isa_io_base = 209 - (unsigned long) ioremap(MPC52xx_PCI_IO_BASE, 210 - MPC52xx_PCI_IO_SIZE); 211 - hose->io_base_virt = (void *) isa_io_base; 208 + hose->io_base_virt = ioremap(MPC52xx_PCI_IO_BASE, MPC52xx_PCI_IO_SIZE); 209 + isa_io_base = (unsigned long) hose->io_base_virt; 212 210 213 211 hose->cfg_addr = &pci_regs->car; 214 - hose->cfg_data = (void __iomem *) isa_io_base; 212 + hose->cfg_data = hose->io_base_virt; 215 213 216 214 /* Setup resources */ 217 215 pci_init_resource(&hose->mem_resources[0],
+5 -7
arch/ppc/syslib/ppc85xx_setup.c
··· 280 280 hose_a->io_space.end = MPC85XX_PCI1_UPPER_IO; 281 281 hose_a->io_base_phys = MPC85XX_PCI1_IO_BASE; 282 282 #ifdef CONFIG_85xx_PCI2 283 - isa_io_base = 284 - (unsigned long) ioremap(MPC85XX_PCI1_IO_BASE, 283 + hose_a->io_base_virt = ioremap(MPC85XX_PCI1_IO_BASE, 285 284 MPC85XX_PCI1_IO_SIZE + 286 285 MPC85XX_PCI2_IO_SIZE); 287 286 #else 288 - isa_io_base = 289 - (unsigned long) ioremap(MPC85XX_PCI1_IO_BASE, 287 + hose_a->io_base_virt = ioremap(MPC85XX_PCI1_IO_BASE, 290 288 MPC85XX_PCI1_IO_SIZE); 291 289 #endif 292 - hose_a->io_base_virt = (void *) isa_io_base; 290 + isa_io_base = (unsigned long)hose_a->io_base_virt; 293 291 294 292 /* setup resources */ 295 293 pci_init_resource(&hose_a->mem_resources[0], ··· 327 329 hose_b->io_space.start = MPC85XX_PCI2_LOWER_IO; 328 330 hose_b->io_space.end = MPC85XX_PCI2_UPPER_IO; 329 331 hose_b->io_base_phys = MPC85XX_PCI2_IO_BASE; 330 - hose_b->io_base_virt = (void *) isa_io_base + MPC85XX_PCI1_IO_SIZE; 331 - 332 + hose_b->io_base_virt = hose_a->io_base_virt + MPC85XX_PCI1_IO_SIZE; 333 + 332 334 /* setup resources */ 333 335 pci_init_resource(&hose_b->mem_resources[0], 334 336 MPC85XX_PCI2_LOWER_MEM,
+2 -2
include/asm-ppc/pci-bridge.h
··· 12 12 * pci_io_base returns the memory address at which you can access 13 13 * the I/O space for PCI bus number `bus' (or NULL on error). 14 14 */ 15 - extern void *pci_bus_io_base(unsigned int bus); 15 + extern void __iomem *pci_bus_io_base(unsigned int bus); 16 16 extern unsigned long pci_bus_io_base_phys(unsigned int bus); 17 17 extern unsigned long pci_bus_mem_base_phys(unsigned int bus); 18 18 ··· 48 48 int last_busno; 49 49 int bus_offset; 50 50 51 - void *io_base_virt; 51 + void __iomem *io_base_virt; 52 52 unsigned long io_base_phys; 53 53 54 54 /* Some machines (PReP) have a non 1:1 mapping of