diff options
Diffstat (limited to 'arch')
91 files changed, 135 insertions, 155 deletions
diff --git a/arch/alpha/include/asm/floppy.h b/arch/alpha/include/asm/floppy.h index 0be50413b2b5..46cefbd50e73 100644 --- a/arch/alpha/include/asm/floppy.h +++ b/arch/alpha/include/asm/floppy.h | |||
@@ -27,7 +27,7 @@ | |||
27 | #define fd_cacheflush(addr,size) /* nothing */ | 27 | #define fd_cacheflush(addr,size) /* nothing */ |
28 | #define fd_request_irq() request_irq(FLOPPY_IRQ, floppy_interrupt,\ | 28 | #define fd_request_irq() request_irq(FLOPPY_IRQ, floppy_interrupt,\ |
29 | IRQF_DISABLED, "floppy", NULL) | 29 | IRQF_DISABLED, "floppy", NULL) |
30 | #define fd_free_irq() free_irq(FLOPPY_IRQ, NULL); | 30 | #define fd_free_irq() free_irq(FLOPPY_IRQ, NULL) |
31 | 31 | ||
32 | #ifdef CONFIG_PCI | 32 | #ifdef CONFIG_PCI |
33 | 33 | ||
diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c index c11af1e4bad3..a07b0e763a80 100644 --- a/arch/arm/common/scoop.c +++ b/arch/arm/common/scoop.c | |||
@@ -193,7 +193,7 @@ static int __devinit scoop_probe(struct platform_device *pdev) | |||
193 | spin_lock_init(&devptr->scoop_lock); | 193 | spin_lock_init(&devptr->scoop_lock); |
194 | 194 | ||
195 | inf = pdev->dev.platform_data; | 195 | inf = pdev->dev.platform_data; |
196 | devptr->base = ioremap(mem->start, mem->end - mem->start + 1); | 196 | devptr->base = ioremap(mem->start, resource_size(mem)); |
197 | 197 | ||
198 | if (!devptr->base) { | 198 | if (!devptr->base) { |
199 | ret = -ENOMEM; | 199 | ret = -ENOMEM; |
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index 5004bf0a05f2..0f917928eeb7 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c | |||
@@ -525,7 +525,7 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) | |||
525 | if (ARRAY_SIZE(lcdc_resources) > 2) { | 525 | if (ARRAY_SIZE(lcdc_resources) > 2) { |
526 | void __iomem *fb; | 526 | void __iomem *fb; |
527 | struct resource *fb_res = &lcdc_resources[2]; | 527 | struct resource *fb_res = &lcdc_resources[2]; |
528 | size_t fb_len = fb_res->end - fb_res->start + 1; | 528 | size_t fb_len = resource_size(fb_res); |
529 | 529 | ||
530 | fb = ioremap(fb_res->start, fb_len); | 530 | fb = ioremap(fb_res->start, fb_len); |
531 | if (fb) { | 531 | if (fb) { |
diff --git a/arch/arm/mach-at91/board-snapper9260.c b/arch/arm/mach-at91/board-snapper9260.c index 3eb0a1153cc8..6010ce16b3cf 100644 --- a/arch/arm/mach-at91/board-snapper9260.c +++ b/arch/arm/mach-at91/board-snapper9260.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * Copyright (C) 2010 Bluewater System Ltd | 4 | * Copyright (C) 2010 Bluewater System Ltd |
5 | * | 5 | * |
6 | * Author: Andre Renaud <andre@bluewatersys.com> | 6 | * Author: Andre Renaud <andre@bluewatersys.com> |
7 | * Author: Ryan Mallon <ryan@bluewatersys.com> | 7 | * Author: Ryan Mallon |
8 | * | 8 | * |
9 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c index 5ed51b84c1b2..83dce859886d 100644 --- a/arch/arm/mach-dove/common.c +++ b/arch/arm/mach-dove/common.c | |||
@@ -13,11 +13,9 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
15 | #include <linux/pci.h> | 15 | #include <linux/pci.h> |
16 | #include <linux/serial_8250.h> | ||
17 | #include <linux/clk.h> | 16 | #include <linux/clk.h> |
18 | #include <linux/mbus.h> | 17 | #include <linux/mbus.h> |
19 | #include <linux/ata_platform.h> | 18 | #include <linux/ata_platform.h> |
20 | #include <linux/serial_8250.h> | ||
21 | #include <linux/gpio.h> | 19 | #include <linux/gpio.h> |
22 | #include <asm/page.h> | 20 | #include <asm/page.h> |
23 | #include <asm/setup.h> | 21 | #include <asm/setup.h> |
diff --git a/arch/arm/mach-ep93xx/simone.c b/arch/arm/mach-ep93xx/simone.c index d96dc1c5da20..8392e95d7cea 100644 --- a/arch/arm/mach-ep93xx/simone.c +++ b/arch/arm/mach-ep93xx/simone.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * arch/arm/mach-ep93xx/simone.c | 2 | * arch/arm/mach-ep93xx/simone.c |
3 | * Simplemachines Sim.One support. | 3 | * Simplemachines Sim.One support. |
4 | * | 4 | * |
5 | * Copyright (C) 2010 Ryan Mallon <ryan@bluewatersys.com> | 5 | * Copyright (C) 2010 Ryan Mallon |
6 | * | 6 | * |
7 | * Based on the 2.6.24.7 support: | 7 | * Based on the 2.6.24.7 support: |
8 | * Copyright (C) 2009 Simplemachines | 8 | * Copyright (C) 2009 Simplemachines |
@@ -65,7 +65,7 @@ static void __init simone_init_machine(void) | |||
65 | } | 65 | } |
66 | 66 | ||
67 | MACHINE_START(SIM_ONE, "Simplemachines Sim.One Board") | 67 | MACHINE_START(SIM_ONE, "Simplemachines Sim.One Board") |
68 | /* Maintainer: Ryan Mallon <ryan@bluewatersys.com> */ | 68 | /* Maintainer: Ryan Mallon */ |
69 | .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100, | 69 | .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100, |
70 | .map_io = ep93xx_map_io, | 70 | .map_io = ep93xx_map_io, |
71 | .init_irq = ep93xx_init_irq, | 71 | .init_irq = ep93xx_init_irq, |
diff --git a/arch/arm/mach-ep93xx/snappercl15.c b/arch/arm/mach-ep93xx/snappercl15.c index ac601fe2b448..2e9c614757e4 100644 --- a/arch/arm/mach-ep93xx/snappercl15.c +++ b/arch/arm/mach-ep93xx/snappercl15.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * Bluewater Systems Snapper CL15 system module | 3 | * Bluewater Systems Snapper CL15 system module |
4 | * | 4 | * |
5 | * Copyright (C) 2009 Bluewater Systems Ltd | 5 | * Copyright (C) 2009 Bluewater Systems Ltd |
6 | * Author: Ryan Mallon <ryan@bluewatersys.com> | 6 | * Author: Ryan Mallon |
7 | * | 7 | * |
8 | * NAND code adapted from driver by: | 8 | * NAND code adapted from driver by: |
9 | * Andre Renaud <andre@bluewatersys.com> | 9 | * Andre Renaud <andre@bluewatersys.com> |
@@ -162,7 +162,7 @@ static void __init snappercl15_init_machine(void) | |||
162 | } | 162 | } |
163 | 163 | ||
164 | MACHINE_START(SNAPPER_CL15, "Bluewater Systems Snapper CL15") | 164 | MACHINE_START(SNAPPER_CL15, "Bluewater Systems Snapper CL15") |
165 | /* Maintainer: Ryan Mallon <ryan@bluewatersys.com> */ | 165 | /* Maintainer: Ryan Mallon */ |
166 | .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100, | 166 | .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100, |
167 | .map_io = ep93xx_map_io, | 167 | .map_io = ep93xx_map_io, |
168 | .init_irq = ep93xx_init_irq, | 168 | .init_irq = ep93xx_init_irq, |
diff --git a/arch/arm/mach-mv78xx0/pcie.c b/arch/arm/mach-mv78xx0/pcie.c index a560439dcc3c..f27c7d2fa9f7 100644 --- a/arch/arm/mach-mv78xx0/pcie.c +++ b/arch/arm/mach-mv78xx0/pcie.c | |||
@@ -129,12 +129,12 @@ static void __init mv78xx0_pcie_preinit(void) | |||
129 | struct pcie_port *pp = pcie_port + i; | 129 | struct pcie_port *pp = pcie_port + i; |
130 | 130 | ||
131 | mv78xx0_setup_pcie_io_win(win++, pp->res[0].start, | 131 | mv78xx0_setup_pcie_io_win(win++, pp->res[0].start, |
132 | pp->res[0].end - pp->res[0].start + 1, | 132 | resource_size(&pp->res[0]), |
133 | pp->maj, pp->min); | 133 | pp->maj, pp->min); |
134 | 134 | ||
135 | mv78xx0_setup_pcie_mem_win(win++, pp->res[1].start, | 135 | mv78xx0_setup_pcie_mem_win(win++, pp->res[1].start, |
136 | pp->res[1].end - pp->res[1].start + 1, | 136 | resource_size(&pp->res[1]), |
137 | pp->maj, pp->min); | 137 | pp->maj, pp->min); |
138 | } | 138 | } |
139 | } | 139 | } |
140 | 140 | ||
diff --git a/arch/arm/mach-pxa/include/mach/corgi.h b/arch/arm/mach-pxa/include/mach/corgi.h index 0011055bc3f9..5dfd1195a5a7 100644 --- a/arch/arm/mach-pxa/include/mach/corgi.h +++ b/arch/arm/mach-pxa/include/mach/corgi.h | |||
@@ -34,7 +34,7 @@ | |||
34 | #define CORGI_GPIO_LCDCON_CS (19) /* LCD Control Chip Select */ | 34 | #define CORGI_GPIO_LCDCON_CS (19) /* LCD Control Chip Select */ |
35 | #define CORGI_GPIO_MAX1111_CS (20) /* MAX1111 Chip Select */ | 35 | #define CORGI_GPIO_MAX1111_CS (20) /* MAX1111 Chip Select */ |
36 | #define CORGI_GPIO_ADC_TEMP_ON (21) /* Select battery voltage or temperature */ | 36 | #define CORGI_GPIO_ADC_TEMP_ON (21) /* Select battery voltage or temperature */ |
37 | #define CORGI_GPIO_IR_ON (22) /* Enable IR Transciever */ | 37 | #define CORGI_GPIO_IR_ON (22) /* Enable IR Transceiver */ |
38 | #define CORGI_GPIO_ADS7846_CS (24) /* ADS7846 Chip Select */ | 38 | #define CORGI_GPIO_ADS7846_CS (24) /* ADS7846 Chip Select */ |
39 | #define CORGI_GPIO_SD_PWR (33) /* MMC/SD Power */ | 39 | #define CORGI_GPIO_SD_PWR (33) /* MMC/SD Power */ |
40 | #define CORGI_GPIO_CHRG_ON (38) /* Enable battery Charging */ | 40 | #define CORGI_GPIO_CHRG_ON (38) /* Enable battery Charging */ |
diff --git a/arch/arm/mach-pxa/include/mach/pxa27x-udc.h b/arch/arm/mach-pxa/include/mach/pxa27x-udc.h index ab1443f8bd89..4cf28f670706 100644 --- a/arch/arm/mach-pxa/include/mach/pxa27x-udc.h +++ b/arch/arm/mach-pxa/include/mach/pxa27x-udc.h | |||
@@ -56,9 +56,9 @@ | |||
56 | #define UDCFNR __REG(0x40600014) /* UDC Frame Number Register */ | 56 | #define UDCFNR __REG(0x40600014) /* UDC Frame Number Register */ |
57 | #define UDCOTGICR __REG(0x40600018) /* UDC On-The-Go interrupt control */ | 57 | #define UDCOTGICR __REG(0x40600018) /* UDC On-The-Go interrupt control */ |
58 | #define UDCOTGICR_IESF (1 << 24) /* OTG SET_FEATURE command recvd */ | 58 | #define UDCOTGICR_IESF (1 << 24) /* OTG SET_FEATURE command recvd */ |
59 | #define UDCOTGICR_IEXR (1 << 17) /* Extra Transciever Interrupt | 59 | #define UDCOTGICR_IEXR (1 << 17) /* Extra Transceiver Interrupt |
60 | Rising Edge Interrupt Enable */ | 60 | Rising Edge Interrupt Enable */ |
61 | #define UDCOTGICR_IEXF (1 << 16) /* Extra Transciever Interrupt | 61 | #define UDCOTGICR_IEXF (1 << 16) /* Extra Transceiver Interrupt |
62 | Falling Edge Interrupt Enable */ | 62 | Falling Edge Interrupt Enable */ |
63 | #define UDCOTGICR_IEVV40R (1 << 9) /* OTG Vbus Valid 4.0V Rising Edge | 63 | #define UDCOTGICR_IEVV40R (1 << 9) /* OTG Vbus Valid 4.0V Rising Edge |
64 | Interrupt Enable */ | 64 | Interrupt Enable */ |
diff --git a/arch/arm/mach-s3c2410/h1940-bluetooth.c b/arch/arm/mach-s3c2410/h1940-bluetooth.c index 2c126bbca08d..a5eeb62ce1c2 100644 --- a/arch/arm/mach-s3c2410/h1940-bluetooth.c +++ b/arch/arm/mach-s3c2410/h1940-bluetooth.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/leds.h> | 18 | #include <linux/leds.h> |
19 | #include <linux/gpio.h> | 19 | #include <linux/gpio.h> |
20 | #include <linux/rfkill.h> | 20 | #include <linux/rfkill.h> |
21 | #include <linux/leds.h> | ||
22 | 21 | ||
23 | #include <mach/regs-gpio.h> | 22 | #include <mach/regs-gpio.h> |
24 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index b473b8efac68..837138e369bc 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c | |||
@@ -443,7 +443,7 @@ static struct platform_device usb1_host_device = { | |||
443 | .resource = usb1_host_resources, | 443 | .resource = usb1_host_resources, |
444 | }; | 444 | }; |
445 | 445 | ||
446 | const static struct fb_videomode ap4evb_lcdc_modes[] = { | 446 | static const struct fb_videomode ap4evb_lcdc_modes[] = { |
447 | { | 447 | { |
448 | #ifdef CONFIG_AP4EVB_QHD | 448 | #ifdef CONFIG_AP4EVB_QHD |
449 | .name = "R63302(QHD)", | 449 | .name = "R63302(QHD)", |
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c index 513d6abec1f5..399c89f14dfb 100644 --- a/arch/arm/mach-u300/core.c +++ b/arch/arm/mach-u300/core.c | |||
@@ -1791,7 +1791,7 @@ static void __init u300_assign_physmem(void) | |||
1791 | 0 == res->start) { | 1791 | 0 == res->start) { |
1792 | res->start = curr_start; | 1792 | res->start = curr_start; |
1793 | res->end += curr_start; | 1793 | res->end += curr_start; |
1794 | curr_start += (res->end - res->start + 1); | 1794 | curr_start += resource_size(res); |
1795 | 1795 | ||
1796 | printk(KERN_INFO "core.c: Mapping RAM " \ | 1796 | printk(KERN_INFO "core.c: Mapping RAM " \ |
1797 | "%#x-%#x to device %s:%s\n", | 1797 | "%#x-%#x to device %s:%s\n", |
diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c index 9ed0f90cfe23..0f2e522f387d 100644 --- a/arch/arm/mach-ux500/board-mop500-regulators.c +++ b/arch/arm/mach-ux500/board-mop500-regulators.c | |||
@@ -77,7 +77,7 @@ static struct regulator_consumer_supply ab8500_vtvout_consumers[] = { | |||
77 | static struct regulator_consumer_supply ab8500_vintcore_consumers[] = { | 77 | static struct regulator_consumer_supply ab8500_vintcore_consumers[] = { |
78 | /* SoC core supply, no device */ | 78 | /* SoC core supply, no device */ |
79 | REGULATOR_SUPPLY("v-intcore", NULL), | 79 | REGULATOR_SUPPLY("v-intcore", NULL), |
80 | /* USB Transciever */ | 80 | /* USB Transceiver */ |
81 | REGULATOR_SUPPLY("vddulpivio18", "ab8500-usb.0"), | 81 | REGULATOR_SUPPLY("vddulpivio18", "ab8500-usb.0"), |
82 | }; | 82 | }; |
83 | 83 | ||
diff --git a/arch/arm/plat-s5p/sysmmu.c b/arch/arm/plat-s5p/sysmmu.c index 54f5eddc921d..e1cbc728c775 100644 --- a/arch/arm/plat-s5p/sysmmu.c +++ b/arch/arm/plat-s5p/sysmmu.c | |||
@@ -232,8 +232,8 @@ static int s5p_sysmmu_probe(struct platform_device *pdev) | |||
232 | goto err_res; | 232 | goto err_res; |
233 | } | 233 | } |
234 | 234 | ||
235 | mem = request_mem_region(res->start, | 235 | mem = request_mem_region(res->start, resource_size(res), |
236 | ((res->end) - (res->start)) + 1, pdev->name); | 236 | pdev->name); |
237 | if (!mem) { | 237 | if (!mem) { |
238 | dev_err(dev, "Failed to request the memory region of %s.\n", | 238 | dev_err(dev, "Failed to request the memory region of %s.\n", |
239 | sysmmu_ips_name[i]); | 239 | sysmmu_ips_name[i]); |
@@ -241,7 +241,7 @@ static int s5p_sysmmu_probe(struct platform_device *pdev) | |||
241 | goto err_res; | 241 | goto err_res; |
242 | } | 242 | } |
243 | 243 | ||
244 | sysmmusfrs[i] = ioremap(res->start, res->end - res->start + 1); | 244 | sysmmusfrs[i] = ioremap(res->start, resource_size(res)); |
245 | if (!sysmmusfrs[i]) { | 245 | if (!sysmmusfrs[i]) { |
246 | dev_err(dev, "Failed to ioremap() for %s.\n", | 246 | dev_err(dev, "Failed to ioremap() for %s.\n", |
247 | sysmmu_ips_name[i]); | 247 | sysmmu_ips_name[i]); |
diff --git a/arch/arm/plat-samsung/pm-check.c b/arch/arm/plat-samsung/pm-check.c index 6b733fafe7cd..3cbd62666b1e 100644 --- a/arch/arm/plat-samsung/pm-check.c +++ b/arch/arm/plat-samsung/pm-check.c | |||
@@ -72,7 +72,7 @@ static void s3c_pm_run_sysram(run_fn_t fn, u32 *arg) | |||
72 | 72 | ||
73 | static u32 *s3c_pm_countram(struct resource *res, u32 *val) | 73 | static u32 *s3c_pm_countram(struct resource *res, u32 *val) |
74 | { | 74 | { |
75 | u32 size = (u32)(res->end - res->start)+1; | 75 | u32 size = (u32)resource_size(res); |
76 | 76 | ||
77 | size += CHECK_CHUNKSIZE-1; | 77 | size += CHECK_CHUNKSIZE-1; |
78 | size /= CHECK_CHUNKSIZE; | 78 | size /= CHECK_CHUNKSIZE; |
diff --git a/arch/avr32/kernel/setup.c b/arch/avr32/kernel/setup.c index bb0974cce4ac..b4247f478065 100644 --- a/arch/avr32/kernel/setup.c +++ b/arch/avr32/kernel/setup.c | |||
@@ -444,7 +444,7 @@ static unsigned long __init | |||
444 | find_bootmap_pfn(const struct resource *mem) | 444 | find_bootmap_pfn(const struct resource *mem) |
445 | { | 445 | { |
446 | unsigned long bootmap_pages, bootmap_len; | 446 | unsigned long bootmap_pages, bootmap_len; |
447 | unsigned long node_pages = PFN_UP(mem->end - mem->start + 1); | 447 | unsigned long node_pages = PFN_UP(resource_size(mem)); |
448 | unsigned long bootmap_start; | 448 | unsigned long bootmap_start; |
449 | 449 | ||
450 | bootmap_pages = bootmem_bootmap_pages(node_pages); | 450 | bootmap_pages = bootmem_bootmap_pages(node_pages); |
@@ -541,10 +541,10 @@ static void __init setup_bootmem(void) | |||
541 | */ | 541 | */ |
542 | if (res->start >= PFN_PHYS(first_pfn) | 542 | if (res->start >= PFN_PHYS(first_pfn) |
543 | && res->end < PFN_PHYS(max_pfn)) | 543 | && res->end < PFN_PHYS(max_pfn)) |
544 | reserve_bootmem_node( | 544 | reserve_bootmem_node(NODE_DATA(node), |
545 | NODE_DATA(node), res->start, | 545 | res->start, |
546 | res->end - res->start + 1, | 546 | resource_size(res), |
547 | BOOTMEM_DEFAULT); | 547 | BOOTMEM_DEFAULT); |
548 | } | 548 | } |
549 | 549 | ||
550 | node_set_online(node); | 550 | node_set_online(node); |
diff --git a/arch/avr32/mach-at32ap/extint.c b/arch/avr32/mach-at32ap/extint.c index fbc2aeaebddb..cfb298d66305 100644 --- a/arch/avr32/mach-at32ap/extint.c +++ b/arch/avr32/mach-at32ap/extint.c | |||
@@ -204,7 +204,7 @@ static int __init eic_probe(struct platform_device *pdev) | |||
204 | } | 204 | } |
205 | 205 | ||
206 | eic->first_irq = EIM_IRQ_BASE + 32 * pdev->id; | 206 | eic->first_irq = EIM_IRQ_BASE + 32 * pdev->id; |
207 | eic->regs = ioremap(regs->start, regs->end - regs->start + 1); | 207 | eic->regs = ioremap(regs->start, resource_size(regs)); |
208 | if (!eic->regs) { | 208 | if (!eic->regs) { |
209 | dev_dbg(&pdev->dev, "failed to map regs\n"); | 209 | dev_dbg(&pdev->dev, "failed to map regs\n"); |
210 | goto err_ioremap; | 210 | goto err_ioremap; |
diff --git a/arch/avr32/mach-at32ap/hsmc.c b/arch/avr32/mach-at32ap/hsmc.c index f7672d3e86b8..f66245e6e63e 100644 --- a/arch/avr32/mach-at32ap/hsmc.c +++ b/arch/avr32/mach-at32ap/hsmc.c | |||
@@ -245,7 +245,7 @@ static int hsmc_probe(struct platform_device *pdev) | |||
245 | 245 | ||
246 | hsmc->pclk = pclk; | 246 | hsmc->pclk = pclk; |
247 | hsmc->mck = mck; | 247 | hsmc->mck = mck; |
248 | hsmc->regs = ioremap(regs->start, regs->end - regs->start + 1); | 248 | hsmc->regs = ioremap(regs->start, resource_size(regs)); |
249 | if (!hsmc->regs) | 249 | if (!hsmc->regs) |
250 | goto out_disable_clocks; | 250 | goto out_disable_clocks; |
251 | 251 | ||
diff --git a/arch/avr32/mach-at32ap/intc.c b/arch/avr32/mach-at32ap/intc.c index c9ac2f8e8f64..258682bc1278 100644 --- a/arch/avr32/mach-at32ap/intc.c +++ b/arch/avr32/mach-at32ap/intc.c | |||
@@ -107,7 +107,7 @@ void __init init_IRQ(void) | |||
107 | 107 | ||
108 | clk_enable(pclk); | 108 | clk_enable(pclk); |
109 | 109 | ||
110 | intc0.regs = ioremap(regs->start, regs->end - regs->start + 1); | 110 | intc0.regs = ioremap(regs->start, resource_size(regs)); |
111 | if (!intc0.regs) { | 111 | if (!intc0.regs) { |
112 | printk(KERN_EMERG "intc: failed to map registers (0x%08lx)\n", | 112 | printk(KERN_EMERG "intc: failed to map registers (0x%08lx)\n", |
113 | (unsigned long)regs->start); | 113 | (unsigned long)regs->start); |
diff --git a/arch/avr32/mach-at32ap/pio.c b/arch/avr32/mach-at32ap/pio.c index 2e0aa853a4bc..9b39dea6682f 100644 --- a/arch/avr32/mach-at32ap/pio.c +++ b/arch/avr32/mach-at32ap/pio.c | |||
@@ -461,7 +461,7 @@ void __init at32_init_pio(struct platform_device *pdev) | |||
461 | clk_enable(pio->clk); | 461 | clk_enable(pio->clk); |
462 | 462 | ||
463 | pio->pdev = pdev; | 463 | pio->pdev = pdev; |
464 | pio->regs = ioremap(regs->start, regs->end - regs->start + 1); | 464 | pio->regs = ioremap(regs->start, resource_size(regs)); |
465 | 465 | ||
466 | /* start with irqs disabled and acked */ | 466 | /* start with irqs disabled and acked */ |
467 | pio_writel(pio, IDR, ~0UL); | 467 | pio_writel(pio, IDR, ~0UL); |
diff --git a/arch/h8300/kernel/setup.c b/arch/h8300/kernel/setup.c index 7fda657110eb..68d651081bd3 100644 --- a/arch/h8300/kernel/setup.c +++ b/arch/h8300/kernel/setup.c | |||
@@ -46,7 +46,7 @@ | |||
46 | #include <asm/regs267x.h> | 46 | #include <asm/regs267x.h> |
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | #define STUBSIZE 0xc000; | 49 | #define STUBSIZE 0xc000 |
50 | 50 | ||
51 | unsigned long rom_length; | 51 | unsigned long rom_length; |
52 | unsigned long memory_start; | 52 | unsigned long memory_start; |
diff --git a/arch/ia64/include/asm/sn/tioce.h b/arch/ia64/include/asm/sn/tioce.h index 893468e1b41b..6eae8ada90f0 100644 --- a/arch/ia64/include/asm/sn/tioce.h +++ b/arch/ia64/include/asm/sn/tioce.h | |||
@@ -467,7 +467,7 @@ typedef volatile struct tioce { | |||
467 | #define CE_LSI_GB_CFG1_RXL0S_THS_SHFT 0 | 467 | #define CE_LSI_GB_CFG1_RXL0S_THS_SHFT 0 |
468 | #define CE_LSI_GB_CFG1_RXL0S_THS_MASK (0xffULL << 0) | 468 | #define CE_LSI_GB_CFG1_RXL0S_THS_MASK (0xffULL << 0) |
469 | #define CE_LSI_GB_CFG1_RXL0S_SMP_SHFT 8 | 469 | #define CE_LSI_GB_CFG1_RXL0S_SMP_SHFT 8 |
470 | #define CE_LSI_GB_CFG1_RXL0S_SMP_MASK (0xfULL << 8); | 470 | #define CE_LSI_GB_CFG1_RXL0S_SMP_MASK (0xfULL << 8) |
471 | #define CE_LSI_GB_CFG1_RXL0S_ADJ_SHFT 12 | 471 | #define CE_LSI_GB_CFG1_RXL0S_ADJ_SHFT 12 |
472 | #define CE_LSI_GB_CFG1_RXL0S_ADJ_MASK (0x7ULL << 12) | 472 | #define CE_LSI_GB_CFG1_RXL0S_ADJ_MASK (0x7ULL << 12) |
473 | #define CE_LSI_GB_CFG1_RXL0S_FLT_SHFT 15 | 473 | #define CE_LSI_GB_CFG1_RXL0S_FLT_SHFT 15 |
diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c index 041b1d86d75b..4cfae20f1067 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c | |||
@@ -94,7 +94,7 @@ void pcibios_free_controller(struct pci_controller *phb) | |||
94 | 94 | ||
95 | static resource_size_t pcibios_io_size(const struct pci_controller *hose) | 95 | static resource_size_t pcibios_io_size(const struct pci_controller *hose) |
96 | { | 96 | { |
97 | return hose->io_resource.end - hose->io_resource.start + 1; | 97 | return resource_size(&hose->io_resource); |
98 | } | 98 | } |
99 | 99 | ||
100 | int pcibios_vaddr_is_ioport(void __iomem *address) | 100 | int pcibios_vaddr_is_ioport(void __iomem *address) |
diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c index 73b529b57433..cfae81571ded 100644 --- a/arch/mips/bcm47xx/setup.c +++ b/arch/mips/bcm47xx/setup.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2004 Florian Schirmer <jolt@tuxbox.org> | 2 | * Copyright (C) 2004 Florian Schirmer <jolt@tuxbox.org> |
3 | * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org> | 3 | * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org> |
4 | * Copyright (C) 2006 Michael Buesch <mb@bu3sch.de> | 4 | * Copyright (C) 2006 Michael Buesch <m@bues.ch> |
5 | * Copyright (C) 2010 Waldemar Brodkorb <wbx@openadk.org> | 5 | * Copyright (C) 2010 Waldemar Brodkorb <wbx@openadk.org> |
6 | * Copyright (C) 2010-2011 Hauke Mehrtens <hauke@hauke-m.de> | 6 | * Copyright (C) 2010-2011 Hauke Mehrtens <hauke@hauke-m.de> |
7 | * | 7 | * |
diff --git a/arch/mips/include/asm/floppy.h b/arch/mips/include/asm/floppy.h index c5c7c0e6064c..4456c9c47e21 100644 --- a/arch/mips/include/asm/floppy.h +++ b/arch/mips/include/asm/floppy.h | |||
@@ -29,7 +29,7 @@ static inline void fd_cacheflush(char * addr, long size) | |||
29 | #define FLOPPY0_TYPE fd_drive_type(0) | 29 | #define FLOPPY0_TYPE fd_drive_type(0) |
30 | #define FLOPPY1_TYPE fd_drive_type(1) | 30 | #define FLOPPY1_TYPE fd_drive_type(1) |
31 | 31 | ||
32 | #define FDC1 fd_getfdaddr1(); | 32 | #define FDC1 fd_getfdaddr1() |
33 | 33 | ||
34 | #define N_FDC 1 /* do you *really* want a second controller? */ | 34 | #define N_FDC 1 /* do you *really* want a second controller? */ |
35 | #define N_DRIVE 8 | 35 | #define N_DRIVE 8 |
diff --git a/arch/mips/include/asm/mach-jz4740/gpio.h b/arch/mips/include/asm/mach-jz4740/gpio.h index 7b74703745bb..1a6482ea0bb3 100644 --- a/arch/mips/include/asm/mach-jz4740/gpio.h +++ b/arch/mips/include/asm/mach-jz4740/gpio.h | |||
@@ -25,14 +25,13 @@ enum jz_gpio_function { | |||
25 | JZ_GPIO_FUNC3, | 25 | JZ_GPIO_FUNC3, |
26 | }; | 26 | }; |
27 | 27 | ||
28 | |||
29 | /* | 28 | /* |
30 | Usually a driver for a SoC component has to request several gpio pins and | 29 | Usually a driver for a SoC component has to request several gpio pins and |
31 | configure them as funcion pins. | 30 | configure them as funcion pins. |
32 | jz_gpio_bulk_request can be used to ease this process. | 31 | jz_gpio_bulk_request can be used to ease this process. |
33 | Usually one would do something like: | 32 | Usually one would do something like: |
34 | 33 | ||
35 | const static struct jz_gpio_bulk_request i2c_pins[] = { | 34 | static const struct jz_gpio_bulk_request i2c_pins[] = { |
36 | JZ_GPIO_BULK_PIN(I2C_SDA), | 35 | JZ_GPIO_BULK_PIN(I2C_SDA), |
37 | JZ_GPIO_BULK_PIN(I2C_SCK), | 36 | JZ_GPIO_BULK_PIN(I2C_SCK), |
38 | }; | 37 | }; |
@@ -47,8 +46,8 @@ enum jz_gpio_function { | |||
47 | 46 | ||
48 | jz_gpio_bulk_free(i2c_pins, ARRAY_SIZE(i2c_pins)); | 47 | jz_gpio_bulk_free(i2c_pins, ARRAY_SIZE(i2c_pins)); |
49 | 48 | ||
50 | |||
51 | */ | 49 | */ |
50 | |||
52 | struct jz_gpio_bulk_request { | 51 | struct jz_gpio_bulk_request { |
53 | int gpio; | 52 | int gpio; |
54 | const char *name; | 53 | const char *name; |
diff --git a/arch/mips/lantiq/devices.c b/arch/mips/lantiq/devices.c index 7b82c34cb169..44a36771c819 100644 --- a/arch/mips/lantiq/devices.c +++ b/arch/mips/lantiq/devices.c | |||
@@ -15,11 +15,9 @@ | |||
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/leds.h> | 16 | #include <linux/leds.h> |
17 | #include <linux/etherdevice.h> | 17 | #include <linux/etherdevice.h> |
18 | #include <linux/reboot.h> | ||
19 | #include <linux/time.h> | 18 | #include <linux/time.h> |
20 | #include <linux/io.h> | 19 | #include <linux/io.h> |
21 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
22 | #include <linux/leds.h> | ||
23 | 21 | ||
24 | #include <asm/bootinfo.h> | 22 | #include <asm/bootinfo.h> |
25 | #include <asm/irq.h> | 23 | #include <asm/irq.h> |
diff --git a/arch/mips/lantiq/xway/devices.c b/arch/mips/lantiq/xway/devices.c index e09e789dfc27..d0e32ab2ea07 100644 --- a/arch/mips/lantiq/xway/devices.c +++ b/arch/mips/lantiq/xway/devices.c | |||
@@ -16,11 +16,9 @@ | |||
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/leds.h> | 17 | #include <linux/leds.h> |
18 | #include <linux/etherdevice.h> | 18 | #include <linux/etherdevice.h> |
19 | #include <linux/reboot.h> | ||
20 | #include <linux/time.h> | 19 | #include <linux/time.h> |
21 | #include <linux/io.h> | 20 | #include <linux/io.h> |
22 | #include <linux/gpio.h> | 21 | #include <linux/gpio.h> |
23 | #include <linux/leds.h> | ||
24 | 22 | ||
25 | #include <asm/bootinfo.h> | 23 | #include <asm/bootinfo.h> |
26 | #include <asm/irq.h> | 24 | #include <asm/irq.h> |
diff --git a/arch/mips/pci/pci-rc32434.c b/arch/mips/pci/pci-rc32434.c index f31218e17d3c..764362ce5e40 100644 --- a/arch/mips/pci/pci-rc32434.c +++ b/arch/mips/pci/pci-rc32434.c | |||
@@ -215,7 +215,7 @@ static int __init rc32434_pci_init(void) | |||
215 | rc32434_pcibridge_init(); | 215 | rc32434_pcibridge_init(); |
216 | 216 | ||
217 | io_map_base = ioremap(rc32434_res_pci_io1.start, | 217 | io_map_base = ioremap(rc32434_res_pci_io1.start, |
218 | rc32434_res_pci_io1.end - rc32434_res_pci_io1.start + 1); | 218 | resource_size(&rcrc32434_res_pci_io1)); |
219 | 219 | ||
220 | if (!io_map_base) | 220 | if (!io_map_base) |
221 | return -ENOMEM; | 221 | return -ENOMEM; |
diff --git a/arch/mips/pci/pci-vr41xx.c b/arch/mips/pci/pci-vr41xx.c index 56525711f8b7..444b8d8004ad 100644 --- a/arch/mips/pci/pci-vr41xx.c +++ b/arch/mips/pci/pci-vr41xx.c | |||
@@ -305,7 +305,7 @@ static int __init vr41xx_pciu_init(void) | |||
305 | struct resource *res = vr41xx_pci_controller.io_resource; | 305 | struct resource *res = vr41xx_pci_controller.io_resource; |
306 | master = setup->master_io; | 306 | master = setup->master_io; |
307 | io_map_base = ioremap(master->bus_base_address, | 307 | io_map_base = ioremap(master->bus_base_address, |
308 | res->end - res->start + 1); | 308 | resource_size(res)); |
309 | if (!io_map_base) | 309 | if (!io_map_base) |
310 | return -EBUSY; | 310 | return -EBUSY; |
311 | 311 | ||
diff --git a/arch/mips/powertv/asic/asic_devices.c b/arch/mips/powertv/asic/asic_devices.c index e56fa61b3991..bce1872249ba 100644 --- a/arch/mips/powertv/asic/asic_devices.c +++ b/arch/mips/powertv/asic/asic_devices.c | |||
@@ -394,23 +394,21 @@ void __init platform_alloc_bootmem(void) | |||
394 | 394 | ||
395 | /* Loop through looking for resources that want a particular address */ | 395 | /* Loop through looking for resources that want a particular address */ |
396 | for (i = 0; gp_resources[i].flags != 0; i++) { | 396 | for (i = 0; gp_resources[i].flags != 0; i++) { |
397 | int size = gp_resources[i].end - gp_resources[i].start + 1; | 397 | int size = resource_size(&gp_resources[i]); |
398 | if ((gp_resources[i].start != 0) && | 398 | if ((gp_resources[i].start != 0) && |
399 | ((gp_resources[i].flags & IORESOURCE_MEM) != 0)) { | 399 | ((gp_resources[i].flags & IORESOURCE_MEM) != 0)) { |
400 | reserve_bootmem(dma_to_phys(gp_resources[i].start), | 400 | reserve_bootmem(dma_to_phys(gp_resources[i].start), |
401 | size, 0); | 401 | size, 0); |
402 | total += gp_resources[i].end - | 402 | total += resource_size(&gp_resources[i]); |
403 | gp_resources[i].start + 1; | ||
404 | pr_info("reserve resource %s at %08x (%u bytes)\n", | 403 | pr_info("reserve resource %s at %08x (%u bytes)\n", |
405 | gp_resources[i].name, gp_resources[i].start, | 404 | gp_resources[i].name, gp_resources[i].start, |
406 | gp_resources[i].end - | 405 | resource_size(&gp_resources[i])); |
407 | gp_resources[i].start + 1); | ||
408 | } | 406 | } |
409 | } | 407 | } |
410 | 408 | ||
411 | /* Loop through assigning addresses for those that are left */ | 409 | /* Loop through assigning addresses for those that are left */ |
412 | for (i = 0; gp_resources[i].flags != 0; i++) { | 410 | for (i = 0; gp_resources[i].flags != 0; i++) { |
413 | int size = gp_resources[i].end - gp_resources[i].start + 1; | 411 | int size = resource_size(&gp_resources[i]); |
414 | if ((gp_resources[i].start == 0) && | 412 | if ((gp_resources[i].start == 0) && |
415 | ((gp_resources[i].flags & IORESOURCE_MEM) != 0)) { | 413 | ((gp_resources[i].flags & IORESOURCE_MEM) != 0)) { |
416 | void *mem = alloc_bootmem_pages(size); | 414 | void *mem = alloc_bootmem_pages(size); |
diff --git a/arch/parisc/include/asm/dma-mapping.h b/arch/parisc/include/asm/dma-mapping.h index 4ef73b09b168..890531e32fe8 100644 --- a/arch/parisc/include/asm/dma-mapping.h +++ b/arch/parisc/include/asm/dma-mapping.h | |||
@@ -210,7 +210,7 @@ parisc_walk_tree(struct device *dev) | |||
210 | return dev->platform_data; | 210 | return dev->platform_data; |
211 | } | 211 | } |
212 | 212 | ||
213 | #define GET_IOC(dev) (HBA_DATA(parisc_walk_tree(dev))->iommu); | 213 | #define GET_IOC(dev) (HBA_DATA(parisc_walk_tree(dev))->iommu) |
214 | 214 | ||
215 | 215 | ||
216 | #ifdef CONFIG_IOMMU_CCIO | 216 | #ifdef CONFIG_IOMMU_CCIO |
diff --git a/arch/parisc/math-emu/decode_exc.c b/arch/parisc/math-emu/decode_exc.c index 27a7492ddb0d..04e550e76ae8 100644 --- a/arch/parisc/math-emu/decode_exc.c +++ b/arch/parisc/math-emu/decode_exc.c | |||
@@ -56,7 +56,7 @@ | |||
56 | /* General definitions */ | 56 | /* General definitions */ |
57 | #define DOESTRAP 1 | 57 | #define DOESTRAP 1 |
58 | #define NOTRAP 0 | 58 | #define NOTRAP 0 |
59 | #define SIGNALCODE(signal, code) ((signal) << 24 | (code)); | 59 | #define SIGNALCODE(signal, code) ((signal) << 24 | (code)) |
60 | #define copropbit 1<<31-2 /* bit position 2 */ | 60 | #define copropbit 1<<31-2 /* bit position 2 */ |
61 | #define opclass 9 /* bits 21 & 22 */ | 61 | #define opclass 9 /* bits 21 & 22 */ |
62 | #define fmt 11 /* bits 19 & 20 */ | 62 | #define fmt 11 /* bits 19 & 20 */ |
diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h index 2b917c69ed15..3bf9cca35147 100644 --- a/arch/powerpc/include/asm/elf.h +++ b/arch/powerpc/include/asm/elf.h | |||
@@ -267,7 +267,7 @@ extern int ucache_bsize; | |||
267 | struct linux_binprm; | 267 | struct linux_binprm; |
268 | extern int arch_setup_additional_pages(struct linux_binprm *bprm, | 268 | extern int arch_setup_additional_pages(struct linux_binprm *bprm, |
269 | int uses_interp); | 269 | int uses_interp); |
270 | #define VDSO_AUX_ENT(a,b) NEW_AUX_ENT(a,b); | 270 | #define VDSO_AUX_ENT(a,b) NEW_AUX_ENT(a,b) |
271 | 271 | ||
272 | /* 1GB for 64bit, 8MB for 32bit */ | 272 | /* 1GB for 64bit, 8MB for 32bit */ |
273 | #define STACK_RND_MASK (is_32bit_task() ? \ | 273 | #define STACK_RND_MASK (is_32bit_task() ? \ |
@@ -298,7 +298,7 @@ do { \ | |||
298 | NEW_AUX_ENT(AT_DCACHEBSIZE, dcache_bsize); \ | 298 | NEW_AUX_ENT(AT_DCACHEBSIZE, dcache_bsize); \ |
299 | NEW_AUX_ENT(AT_ICACHEBSIZE, icache_bsize); \ | 299 | NEW_AUX_ENT(AT_ICACHEBSIZE, icache_bsize); \ |
300 | NEW_AUX_ENT(AT_UCACHEBSIZE, ucache_bsize); \ | 300 | NEW_AUX_ENT(AT_UCACHEBSIZE, ucache_bsize); \ |
301 | VDSO_AUX_ENT(AT_SYSINFO_EHDR, current->mm->context.vdso_base) \ | 301 | VDSO_AUX_ENT(AT_SYSINFO_EHDR, current->mm->context.vdso_base); \ |
302 | } while (0) | 302 | } while (0) |
303 | 303 | ||
304 | /* PowerPC64 relocations defined by the ABIs */ | 304 | /* PowerPC64 relocations defined by the ABIs */ |
diff --git a/arch/powerpc/include/asm/macio.h b/arch/powerpc/include/asm/macio.h index 7ab82c825a03..27af7f8bbb8d 100644 --- a/arch/powerpc/include/asm/macio.h +++ b/arch/powerpc/include/asm/macio.h | |||
@@ -76,7 +76,7 @@ static inline unsigned long macio_resource_len(struct macio_dev *dev, int resour | |||
76 | struct resource *res = &dev->resource[resource_no]; | 76 | struct resource *res = &dev->resource[resource_no]; |
77 | if (res->start == 0 || res->end == 0 || res->end < res->start) | 77 | if (res->start == 0 || res->end == 0 || res->end < res->start) |
78 | return 0; | 78 | return 0; |
79 | return res->end - res->start + 1; | 79 | return resource_size(res); |
80 | } | 80 | } |
81 | 81 | ||
82 | extern int macio_enable_devres(struct macio_dev *dev); | 82 | extern int macio_enable_devres(struct macio_dev *dev); |
diff --git a/arch/powerpc/include/asm/smu.h b/arch/powerpc/include/asm/smu.h index e3bdada8c542..ae20ce1af4c7 100644 --- a/arch/powerpc/include/asm/smu.h +++ b/arch/powerpc/include/asm/smu.h | |||
@@ -547,7 +547,7 @@ struct smu_sdbp_header { | |||
547 | * (currently, afaik, this concerns only the FVT partition | 547 | * (currently, afaik, this concerns only the FVT partition |
548 | * (0x12) | 548 | * (0x12) |
549 | */ | 549 | */ |
550 | #define SMU_U16_MIX(x) le16_to_cpu(x); | 550 | #define SMU_U16_MIX(x) le16_to_cpu(x) |
551 | #define SMU_U32_MIX(x) ((((x) & 0xff00ff00u) >> 8)|(((x) & 0x00ff00ffu) << 8)) | 551 | #define SMU_U32_MIX(x) ((((x) & 0xff00ff00u) >> 8)|(((x) & 0x00ff00ffu) << 8)) |
552 | 552 | ||
553 | 553 | ||
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c index 7ee50f0547cb..6658a1589955 100644 --- a/arch/powerpc/kernel/machine_kexec.c +++ b/arch/powerpc/kernel/machine_kexec.c | |||
@@ -126,7 +126,7 @@ void __init reserve_crashkernel(void) | |||
126 | /* We might have got these values via the command line or the | 126 | /* We might have got these values via the command line or the |
127 | * device tree, either way sanitise them now. */ | 127 | * device tree, either way sanitise them now. */ |
128 | 128 | ||
129 | crash_size = crashk_res.end - crashk_res.start + 1; | 129 | crash_size = resource_size(&crashk_res); |
130 | 130 | ||
131 | #ifndef CONFIG_RELOCATABLE | 131 | #ifndef CONFIG_RELOCATABLE |
132 | if (crashk_res.start != KDUMP_KERNELBASE) | 132 | if (crashk_res.start != KDUMP_KERNELBASE) |
@@ -222,7 +222,7 @@ static void __init export_crashk_values(struct device_node *node) | |||
222 | 222 | ||
223 | if (crashk_res.start != 0) { | 223 | if (crashk_res.start != 0) { |
224 | prom_add_property(node, &crashk_base_prop); | 224 | prom_add_property(node, &crashk_base_prop); |
225 | crashk_size = crashk_res.end - crashk_res.start + 1; | 225 | crashk_size = resource_size(&crashk_res); |
226 | prom_add_property(node, &crashk_size_prop); | 226 | prom_add_property(node, &crashk_size_prop); |
227 | } | 227 | } |
228 | } | 228 | } |
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index a3c92770e422..45ebb14c5c27 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -107,7 +107,7 @@ static resource_size_t pcibios_io_size(const struct pci_controller *hose) | |||
107 | #ifdef CONFIG_PPC64 | 107 | #ifdef CONFIG_PPC64 |
108 | return hose->pci_io_size; | 108 | return hose->pci_io_size; |
109 | #else | 109 | #else |
110 | return hose->io_resource.end - hose->io_resource.start + 1; | 110 | return resource_size(&hose->io_resource); |
111 | #endif | 111 | #endif |
112 | } | 112 | } |
113 | 113 | ||
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pci.c b/arch/powerpc/platforms/52xx/mpc52xx_pci.c index da110bd88346..5f5e69309080 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_pci.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_pci.c | |||
@@ -264,7 +264,7 @@ mpc52xx_pci_setup(struct pci_controller *hose, | |||
264 | (unsigned long long)res->flags); | 264 | (unsigned long long)res->flags); |
265 | out_be32(&pci_regs->iw0btar, | 265 | out_be32(&pci_regs->iw0btar, |
266 | MPC52xx_PCI_IWBTAR_TRANSLATION(res->start, res->start, | 266 | MPC52xx_PCI_IWBTAR_TRANSLATION(res->start, res->start, |
267 | res->end - res->start + 1)); | 267 | resource_size(res))); |
268 | iwcr0 = MPC52xx_PCI_IWCR_ENABLE | MPC52xx_PCI_IWCR_MEM; | 268 | iwcr0 = MPC52xx_PCI_IWCR_ENABLE | MPC52xx_PCI_IWCR_MEM; |
269 | if (res->flags & IORESOURCE_PREFETCH) | 269 | if (res->flags & IORESOURCE_PREFETCH) |
270 | iwcr0 |= MPC52xx_PCI_IWCR_READ_MULTI; | 270 | iwcr0 |= MPC52xx_PCI_IWCR_READ_MULTI; |
@@ -278,7 +278,7 @@ mpc52xx_pci_setup(struct pci_controller *hose, | |||
278 | res->start, res->end, res->flags); | 278 | res->start, res->end, res->flags); |
279 | out_be32(&pci_regs->iw1btar, | 279 | out_be32(&pci_regs->iw1btar, |
280 | MPC52xx_PCI_IWBTAR_TRANSLATION(res->start, res->start, | 280 | MPC52xx_PCI_IWBTAR_TRANSLATION(res->start, res->start, |
281 | res->end - res->start + 1)); | 281 | resource_size(res))); |
282 | iwcr1 = MPC52xx_PCI_IWCR_ENABLE | MPC52xx_PCI_IWCR_MEM; | 282 | iwcr1 = MPC52xx_PCI_IWCR_ENABLE | MPC52xx_PCI_IWCR_MEM; |
283 | if (res->flags & IORESOURCE_PREFETCH) | 283 | if (res->flags & IORESOURCE_PREFETCH) |
284 | iwcr1 |= MPC52xx_PCI_IWCR_READ_MULTI; | 284 | iwcr1 |= MPC52xx_PCI_IWCR_READ_MULTI; |
@@ -300,7 +300,7 @@ mpc52xx_pci_setup(struct pci_controller *hose, | |||
300 | out_be32(&pci_regs->iw2btar, | 300 | out_be32(&pci_regs->iw2btar, |
301 | MPC52xx_PCI_IWBTAR_TRANSLATION(hose->io_base_phys, | 301 | MPC52xx_PCI_IWBTAR_TRANSLATION(hose->io_base_phys, |
302 | res->start, | 302 | res->start, |
303 | res->end - res->start + 1)); | 303 | resource_size(res))); |
304 | iwcr2 = MPC52xx_PCI_IWCR_ENABLE | MPC52xx_PCI_IWCR_IO; | 304 | iwcr2 = MPC52xx_PCI_IWCR_ENABLE | MPC52xx_PCI_IWCR_IO; |
305 | 305 | ||
306 | /* Set all the IWCR fields at once; they're in the same reg */ | 306 | /* Set all the IWCR fields at once; they're in the same reg */ |
@@ -402,7 +402,7 @@ mpc52xx_add_bridge(struct device_node *node) | |||
402 | 402 | ||
403 | hose->ops = &mpc52xx_pci_ops; | 403 | hose->ops = &mpc52xx_pci_ops; |
404 | 404 | ||
405 | pci_regs = ioremap(rsrc.start, rsrc.end - rsrc.start + 1); | 405 | pci_regs = ioremap(rsrc.start, resource_size(&rsrc)); |
406 | if (!pci_regs) | 406 | if (!pci_regs) |
407 | return -ENOMEM; | 407 | return -ENOMEM; |
408 | 408 | ||
diff --git a/arch/powerpc/platforms/83xx/km83xx.c b/arch/powerpc/platforms/83xx/km83xx.c index a2b9b9ef1240..f8fa2fc3129f 100644 --- a/arch/powerpc/platforms/83xx/km83xx.c +++ b/arch/powerpc/platforms/83xx/km83xx.c | |||
@@ -101,7 +101,7 @@ static void __init mpc83xx_km_setup_arch(void) | |||
101 | __func__); | 101 | __func__); |
102 | return; | 102 | return; |
103 | } | 103 | } |
104 | base = ioremap(res.start, res.end - res.start + 1); | 104 | base = ioremap(res.start, resource_size(&res)); |
105 | 105 | ||
106 | /* | 106 | /* |
107 | * IMMR + 0x14A8[4:5] = 11 (clk delay for UCC 2) | 107 | * IMMR + 0x14A8[4:5] = 11 (clk delay for UCC 2) |
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c index ec0b401bc9cf..93e60f1f21a9 100644 --- a/arch/powerpc/platforms/83xx/mpc832x_mds.c +++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c | |||
@@ -68,7 +68,7 @@ static void __init mpc832x_sys_setup_arch(void) | |||
68 | struct resource res; | 68 | struct resource res; |
69 | 69 | ||
70 | of_address_to_resource(np, 0, &res); | 70 | of_address_to_resource(np, 0, &res); |
71 | bcsr_regs = ioremap(res.start, res.end - res.start +1); | 71 | bcsr_regs = ioremap(res.start, resource_size(&res)); |
72 | of_node_put(np); | 72 | of_node_put(np); |
73 | } | 73 | } |
74 | 74 | ||
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c index d0a634b056ca..c1b1dc50b32a 100644 --- a/arch/powerpc/platforms/83xx/mpc834x_mds.c +++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c | |||
@@ -53,7 +53,7 @@ static int mpc834xemds_usb_cfg(void) | |||
53 | struct resource res; | 53 | struct resource res; |
54 | 54 | ||
55 | of_address_to_resource(np, 0, &res); | 55 | of_address_to_resource(np, 0, &res); |
56 | bcsr_regs = ioremap(res.start, res.end - res.start + 1); | 56 | bcsr_regs = ioremap(res.start, resource_size(&res)); |
57 | of_node_put(np); | 57 | of_node_put(np); |
58 | } | 58 | } |
59 | if (!bcsr_regs) | 59 | if (!bcsr_regs) |
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c index 09e9d6fb7411..81c052b1353e 100644 --- a/arch/powerpc/platforms/83xx/mpc836x_mds.c +++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c | |||
@@ -76,7 +76,7 @@ static void __init mpc836x_mds_setup_arch(void) | |||
76 | struct resource res; | 76 | struct resource res; |
77 | 77 | ||
78 | of_address_to_resource(np, 0, &res); | 78 | of_address_to_resource(np, 0, &res); |
79 | bcsr_regs = ioremap(res.start, res.end - res.start +1); | 79 | bcsr_regs = ioremap(res.start, resource_size(&res)); |
80 | of_node_put(np); | 80 | of_node_put(np); |
81 | } | 81 | } |
82 | 82 | ||
diff --git a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/platforms/83xx/usb.c index 2c64164722d0..1ad748bb39b4 100644 --- a/arch/powerpc/platforms/83xx/usb.c +++ b/arch/powerpc/platforms/83xx/usb.c | |||
@@ -171,7 +171,7 @@ int mpc831x_usb_cfg(void) | |||
171 | of_node_put(np); | 171 | of_node_put(np); |
172 | return ret; | 172 | return ret; |
173 | } | 173 | } |
174 | usb_regs = ioremap(res.start, res.end - res.start + 1); | 174 | usb_regs = ioremap(res.start, resource_size(&res)); |
175 | 175 | ||
176 | /* Using on-chip PHY */ | 176 | /* Using on-chip PHY */ |
177 | if (prop && (!strcmp(prop, "utmi_wide") || | 177 | if (prop && (!strcmp(prop, "utmi_wide") || |
diff --git a/arch/powerpc/platforms/85xx/sbc8560.c b/arch/powerpc/platforms/85xx/sbc8560.c index d2dfd465fbf6..09ced7221750 100644 --- a/arch/powerpc/platforms/85xx/sbc8560.c +++ b/arch/powerpc/platforms/85xx/sbc8560.c | |||
@@ -285,7 +285,7 @@ static int __init sbc8560_bdrstcr_init(void) | |||
285 | 285 | ||
286 | printk(KERN_INFO "sbc8560: Found BRSTCR at i/o 0x%x\n", res.start); | 286 | printk(KERN_INFO "sbc8560: Found BRSTCR at i/o 0x%x\n", res.start); |
287 | 287 | ||
288 | brstcr = ioremap(res.start, res.end - res.start); | 288 | brstcr = ioremap(res.start, resource_size(&res)); |
289 | if(!brstcr) | 289 | if(!brstcr) |
290 | printk(KERN_WARNING "sbc8560: ioremap of brstcr failed.\n"); | 290 | printk(KERN_WARNING "sbc8560: ioremap of brstcr failed.\n"); |
291 | 291 | ||
diff --git a/arch/powerpc/platforms/85xx/xes_mpc85xx.c b/arch/powerpc/platforms/85xx/xes_mpc85xx.c index 0125604d096e..a9dc5e795123 100644 --- a/arch/powerpc/platforms/85xx/xes_mpc85xx.c +++ b/arch/powerpc/platforms/85xx/xes_mpc85xx.c | |||
@@ -123,7 +123,7 @@ static void xes_mpc85xx_fixups(void) | |||
123 | continue; | 123 | continue; |
124 | } | 124 | } |
125 | 125 | ||
126 | l2_base = ioremap(r[0].start, r[0].end - r[0].start + 1); | 126 | l2_base = ioremap(r[0].start, resource_size(&r[0])); |
127 | 127 | ||
128 | xes_mpc85xx_configure_l2(l2_base); | 128 | xes_mpc85xx_configure_l2(l2_base); |
129 | } | 129 | } |
diff --git a/arch/powerpc/platforms/cell/celleb_scc_epci.c b/arch/powerpc/platforms/cell/celleb_scc_epci.c index 05b0db3ef638..844c0facb4f7 100644 --- a/arch/powerpc/platforms/cell/celleb_scc_epci.c +++ b/arch/powerpc/platforms/cell/celleb_scc_epci.c | |||
@@ -393,19 +393,19 @@ static int __init celleb_setup_epci(struct device_node *node, | |||
393 | 393 | ||
394 | if (of_address_to_resource(node, 0, &r)) | 394 | if (of_address_to_resource(node, 0, &r)) |
395 | goto error; | 395 | goto error; |
396 | hose->cfg_addr = ioremap(r.start, (r.end - r.start + 1)); | 396 | hose->cfg_addr = ioremap(r.start, resource_size(&r)); |
397 | if (!hose->cfg_addr) | 397 | if (!hose->cfg_addr) |
398 | goto error; | 398 | goto error; |
399 | pr_debug("EPCI: cfg_addr map 0x%016llx->0x%016lx + 0x%016llx\n", | 399 | pr_debug("EPCI: cfg_addr map 0x%016llx->0x%016lx + 0x%016llx\n", |
400 | r.start, (unsigned long)hose->cfg_addr, (r.end - r.start + 1)); | 400 | r.start, (unsigned long)hose->cfg_addr, resource_size(&r)); |
401 | 401 | ||
402 | if (of_address_to_resource(node, 2, &r)) | 402 | if (of_address_to_resource(node, 2, &r)) |
403 | goto error; | 403 | goto error; |
404 | hose->cfg_data = ioremap(r.start, (r.end - r.start + 1)); | 404 | hose->cfg_data = ioremap(r.start, resource_size(&r)); |
405 | if (!hose->cfg_data) | 405 | if (!hose->cfg_data) |
406 | goto error; | 406 | goto error; |
407 | pr_debug("EPCI: cfg_data map 0x%016llx->0x%016lx + 0x%016llx\n", | 407 | pr_debug("EPCI: cfg_data map 0x%016llx->0x%016lx + 0x%016llx\n", |
408 | r.start, (unsigned long)hose->cfg_data, (r.end - r.start + 1)); | 408 | r.start, (unsigned long)hose->cfg_data, resource_size(&r)); |
409 | 409 | ||
410 | hose->ops = &celleb_epci_ops; | 410 | hose->ops = &celleb_epci_ops; |
411 | celleb_epci_init(hose); | 411 | celleb_epci_init(hose); |
diff --git a/arch/powerpc/platforms/cell/celleb_scc_pciex.c b/arch/powerpc/platforms/cell/celleb_scc_pciex.c index a881bbee8de0..ae790ac4a589 100644 --- a/arch/powerpc/platforms/cell/celleb_scc_pciex.c +++ b/arch/powerpc/platforms/cell/celleb_scc_pciex.c | |||
@@ -494,7 +494,7 @@ static __init int celleb_setup_pciex(struct device_node *node, | |||
494 | pr_err("PCIEXC:Failed to get config resource.\n"); | 494 | pr_err("PCIEXC:Failed to get config resource.\n"); |
495 | return 1; | 495 | return 1; |
496 | } | 496 | } |
497 | phb->cfg_addr = ioremap(r.start, r.end - r.start + 1); | 497 | phb->cfg_addr = ioremap(r.start, resource_size(&r)); |
498 | if (!phb->cfg_addr) { | 498 | if (!phb->cfg_addr) { |
499 | pr_err("PCIEXC:Failed to remap SMMIO region.\n"); | 499 | pr_err("PCIEXC:Failed to remap SMMIO region.\n"); |
500 | return 1; | 500 | return 1; |
diff --git a/arch/powerpc/platforms/cell/spu_manage.c b/arch/powerpc/platforms/cell/spu_manage.c index f465d474ad9b..4e5c91489c02 100644 --- a/arch/powerpc/platforms/cell/spu_manage.c +++ b/arch/powerpc/platforms/cell/spu_manage.c | |||
@@ -222,7 +222,7 @@ static int spu_map_resource(struct spu *spu, int nr, | |||
222 | return ret; | 222 | return ret; |
223 | if (phys) | 223 | if (phys) |
224 | *phys = resource.start; | 224 | *phys = resource.start; |
225 | len = resource.end - resource.start + 1; | 225 | len = resource_size(&resource); |
226 | *virt = ioremap(resource.start, len); | 226 | *virt = ioremap(resource.start, len); |
227 | if (!*virt) | 227 | if (!*virt) |
228 | return -EINVAL; | 228 | return -EINVAL; |
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c index 8f67a394b2d0..3f65443f1714 100644 --- a/arch/powerpc/platforms/chrp/pci.c +++ b/arch/powerpc/platforms/chrp/pci.c | |||
@@ -142,7 +142,7 @@ hydra_init(void) | |||
142 | return 0; | 142 | return 0; |
143 | } | 143 | } |
144 | of_node_put(np); | 144 | of_node_put(np); |
145 | Hydra = ioremap(r.start, r.end-r.start); | 145 | Hydra = ioremap(r.start, resource_size(&r)); |
146 | printk("Hydra Mac I/O at %llx\n", (unsigned long long)r.start); | 146 | printk("Hydra Mac I/O at %llx\n", (unsigned long long)r.start); |
147 | printk("Hydra Feature_Control was %x", | 147 | printk("Hydra Feature_Control was %x", |
148 | in_le32(&Hydra->Feature_Control)); | 148 | in_le32(&Hydra->Feature_Control)); |
diff --git a/arch/powerpc/platforms/pasemi/dma_lib.c b/arch/powerpc/platforms/pasemi/dma_lib.c index 321a9b3a2d00..756123bf06ac 100644 --- a/arch/powerpc/platforms/pasemi/dma_lib.c +++ b/arch/powerpc/platforms/pasemi/dma_lib.c | |||
@@ -576,7 +576,7 @@ int pasemi_dma_init(void) | |||
576 | res.start = 0xfd800000; | 576 | res.start = 0xfd800000; |
577 | res.end = res.start + 0x1000; | 577 | res.end = res.start + 0x1000; |
578 | } | 578 | } |
579 | dma_status = __ioremap(res.start, res.end-res.start, 0); | 579 | dma_status = __ioremap(res.start, resource_size(&res), 0); |
580 | pci_dev_put(iob_pdev); | 580 | pci_dev_put(iob_pdev); |
581 | 581 | ||
582 | for (i = 0; i < MAX_TXCH; i++) | 582 | for (i = 0; i < MAX_TXCH; i++) |
diff --git a/arch/powerpc/platforms/powermac/nvram.c b/arch/powerpc/platforms/powermac/nvram.c index b1cdcf94aa8e..695443bfdb08 100644 --- a/arch/powerpc/platforms/powermac/nvram.c +++ b/arch/powerpc/platforms/powermac/nvram.c | |||
@@ -580,10 +580,10 @@ int __init pmac_nvram_init(void) | |||
580 | /* Try to obtain an address */ | 580 | /* Try to obtain an address */ |
581 | if (of_address_to_resource(dp, 0, &r1) == 0) { | 581 | if (of_address_to_resource(dp, 0, &r1) == 0) { |
582 | nvram_naddrs = 1; | 582 | nvram_naddrs = 1; |
583 | s1 = (r1.end - r1.start) + 1; | 583 | s1 = resource_size(&r1); |
584 | if (of_address_to_resource(dp, 1, &r2) == 0) { | 584 | if (of_address_to_resource(dp, 1, &r2) == 0) { |
585 | nvram_naddrs = 2; | 585 | nvram_naddrs = 2; |
586 | s2 = (r2.end - r2.start) + 1; | 586 | s2 = resource_size(&r2); |
587 | } | 587 | } |
588 | } | 588 | } |
589 | 589 | ||
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c index abe8d7e2ebeb..41a80a4fb97e 100644 --- a/arch/powerpc/platforms/powermac/pci.c +++ b/arch/powerpc/platforms/powermac/pci.c | |||
@@ -839,8 +839,7 @@ static void __init setup_u3_ht(struct pci_controller* hose) | |||
839 | * into cfg_addr | 839 | * into cfg_addr |
840 | */ | 840 | */ |
841 | hose->cfg_data = ioremap(cfg_res.start, 0x02000000); | 841 | hose->cfg_data = ioremap(cfg_res.start, 0x02000000); |
842 | hose->cfg_addr = ioremap(self_res.start, | 842 | hose->cfg_addr = ioremap(self_res.start, resource_size(&self_res)); |
843 | self_res.end - self_res.start + 1); | ||
844 | 843 | ||
845 | /* | 844 | /* |
846 | * /ht node doesn't expose a "ranges" property, we read the register | 845 | * /ht node doesn't expose a "ranges" property, we read the register |
@@ -1324,8 +1323,7 @@ static void fixup_u4_pcie(struct pci_dev* dev) | |||
1324 | */ | 1323 | */ |
1325 | if (r->start >= 0xf0000000 && r->start < 0xf3000000) | 1324 | if (r->start >= 0xf0000000 && r->start < 0xf3000000) |
1326 | continue; | 1325 | continue; |
1327 | if (!region || (r->end - r->start) > | 1326 | if (!region || resource_size(r) > resource_size(region)) |
1328 | (region->end - region->start)) | ||
1329 | region = r; | 1327 | region = r; |
1330 | } | 1328 | } |
1331 | /* Nothing found, bail */ | 1329 | /* Nothing found, bail */ |
diff --git a/arch/powerpc/platforms/powermac/time.c b/arch/powerpc/platforms/powermac/time.c index 48211ca134c3..11c9fce43b5b 100644 --- a/arch/powerpc/platforms/powermac/time.c +++ b/arch/powerpc/platforms/powermac/time.c | |||
@@ -274,7 +274,7 @@ int __init via_calibrate_decr(void) | |||
274 | return 0; | 274 | return 0; |
275 | } | 275 | } |
276 | of_node_put(vias); | 276 | of_node_put(vias); |
277 | via = ioremap(rsrc.start, rsrc.end - rsrc.start + 1); | 277 | via = ioremap(rsrc.start, resource_size(&rsrc)); |
278 | if (via == NULL) { | 278 | if (via == NULL) { |
279 | printk(KERN_ERR "Failed to map VIA for timer calibration !\n"); | 279 | printk(KERN_ERR "Failed to map VIA for timer calibration !\n"); |
280 | return 0; | 280 | return 0; |
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c index fbffd7e47ab8..cd70be5ff27e 100644 --- a/arch/powerpc/platforms/pseries/smp.c +++ b/arch/powerpc/platforms/pseries/smp.c | |||
@@ -44,7 +44,6 @@ | |||
44 | #include <asm/mpic.h> | 44 | #include <asm/mpic.h> |
45 | #include <asm/vdso_datapage.h> | 45 | #include <asm/vdso_datapage.h> |
46 | #include <asm/cputhreads.h> | 46 | #include <asm/cputhreads.h> |
47 | #include <asm/mpic.h> | ||
48 | #include <asm/xics.h> | 47 | #include <asm/xics.h> |
49 | 48 | ||
50 | #include "plpar_wrappers.h" | 49 | #include "plpar_wrappers.h" |
diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c index bd0d54060b94..265f0f09395a 100644 --- a/arch/powerpc/sysdev/axonram.c +++ b/arch/powerpc/sysdev/axonram.c | |||
@@ -203,7 +203,7 @@ static int axon_ram_probe(struct platform_device *device) | |||
203 | goto failed; | 203 | goto failed; |
204 | } | 204 | } |
205 | 205 | ||
206 | bank->size = resource.end - resource.start + 1; | 206 | bank->size = resource_size(&resource); |
207 | 207 | ||
208 | if (bank->size == 0) { | 208 | if (bank->size == 0) { |
209 | dev_err(&device->dev, "No DDR2 memory found for %s%d\n", | 209 | dev_err(&device->dev, "No DDR2 memory found for %s%d\n", |
diff --git a/arch/powerpc/sysdev/cpm1.c b/arch/powerpc/sysdev/cpm1.c index 350787c83e22..5d7d59a43c4c 100644 --- a/arch/powerpc/sysdev/cpm1.c +++ b/arch/powerpc/sysdev/cpm1.c | |||
@@ -148,7 +148,7 @@ unsigned int cpm_pic_init(void) | |||
148 | if (ret) | 148 | if (ret) |
149 | goto end; | 149 | goto end; |
150 | 150 | ||
151 | cpic_reg = ioremap(res.start, res.end - res.start + 1); | 151 | cpic_reg = ioremap(res.start, resource_size(&res)); |
152 | if (cpic_reg == NULL) | 152 | if (cpic_reg == NULL) |
153 | goto end; | 153 | goto end; |
154 | 154 | ||
diff --git a/arch/powerpc/sysdev/cpm_common.c b/arch/powerpc/sysdev/cpm_common.c index 2b69aa0315b3..d55d0ad0deab 100644 --- a/arch/powerpc/sysdev/cpm_common.c +++ b/arch/powerpc/sysdev/cpm_common.c | |||
@@ -115,7 +115,7 @@ int cpm_muram_init(void) | |||
115 | max = r.end; | 115 | max = r.end; |
116 | 116 | ||
117 | rh_attach_region(&cpm_muram_info, r.start - muram_pbase, | 117 | rh_attach_region(&cpm_muram_info, r.start - muram_pbase, |
118 | r.end - r.start + 1); | 118 | resource_size(&r)); |
119 | } | 119 | } |
120 | 120 | ||
121 | muram_vbase = ioremap(muram_pbase, max - muram_pbase + 1); | 121 | muram_vbase = ioremap(muram_pbase, max - muram_pbase + 1); |
diff --git a/arch/powerpc/sysdev/dart_iommu.c b/arch/powerpc/sysdev/dart_iommu.c index 8e9e06a7ca59..4f2680f431b5 100644 --- a/arch/powerpc/sysdev/dart_iommu.c +++ b/arch/powerpc/sysdev/dart_iommu.c | |||
@@ -239,7 +239,7 @@ static int __init dart_init(struct device_node *dart_node) | |||
239 | DARTMAP_RPNMASK); | 239 | DARTMAP_RPNMASK); |
240 | 240 | ||
241 | /* Map in DART registers */ | 241 | /* Map in DART registers */ |
242 | dart = ioremap(r.start, r.end - r.start + 1); | 242 | dart = ioremap(r.start, resource_size(&r)); |
243 | if (dart == NULL) | 243 | if (dart == NULL) |
244 | panic("DART: Cannot map registers!"); | 244 | panic("DART: Cannot map registers!"); |
245 | 245 | ||
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c index 92e78333c47c..419a77239bd7 100644 --- a/arch/powerpc/sysdev/fsl_msi.c +++ b/arch/powerpc/sysdev/fsl_msi.c | |||
@@ -349,7 +349,7 @@ static int __devinit fsl_of_msi_probe(struct platform_device *dev) | |||
349 | goto error_out; | 349 | goto error_out; |
350 | } | 350 | } |
351 | 351 | ||
352 | msi->msi_regs = ioremap(res.start, res.end - res.start + 1); | 352 | msi->msi_regs = ioremap(res.start, resource_size(&res)); |
353 | if (!msi->msi_regs) { | 353 | if (!msi->msi_regs) { |
354 | dev_err(&dev->dev, "ioremap problem failed\n"); | 354 | dev_err(&dev->dev, "ioremap problem failed\n"); |
355 | goto error_out; | 355 | goto error_out; |
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 68ca9290df94..ba5cb3fa7074 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c | |||
@@ -64,7 +64,7 @@ static int __init setup_one_atmu(struct ccsr_pci __iomem *pci, | |||
64 | { | 64 | { |
65 | resource_size_t pci_addr = res->start - offset; | 65 | resource_size_t pci_addr = res->start - offset; |
66 | resource_size_t phys_addr = res->start; | 66 | resource_size_t phys_addr = res->start; |
67 | resource_size_t size = res->end - res->start + 1; | 67 | resource_size_t size = resource_size(res); |
68 | u32 flags = 0x80044000; /* enable & mem R/W */ | 68 | u32 flags = 0x80044000; /* enable & mem R/W */ |
69 | unsigned int i; | 69 | unsigned int i; |
70 | 70 | ||
@@ -108,7 +108,7 @@ static void __init setup_pci_atmu(struct pci_controller *hose, | |||
108 | char *name = hose->dn->full_name; | 108 | char *name = hose->dn->full_name; |
109 | 109 | ||
110 | pr_debug("PCI memory map start 0x%016llx, size 0x%016llx\n", | 110 | pr_debug("PCI memory map start 0x%016llx, size 0x%016llx\n", |
111 | (u64)rsrc->start, (u64)rsrc->end - (u64)rsrc->start + 1); | 111 | (u64)rsrc->start, (u64)resource_size(rsrc)); |
112 | 112 | ||
113 | if (of_device_is_compatible(hose->dn, "fsl,qoriq-pcie-v2.2")) { | 113 | if (of_device_is_compatible(hose->dn, "fsl,qoriq-pcie-v2.2")) { |
114 | win_idx = 2; | 114 | win_idx = 2; |
@@ -116,7 +116,7 @@ static void __init setup_pci_atmu(struct pci_controller *hose, | |||
116 | end_idx = 3; | 116 | end_idx = 3; |
117 | } | 117 | } |
118 | 118 | ||
119 | pci = ioremap(rsrc->start, rsrc->end - rsrc->start + 1); | 119 | pci = ioremap(rsrc->start, resource_size(rsrc)); |
120 | if (!pci) { | 120 | if (!pci) { |
121 | dev_err(hose->parent, "Unable to map ATMU registers\n"); | 121 | dev_err(hose->parent, "Unable to map ATMU registers\n"); |
122 | return; | 122 | return; |
@@ -153,9 +153,9 @@ static void __init setup_pci_atmu(struct pci_controller *hose, | |||
153 | } else { | 153 | } else { |
154 | pr_debug("PCI IO resource start 0x%016llx, size 0x%016llx, " | 154 | pr_debug("PCI IO resource start 0x%016llx, size 0x%016llx, " |
155 | "phy base 0x%016llx.\n", | 155 | "phy base 0x%016llx.\n", |
156 | (u64)hose->io_resource.start, | 156 | (u64)hose->io_resource.start, |
157 | (u64)hose->io_resource.end - (u64)hose->io_resource.start + 1, | 157 | (u64)resource_size(&hose->io_resource), |
158 | (u64)hose->io_base_phys); | 158 | (u64)hose->io_base_phys); |
159 | out_be32(&pci->pow[j].potar, (hose->io_resource.start >> 12)); | 159 | out_be32(&pci->pow[j].potar, (hose->io_resource.start >> 12)); |
160 | out_be32(&pci->pow[j].potear, 0); | 160 | out_be32(&pci->pow[j].potear, 0); |
161 | out_be32(&pci->pow[j].powbar, (hose->io_base_phys >> 12)); | 161 | out_be32(&pci->pow[j].powbar, (hose->io_base_phys >> 12)); |
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c index b3fd081d56f5..2de8551df40f 100644 --- a/arch/powerpc/sysdev/fsl_rio.c +++ b/arch/powerpc/sysdev/fsl_rio.c | |||
@@ -1524,7 +1524,7 @@ int fsl_rio_setup(struct platform_device *dev) | |||
1524 | port->priv = priv; | 1524 | port->priv = priv; |
1525 | port->phys_efptr = 0x100; | 1525 | port->phys_efptr = 0x100; |
1526 | 1526 | ||
1527 | priv->regs_win = ioremap(regs.start, regs.end - regs.start + 1); | 1527 | priv->regs_win = ioremap(regs.start, resource_size(®s)); |
1528 | rio_regs_win = priv->regs_win; | 1528 | rio_regs_win = priv->regs_win; |
1529 | 1529 | ||
1530 | /* Probe the master port phy type */ | 1530 | /* Probe the master port phy type */ |
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c index 7367d17364cb..95da897f05a7 100644 --- a/arch/powerpc/sysdev/ipic.c +++ b/arch/powerpc/sysdev/ipic.c | |||
@@ -736,7 +736,7 @@ struct ipic * __init ipic_init(struct device_node *node, unsigned int flags) | |||
736 | return NULL; | 736 | return NULL; |
737 | } | 737 | } |
738 | 738 | ||
739 | ipic->regs = ioremap(res.start, res.end - res.start + 1); | 739 | ipic->regs = ioremap(res.start, resource_size(&res)); |
740 | 740 | ||
741 | ipic->irqhost->host_data = ipic; | 741 | ipic->irqhost->host_data = ipic; |
742 | 742 | ||
diff --git a/arch/powerpc/sysdev/mmio_nvram.c b/arch/powerpc/sysdev/mmio_nvram.c index ddc877a3a23a..69f5814ae6d4 100644 --- a/arch/powerpc/sysdev/mmio_nvram.c +++ b/arch/powerpc/sysdev/mmio_nvram.c | |||
@@ -129,7 +129,7 @@ int __init mmio_nvram_init(void) | |||
129 | goto out; | 129 | goto out; |
130 | } | 130 | } |
131 | nvram_addr = r.start; | 131 | nvram_addr = r.start; |
132 | mmio_nvram_len = r.end - r.start + 1; | 132 | mmio_nvram_len = resource_size(&r); |
133 | if ( (!mmio_nvram_len) || (!nvram_addr) ) { | 133 | if ( (!mmio_nvram_len) || (!nvram_addr) ) { |
134 | printk(KERN_WARNING "nvram: address or length is 0\n"); | 134 | printk(KERN_WARNING "nvram: address or length is 0\n"); |
135 | ret = -EIO; | 135 | ret = -EIO; |
diff --git a/arch/powerpc/sysdev/mpc8xx_pic.c b/arch/powerpc/sysdev/mpc8xx_pic.c index 20924f2246f0..22e48e2d71f1 100644 --- a/arch/powerpc/sysdev/mpc8xx_pic.c +++ b/arch/powerpc/sysdev/mpc8xx_pic.c | |||
@@ -166,7 +166,7 @@ int mpc8xx_pic_init(void) | |||
166 | if (ret) | 166 | if (ret) |
167 | goto out; | 167 | goto out; |
168 | 168 | ||
169 | siu_reg = ioremap(res.start, res.end - res.start + 1); | 169 | siu_reg = ioremap(res.start, resource_size(&res)); |
170 | if (siu_reg == NULL) { | 170 | if (siu_reg == NULL) { |
171 | ret = -EINVAL; | 171 | ret = -EINVAL; |
172 | goto out; | 172 | goto out; |
diff --git a/arch/powerpc/sysdev/mv64x60_udbg.c b/arch/powerpc/sysdev/mv64x60_udbg.c index 2792dc8b038c..50a81387e9b1 100644 --- a/arch/powerpc/sysdev/mv64x60_udbg.c +++ b/arch/powerpc/sysdev/mv64x60_udbg.c | |||
@@ -125,11 +125,11 @@ static void mv64x60_udbg_init(void) | |||
125 | 125 | ||
126 | of_node_put(np); | 126 | of_node_put(np); |
127 | 127 | ||
128 | mpsc_base = ioremap(r[0].start, r[0].end - r[0].start + 1); | 128 | mpsc_base = ioremap(r[0].start, resource_size(&r[0])); |
129 | if (!mpsc_base) | 129 | if (!mpsc_base) |
130 | return; | 130 | return; |
131 | 131 | ||
132 | mpsc_intr_cause = ioremap(r[1].start, r[1].end - r[1].start + 1); | 132 | mpsc_intr_cause = ioremap(r[1].start, resource_size(&r[1])); |
133 | if (!mpsc_intr_cause) { | 133 | if (!mpsc_intr_cause) { |
134 | iounmap(mpsc_base); | 134 | iounmap(mpsc_base); |
135 | return; | 135 | return; |
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c index 156aa7d36258..deda60a7f996 100644 --- a/arch/powerpc/sysdev/ppc4xx_pci.c +++ b/arch/powerpc/sysdev/ppc4xx_pci.c | |||
@@ -265,7 +265,7 @@ static void __init ppc4xx_configure_pci_PMMs(struct pci_controller *hose, | |||
265 | if (ppc4xx_setup_one_pci_PMM(hose, reg, | 265 | if (ppc4xx_setup_one_pci_PMM(hose, reg, |
266 | res->start, | 266 | res->start, |
267 | res->start - hose->pci_mem_offset, | 267 | res->start - hose->pci_mem_offset, |
268 | res->end + 1 - res->start, | 268 | resource_size(res), |
269 | res->flags, | 269 | res->flags, |
270 | j) == 0) { | 270 | j) == 0) { |
271 | j++; | 271 | j++; |
@@ -290,7 +290,7 @@ static void __init ppc4xx_configure_pci_PTMs(struct pci_controller *hose, | |||
290 | void __iomem *reg, | 290 | void __iomem *reg, |
291 | const struct resource *res) | 291 | const struct resource *res) |
292 | { | 292 | { |
293 | resource_size_t size = res->end - res->start + 1; | 293 | resource_size_t size = resource_size(res); |
294 | u32 sa; | 294 | u32 sa; |
295 | 295 | ||
296 | /* Calculate window size */ | 296 | /* Calculate window size */ |
@@ -349,7 +349,7 @@ static void __init ppc4xx_probe_pci_bridge(struct device_node *np) | |||
349 | bus_range = of_get_property(np, "bus-range", NULL); | 349 | bus_range = of_get_property(np, "bus-range", NULL); |
350 | 350 | ||
351 | /* Map registers */ | 351 | /* Map registers */ |
352 | reg = ioremap(rsrc_reg.start, rsrc_reg.end + 1 - rsrc_reg.start); | 352 | reg = ioremap(rsrc_reg.start, resource_size(&rsrc_reg)); |
353 | if (reg == NULL) { | 353 | if (reg == NULL) { |
354 | printk(KERN_ERR "%s: Can't map registers !", np->full_name); | 354 | printk(KERN_ERR "%s: Can't map registers !", np->full_name); |
355 | goto fail; | 355 | goto fail; |
@@ -465,7 +465,7 @@ static void __init ppc4xx_configure_pcix_POMs(struct pci_controller *hose, | |||
465 | if (ppc4xx_setup_one_pcix_POM(hose, reg, | 465 | if (ppc4xx_setup_one_pcix_POM(hose, reg, |
466 | res->start, | 466 | res->start, |
467 | res->start - hose->pci_mem_offset, | 467 | res->start - hose->pci_mem_offset, |
468 | res->end + 1 - res->start, | 468 | resource_size(res), |
469 | res->flags, | 469 | res->flags, |
470 | j) == 0) { | 470 | j) == 0) { |
471 | j++; | 471 | j++; |
@@ -492,7 +492,7 @@ static void __init ppc4xx_configure_pcix_PIMs(struct pci_controller *hose, | |||
492 | int big_pim, | 492 | int big_pim, |
493 | int enable_msi_hole) | 493 | int enable_msi_hole) |
494 | { | 494 | { |
495 | resource_size_t size = res->end - res->start + 1; | 495 | resource_size_t size = resource_size(res); |
496 | u32 sa; | 496 | u32 sa; |
497 | 497 | ||
498 | /* RAM is always at 0 */ | 498 | /* RAM is always at 0 */ |
@@ -555,7 +555,7 @@ static void __init ppc4xx_probe_pcix_bridge(struct device_node *np) | |||
555 | bus_range = of_get_property(np, "bus-range", NULL); | 555 | bus_range = of_get_property(np, "bus-range", NULL); |
556 | 556 | ||
557 | /* Map registers */ | 557 | /* Map registers */ |
558 | reg = ioremap(rsrc_reg.start, rsrc_reg.end + 1 - rsrc_reg.start); | 558 | reg = ioremap(rsrc_reg.start, resource_size(&rsrc_reg)); |
559 | if (reg == NULL) { | 559 | if (reg == NULL) { |
560 | printk(KERN_ERR "%s: Can't map registers !", np->full_name); | 560 | printk(KERN_ERR "%s: Can't map registers !", np->full_name); |
561 | goto fail; | 561 | goto fail; |
@@ -1604,7 +1604,7 @@ static void __init ppc4xx_configure_pciex_POMs(struct ppc4xx_pciex_port *port, | |||
1604 | if (ppc4xx_setup_one_pciex_POM(port, hose, mbase, | 1604 | if (ppc4xx_setup_one_pciex_POM(port, hose, mbase, |
1605 | res->start, | 1605 | res->start, |
1606 | res->start - hose->pci_mem_offset, | 1606 | res->start - hose->pci_mem_offset, |
1607 | res->end + 1 - res->start, | 1607 | resource_size(res), |
1608 | res->flags, | 1608 | res->flags, |
1609 | j) == 0) { | 1609 | j) == 0) { |
1610 | j++; | 1610 | j++; |
@@ -1639,7 +1639,7 @@ static void __init ppc4xx_configure_pciex_PIMs(struct ppc4xx_pciex_port *port, | |||
1639 | void __iomem *mbase, | 1639 | void __iomem *mbase, |
1640 | struct resource *res) | 1640 | struct resource *res) |
1641 | { | 1641 | { |
1642 | resource_size_t size = res->end - res->start + 1; | 1642 | resource_size_t size = resource_size(res); |
1643 | u64 sa; | 1643 | u64 sa; |
1644 | 1644 | ||
1645 | if (port->endpoint) { | 1645 | if (port->endpoint) { |
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c index b2acda07220d..18e75ca19fe6 100644 --- a/arch/powerpc/sysdev/qe_lib/qe_ic.c +++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c | |||
@@ -347,7 +347,7 @@ void __init qe_ic_init(struct device_node *node, unsigned int flags, | |||
347 | return; | 347 | return; |
348 | } | 348 | } |
349 | 349 | ||
350 | qe_ic->regs = ioremap(res.start, res.end - res.start + 1); | 350 | qe_ic->regs = ioremap(res.start, resource_size(&res)); |
351 | 351 | ||
352 | qe_ic->irqhost->host_data = qe_ic; | 352 | qe_ic->irqhost->host_data = qe_ic; |
353 | qe_ic->hc_irq = qe_ic_irq_chip; | 353 | qe_ic->hc_irq = qe_ic_irq_chip; |
diff --git a/arch/powerpc/sysdev/qe_lib/qe_io.c b/arch/powerpc/sysdev/qe_lib/qe_io.c index 77e4934b88c5..fd1a6c3b1721 100644 --- a/arch/powerpc/sysdev/qe_lib/qe_io.c +++ b/arch/powerpc/sysdev/qe_lib/qe_io.c | |||
@@ -41,7 +41,7 @@ int par_io_init(struct device_node *np) | |||
41 | ret = of_address_to_resource(np, 0, &res); | 41 | ret = of_address_to_resource(np, 0, &res); |
42 | if (ret) | 42 | if (ret) |
43 | return ret; | 43 | return ret; |
44 | par_io = ioremap(res.start, res.end - res.start + 1); | 44 | par_io = ioremap(res.start, resource_size(&res)); |
45 | 45 | ||
46 | num_ports = of_get_property(np, "num-ports", NULL); | 46 | num_ports = of_get_property(np, "num-ports", NULL); |
47 | if (num_ports) | 47 | if (num_ports) |
diff --git a/arch/powerpc/sysdev/xics/icp-native.c b/arch/powerpc/sysdev/xics/icp-native.c index ba382b59b926..50e32afe392e 100644 --- a/arch/powerpc/sysdev/xics/icp-native.c +++ b/arch/powerpc/sysdev/xics/icp-native.c | |||
@@ -256,7 +256,7 @@ static int __init icp_native_init_one_node(struct device_node *np, | |||
256 | return -1; | 256 | return -1; |
257 | } | 257 | } |
258 | 258 | ||
259 | if (icp_native_map_one_cpu(*indx, r.start, r.end - r.start)) | 259 | if (icp_native_map_one_cpu(*indx, r.start, resource_size(&r))) |
260 | return -1; | 260 | return -1; |
261 | 261 | ||
262 | (*indx)++; | 262 | (*indx)++; |
diff --git a/arch/s390/oprofile/init.c b/arch/s390/oprofile/init.c index 0e358c2cffeb..6efc18b5e60a 100644 --- a/arch/s390/oprofile/init.c +++ b/arch/s390/oprofile/init.c | |||
@@ -13,8 +13,6 @@ | |||
13 | #include <linux/oprofile.h> | 13 | #include <linux/oprofile.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/errno.h> | 15 | #include <linux/errno.h> |
16 | #include <linux/oprofile.h> | ||
17 | #include <linux/errno.h> | ||
18 | #include <linux/fs.h> | 16 | #include <linux/fs.h> |
19 | 17 | ||
20 | #include "../../../drivers/oprofile/oprof.h" | 18 | #include "../../../drivers/oprofile/oprof.h" |
diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c index 969421f64a15..1dc924b2f508 100644 --- a/arch/sh/boards/mach-ap325rxa/setup.c +++ b/arch/sh/boards/mach-ap325rxa/setup.c | |||
@@ -188,7 +188,7 @@ static void ap320_wvga_power_off(void *board_data) | |||
188 | __raw_writew(0, FPGA_LCDREG); | 188 | __raw_writew(0, FPGA_LCDREG); |
189 | } | 189 | } |
190 | 190 | ||
191 | const static struct fb_videomode ap325rxa_lcdc_modes[] = { | 191 | static const struct fb_videomode ap325rxa_lcdc_modes[] = { |
192 | { | 192 | { |
193 | .name = "LB070WV1", | 193 | .name = "LB070WV1", |
194 | .xres = 800, | 194 | .xres = 800, |
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index 513cb1a2e6c8..b24d69d509e7 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c | |||
@@ -280,7 +280,7 @@ static struct platform_device usbhs_device = { | |||
280 | }; | 280 | }; |
281 | 281 | ||
282 | /* LCDC */ | 282 | /* LCDC */ |
283 | const static struct fb_videomode ecovec_lcd_modes[] = { | 283 | static const struct fb_videomode ecovec_lcd_modes[] = { |
284 | { | 284 | { |
285 | .name = "Panel", | 285 | .name = "Panel", |
286 | .xres = 800, | 286 | .xres = 800, |
@@ -295,7 +295,7 @@ const static struct fb_videomode ecovec_lcd_modes[] = { | |||
295 | }, | 295 | }, |
296 | }; | 296 | }; |
297 | 297 | ||
298 | const static struct fb_videomode ecovec_dvi_modes[] = { | 298 | static const struct fb_videomode ecovec_dvi_modes[] = { |
299 | { | 299 | { |
300 | .name = "DVI", | 300 | .name = "DVI", |
301 | .xres = 1280, | 301 | .xres = 1280, |
diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c index 8b4abbbd1477..f65271a8d075 100644 --- a/arch/sh/boards/mach-kfr2r09/setup.c +++ b/arch/sh/boards/mach-kfr2r09/setup.c | |||
@@ -127,7 +127,7 @@ static struct platform_device kfr2r09_sh_keysc_device = { | |||
127 | }, | 127 | }, |
128 | }; | 128 | }; |
129 | 129 | ||
130 | const static struct fb_videomode kfr2r09_lcdc_modes[] = { | 130 | static const struct fb_videomode kfr2r09_lcdc_modes[] = { |
131 | { | 131 | { |
132 | .name = "TX07D34VM0AAA", | 132 | .name = "TX07D34VM0AAA", |
133 | .xres = 240, | 133 | .xres = 240, |
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c index 184fde169132..2d4c9c8c6664 100644 --- a/arch/sh/boards/mach-migor/setup.c +++ b/arch/sh/boards/mach-migor/setup.c | |||
@@ -214,7 +214,7 @@ static struct platform_device migor_nand_flash_device = { | |||
214 | } | 214 | } |
215 | }; | 215 | }; |
216 | 216 | ||
217 | const static struct fb_videomode migor_lcd_modes[] = { | 217 | static const struct fb_videomode migor_lcd_modes[] = { |
218 | { | 218 | { |
219 | #if defined(CONFIG_SH_MIGOR_RTA_WVGA) | 219 | #if defined(CONFIG_SH_MIGOR_RTA_WVGA) |
220 | .name = "LB070WV1", | 220 | .name = "LB070WV1", |
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c index 12357671023e..d00756728bd2 100644 --- a/arch/sh/boards/mach-se/7724/setup.c +++ b/arch/sh/boards/mach-se/7724/setup.c | |||
@@ -145,7 +145,7 @@ static struct platform_device nor_flash_device = { | |||
145 | }; | 145 | }; |
146 | 146 | ||
147 | /* LCDC */ | 147 | /* LCDC */ |
148 | const static struct fb_videomode lcdc_720p_modes[] = { | 148 | static const struct fb_videomode lcdc_720p_modes[] = { |
149 | { | 149 | { |
150 | .name = "LB070WV1", | 150 | .name = "LB070WV1", |
151 | .sync = 0, /* hsync and vsync are active low */ | 151 | .sync = 0, /* hsync and vsync are active low */ |
@@ -160,7 +160,7 @@ const static struct fb_videomode lcdc_720p_modes[] = { | |||
160 | }, | 160 | }, |
161 | }; | 161 | }; |
162 | 162 | ||
163 | const static struct fb_videomode lcdc_vga_modes[] = { | 163 | static const struct fb_videomode lcdc_vga_modes[] = { |
164 | { | 164 | { |
165 | .name = "LB070WV1", | 165 | .name = "LB070WV1", |
166 | .sync = 0, /* hsync and vsync are active low */ | 166 | .sync = 0, /* hsync and vsync are active low */ |
diff --git a/arch/sh/kernel/io_trapped.c b/arch/sh/kernel/io_trapped.c index 32c385ef1011..0f62f4672754 100644 --- a/arch/sh/kernel/io_trapped.c +++ b/arch/sh/kernel/io_trapped.c | |||
@@ -58,7 +58,7 @@ int register_trapped_io(struct trapped_io *tiop) | |||
58 | 58 | ||
59 | for (k = 0; k < tiop->num_resources; k++) { | 59 | for (k = 0; k < tiop->num_resources; k++) { |
60 | res = tiop->resource + k; | 60 | res = tiop->resource + k; |
61 | len += roundup((res->end - res->start) + 1, PAGE_SIZE); | 61 | len += roundup(resource_size(res), PAGE_SIZE); |
62 | flags |= res->flags; | 62 | flags |= res->flags; |
63 | } | 63 | } |
64 | 64 | ||
@@ -85,7 +85,7 @@ int register_trapped_io(struct trapped_io *tiop) | |||
85 | (unsigned long)(tiop->virt_base + len), | 85 | (unsigned long)(tiop->virt_base + len), |
86 | res->flags & IORESOURCE_IO ? "io" : "mmio", | 86 | res->flags & IORESOURCE_IO ? "io" : "mmio", |
87 | (unsigned long)res->start); | 87 | (unsigned long)res->start); |
88 | len += roundup((res->end - res->start) + 1, PAGE_SIZE); | 88 | len += roundup(resource_size(res), PAGE_SIZE); |
89 | } | 89 | } |
90 | 90 | ||
91 | tiop->magic = IO_TRAPPED_MAGIC; | 91 | tiop->magic = IO_TRAPPED_MAGIC; |
@@ -128,7 +128,7 @@ void __iomem *match_trapped_io_handler(struct list_head *list, | |||
128 | return tiop->virt_base + voffs; | 128 | return tiop->virt_base + voffs; |
129 | } | 129 | } |
130 | 130 | ||
131 | len = (res->end - res->start) + 1; | 131 | len = resource_size(res); |
132 | voffs += roundup(len, PAGE_SIZE); | 132 | voffs += roundup(len, PAGE_SIZE); |
133 | } | 133 | } |
134 | } | 134 | } |
@@ -173,7 +173,7 @@ static unsigned long lookup_address(struct trapped_io *tiop, | |||
173 | 173 | ||
174 | for (k = 0; k < tiop->num_resources; k++) { | 174 | for (k = 0; k < tiop->num_resources; k++) { |
175 | res = tiop->resource + k; | 175 | res = tiop->resource + k; |
176 | len = roundup((res->end - res->start) + 1, PAGE_SIZE); | 176 | len = roundup(resource_size(res), PAGE_SIZE); |
177 | if (address < (vaddr + len)) | 177 | if (address < (vaddr + len)) |
178 | return res->start + (address - vaddr); | 178 | return res->start + (address - vaddr); |
179 | vaddr += len; | 179 | vaddr += len; |
diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c index e2a3af31ff99..c5a33f007f88 100644 --- a/arch/sh/kernel/machine_kexec.c +++ b/arch/sh/kernel/machine_kexec.c | |||
@@ -170,7 +170,7 @@ void __init reserve_crashkernel(void) | |||
170 | if (crashk_res.end == crashk_res.start) | 170 | if (crashk_res.end == crashk_res.start) |
171 | goto disable; | 171 | goto disable; |
172 | 172 | ||
173 | crash_size = PAGE_ALIGN(crashk_res.end - crashk_res.start + 1); | 173 | crash_size = PAGE_ALIGN(resource_size(&crashk_res)); |
174 | if (!crashk_res.start) { | 174 | if (!crashk_res.start) { |
175 | unsigned long max = memblock_end_of_DRAM() - memory_limit; | 175 | unsigned long max = memblock_end_of_DRAM() - memory_limit; |
176 | crashk_res.start = __memblock_alloc_base(crash_size, PAGE_SIZE, max); | 176 | crashk_res.start = __memblock_alloc_base(crash_size, PAGE_SIZE, max); |
diff --git a/arch/sparc/include/asm/elf_64.h b/arch/sparc/include/asm/elf_64.h index e67880381b84..cfa9cd2e5519 100644 --- a/arch/sparc/include/asm/elf_64.h +++ b/arch/sparc/include/asm/elf_64.h | |||
@@ -186,7 +186,7 @@ static inline unsigned int sparc64_elf_hwcap(void) | |||
186 | return cap; | 186 | return cap; |
187 | } | 187 | } |
188 | 188 | ||
189 | #define ELF_HWCAP sparc64_elf_hwcap(); | 189 | #define ELF_HWCAP sparc64_elf_hwcap() |
190 | 190 | ||
191 | /* This yields a string that ld.so will use to load implementation | 191 | /* This yields a string that ld.so will use to load implementation |
192 | specific libraries for optimization. This is more specific in | 192 | specific libraries for optimization. This is more specific in |
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c index 1c9c80a1a86a..6ffccd6e0156 100644 --- a/arch/sparc/kernel/ioport.c +++ b/arch/sparc/kernel/ioport.c | |||
@@ -228,7 +228,7 @@ _sparc_ioremap(struct resource *res, u32 bus, u32 pa, int sz) | |||
228 | } | 228 | } |
229 | 229 | ||
230 | pa &= PAGE_MASK; | 230 | pa &= PAGE_MASK; |
231 | sparc_mapiorange(bus, pa, res->start, res->end - res->start + 1); | 231 | sparc_mapiorange(bus, pa, res->start, resource_size(res)); |
232 | 232 | ||
233 | return (void __iomem *)(unsigned long)(res->start + offset); | 233 | return (void __iomem *)(unsigned long)(res->start + offset); |
234 | } | 234 | } |
@@ -240,7 +240,7 @@ static void _sparc_free_io(struct resource *res) | |||
240 | { | 240 | { |
241 | unsigned long plen; | 241 | unsigned long plen; |
242 | 242 | ||
243 | plen = res->end - res->start + 1; | 243 | plen = resource_size(res); |
244 | BUG_ON((plen & (PAGE_SIZE-1)) != 0); | 244 | BUG_ON((plen & (PAGE_SIZE-1)) != 0); |
245 | sparc_unmapiorange(res->start, plen); | 245 | sparc_unmapiorange(res->start, plen); |
246 | release_resource(res); | 246 | release_resource(res); |
@@ -331,9 +331,9 @@ static void sbus_free_coherent(struct device *dev, size_t n, void *p, | |||
331 | } | 331 | } |
332 | 332 | ||
333 | n = PAGE_ALIGN(n); | 333 | n = PAGE_ALIGN(n); |
334 | if ((res->end-res->start)+1 != n) { | 334 | if (resource_size(res) != n) { |
335 | printk("sbus_free_consistent: region 0x%lx asked 0x%zx\n", | 335 | printk("sbus_free_consistent: region 0x%lx asked 0x%zx\n", |
336 | (long)((res->end-res->start)+1), n); | 336 | (long)resource_size(res), n); |
337 | return; | 337 | return; |
338 | } | 338 | } |
339 | 339 | ||
@@ -504,9 +504,9 @@ static void pci32_free_coherent(struct device *dev, size_t n, void *p, | |||
504 | } | 504 | } |
505 | 505 | ||
506 | n = PAGE_ALIGN(n); | 506 | n = PAGE_ALIGN(n); |
507 | if ((res->end-res->start)+1 != n) { | 507 | if (resource_size(res) != n) { |
508 | printk("pci_free_consistent: region 0x%lx asked 0x%lx\n", | 508 | printk("pci_free_consistent: region 0x%lx asked 0x%lx\n", |
509 | (long)((res->end-res->start)+1), (long)n); | 509 | (long)resource_size(res), (long)n); |
510 | return; | 510 | return; |
511 | } | 511 | } |
512 | 512 | ||
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index 80a87e2a3e7c..1e94f946570e 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c | |||
@@ -820,11 +820,9 @@ static int __pci_mmap_make_offset_bus(struct pci_dev *pdev, struct vm_area_struc | |||
820 | unsigned long space_size, user_offset, user_size; | 820 | unsigned long space_size, user_offset, user_size; |
821 | 821 | ||
822 | if (mmap_state == pci_mmap_io) { | 822 | if (mmap_state == pci_mmap_io) { |
823 | space_size = (pbm->io_space.end - | 823 | space_size = resource_size(&pbm->io_space); |
824 | pbm->io_space.start) + 1; | ||
825 | } else { | 824 | } else { |
826 | space_size = (pbm->mem_space.end - | 825 | space_size = resource_size(&pbm->mem_space); |
827 | pbm->mem_space.start) + 1; | ||
828 | } | 826 | } |
829 | 827 | ||
830 | /* Make sure the request is in range. */ | 828 | /* Make sure the request is in range. */ |
diff --git a/arch/tile/kernel/setup.c b/arch/tile/kernel/setup.c index 6cdc9ba55fe0..5f85d8b34dbb 100644 --- a/arch/tile/kernel/setup.c +++ b/arch/tile/kernel/setup.c | |||
@@ -553,8 +553,7 @@ static void __init setup_bootmem_allocator(void) | |||
553 | 553 | ||
554 | #ifdef CONFIG_KEXEC | 554 | #ifdef CONFIG_KEXEC |
555 | if (crashk_res.start != crashk_res.end) | 555 | if (crashk_res.start != crashk_res.end) |
556 | reserve_bootmem(crashk_res.start, | 556 | reserve_bootmem(crashk_res.start, resource_size(&crashk_res), 0); |
557 | crashk_res.end - crashk_res.start + 1, 0); | ||
558 | #endif | 557 | #endif |
559 | } | 558 | } |
560 | 559 | ||
diff --git a/arch/um/sys-i386/signal.c b/arch/um/sys-i386/signal.c index 129647375a6c..89a46626bfd8 100644 --- a/arch/um/sys-i386/signal.c +++ b/arch/um/sys-i386/signal.c | |||
@@ -58,7 +58,7 @@ static inline unsigned long twd_fxsr_to_i387(struct user_fxsr_struct *fxsave) | |||
58 | unsigned long ret = 0xffff0000; | 58 | unsigned long ret = 0xffff0000; |
59 | int i; | 59 | int i; |
60 | 60 | ||
61 | #define FPREG_ADDR(f, n) ((char *)&(f)->st_space + (n) * 16); | 61 | #define FPREG_ADDR(f, n) ((char *)&(f)->st_space + (n) * 16) |
62 | 62 | ||
63 | for (i = 0; i < 8; i++) { | 63 | for (i = 0; i < 8; i++) { |
64 | if (twd & 0x1) { | 64 | if (twd & 0x1) { |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index a67e014e4e44..78fe57dcfc56 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -1737,8 +1737,8 @@ menuconfig APM | |||
1737 | machines with more than one CPU. | 1737 | machines with more than one CPU. |
1738 | 1738 | ||
1739 | In order to use APM, you will need supporting software. For location | 1739 | In order to use APM, you will need supporting software. For location |
1740 | and more information, read <file:Documentation/power/pm.txt> and the | 1740 | and more information, read <file:Documentation/power/apm-acpi.txt> |
1741 | Battery Powered Linux mini-HOWTO, available from | 1741 | and the Battery Powered Linux mini-HOWTO, available from |
1742 | <http://www.tldp.org/docs.html#howto>. | 1742 | <http://www.tldp.org/docs.html#howto>. |
1743 | 1743 | ||
1744 | This driver does not spin down disk drives (see the hdparm(8) | 1744 | This driver does not spin down disk drives (see the hdparm(8) |
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c index 12aff2537682..739d8598f789 100644 --- a/arch/x86/kernel/i387.c +++ b/arch/x86/kernel/i387.c | |||
@@ -321,7 +321,7 @@ static inline unsigned short twd_i387_to_fxsr(unsigned short twd) | |||
321 | return tmp; | 321 | return tmp; |
322 | } | 322 | } |
323 | 323 | ||
324 | #define FPREG_ADDR(f, n) ((void *)&(f)->st_space + (n) * 16); | 324 | #define FPREG_ADDR(f, n) ((void *)&(f)->st_space + (n) * 16) |
325 | #define FP_EXP_TAG_VALID 0 | 325 | #define FP_EXP_TAG_VALID 0 |
326 | #define FP_EXP_TAG_ZERO 1 | 326 | #define FP_EXP_TAG_ZERO 1 |
327 | #define FP_EXP_TAG_SPECIAL 2 | 327 | #define FP_EXP_TAG_SPECIAL 2 |
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c index e8c33a302006..726494b58345 100644 --- a/arch/x86/kernel/pci-calgary_64.c +++ b/arch/x86/kernel/pci-calgary_64.c | |||
@@ -1553,7 +1553,7 @@ static void __init calgary_fixup_one_tce_space(struct pci_dev *dev) | |||
1553 | continue; | 1553 | continue; |
1554 | 1554 | ||
1555 | /* cover the whole region */ | 1555 | /* cover the whole region */ |
1556 | npages = (r->end - r->start) >> PAGE_SHIFT; | 1556 | npages = resource_size(r) >> PAGE_SHIFT; |
1557 | npages++; | 1557 | npages++; |
1558 | 1558 | ||
1559 | iommu_range_reserve(tbl, r->start, npages); | 1559 | iommu_range_reserve(tbl, r->start, npages); |
diff --git a/arch/x86/kernel/probe_roms.c b/arch/x86/kernel/probe_roms.c index ba0a4cce53be..63228035f9d7 100644 --- a/arch/x86/kernel/probe_roms.c +++ b/arch/x86/kernel/probe_roms.c | |||
@@ -234,7 +234,7 @@ void __init probe_roms(void) | |||
234 | /* check for extension rom (ignore length byte!) */ | 234 | /* check for extension rom (ignore length byte!) */ |
235 | rom = isa_bus_to_virt(extension_rom_resource.start); | 235 | rom = isa_bus_to_virt(extension_rom_resource.start); |
236 | if (romsignature(rom)) { | 236 | if (romsignature(rom)) { |
237 | length = extension_rom_resource.end - extension_rom_resource.start + 1; | 237 | length = resource_size(&extension_rom_resource); |
238 | if (romchecksum(rom, length)) { | 238 | if (romchecksum(rom, length)) { |
239 | request_resource(&iomem_resource, &extension_rom_resource); | 239 | request_resource(&iomem_resource, &extension_rom_resource); |
240 | upper = extension_rom_resource.start; | 240 | upper = extension_rom_resource.start; |
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 9335e1bf72ad..1c5b69373a00 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include "mmu.h" | 22 | #include "mmu.h" |
23 | #include "x86.h" | 23 | #include "x86.h" |
24 | #include "kvm_cache_regs.h" | 24 | #include "kvm_cache_regs.h" |
25 | #include "x86.h" | ||
26 | 25 | ||
27 | #include <linux/kvm_host.h> | 26 | #include <linux/kvm_host.h> |
28 | #include <linux/types.h> | 27 | #include <linux/types.h> |
diff --git a/arch/xtensa/include/asm/uaccess.h b/arch/xtensa/include/asm/uaccess.h index 5b0c18c1cce1..82d4e3815c89 100644 --- a/arch/xtensa/include/asm/uaccess.h +++ b/arch/xtensa/include/asm/uaccess.h | |||
@@ -17,6 +17,7 @@ | |||
17 | #define _XTENSA_UACCESS_H | 17 | #define _XTENSA_UACCESS_H |
18 | 18 | ||
19 | #include <linux/errno.h> | 19 | #include <linux/errno.h> |
20 | #include <asm/types.h> | ||
20 | 21 | ||
21 | #define VERIFY_READ 0 | 22 | #define VERIFY_READ 0 |
22 | #define VERIFY_WRITE 1 | 23 | #define VERIFY_WRITE 1 |
@@ -26,7 +27,6 @@ | |||
26 | #include <asm/current.h> | 27 | #include <asm/current.h> |
27 | #include <asm/asm-offsets.h> | 28 | #include <asm/asm-offsets.h> |
28 | #include <asm/processor.h> | 29 | #include <asm/processor.h> |
29 | #include <asm/types.h> | ||
30 | 30 | ||
31 | /* | 31 | /* |
32 | * These assembly macros mirror the C macros that follow below. They | 32 | * These assembly macros mirror the C macros that follow below. They |
@@ -157,7 +157,6 @@ | |||
157 | #else /* __ASSEMBLY__ not defined */ | 157 | #else /* __ASSEMBLY__ not defined */ |
158 | 158 | ||
159 | #include <linux/sched.h> | 159 | #include <linux/sched.h> |
160 | #include <asm/types.h> | ||
161 | 160 | ||
162 | /* | 161 | /* |
163 | * The fs value determines whether argument validity checking should | 162 | * The fs value determines whether argument validity checking should |
diff --git a/arch/xtensa/variants/s6000/include/variant/dmac.h b/arch/xtensa/variants/s6000/include/variant/dmac.h index 89ab9484fb71..e81735b2a206 100644 --- a/arch/xtensa/variants/s6000/include/variant/dmac.h +++ b/arch/xtensa/variants/s6000/include/variant/dmac.h | |||
@@ -357,7 +357,7 @@ static inline u32 s6dmac_channel_enabled(u32 dmac, int chan) | |||
357 | static inline void s6dmac_dp_setup_group(u32 dmac, int port, | 357 | static inline void s6dmac_dp_setup_group(u32 dmac, int port, |
358 | int nrch, int frrep) | 358 | int nrch, int frrep) |
359 | { | 359 | { |
360 | const static u8 mask[4] = {0, 3, 1, 2}; | 360 | static const u8 mask[4] = {0, 3, 1, 2}; |
361 | BUG_ON(dmac != S6_REG_DPDMA); | 361 | BUG_ON(dmac != S6_REG_DPDMA); |
362 | if ((port < 0) || (port > 3) || (nrch < 1) || (nrch > 4)) | 362 | if ((port < 0) || (port > 3) || (nrch < 1) || (nrch > 4)) |
363 | return; | 363 | return; |