aboutsummaryrefslogtreecommitdiff
path: root/drivers/pnp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/resource.c92
1 files changed, 46 insertions, 46 deletions
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c
index ef8835ec577..15995f9f8b7 100644
--- a/drivers/pnp/resource.c
+++ b/drivers/pnp/resource.c
@@ -241,7 +241,7 @@ void pnp_free_option(struct pnp_option *option)
int pnp_check_port(struct pnp_dev *dev, int idx)
{
- int tmp;
+ int i;
struct pnp_dev *tdev;
resource_size_t *port, *end, *tport, *tend;
@@ -260,18 +260,18 @@ int pnp_check_port(struct pnp_dev *dev, int idx)
}
/* check if the resource is reserved */
- for (tmp = 0; tmp < 8; tmp++) {
- int rport = pnp_reserve_io[tmp << 1];
- int rend = pnp_reserve_io[(tmp << 1) + 1] + rport - 1;
+ for (i = 0; i < 8; i++) {
+ int rport = pnp_reserve_io[i << 1];
+ int rend = pnp_reserve_io[(i << 1) + 1] + rport - 1;
if (ranged_conflict(port, end, &rport, &rend))
return 0;
}
/* check for internal conflicts */
- for (tmp = 0; tmp < PNP_MAX_PORT && tmp != idx; tmp++) {
- if (dev->res.port_resource[tmp].flags & IORESOURCE_IO) {
- tport = &dev->res.port_resource[tmp].start;
- tend = &dev->res.port_resource[tmp].end;
+ for (i = 0; i < PNP_MAX_PORT && i != idx; i++) {
+ if (dev->res.port_resource[i].flags & IORESOURCE_IO) {
+ tport = &dev->res.port_resource[i].start;
+ tend = &dev->res.port_resource[i].end;
if (ranged_conflict(port, end, tport, tend))
return 0;
}
@@ -281,13 +281,13 @@ int pnp_check_port(struct pnp_dev *dev, int idx)
pnp_for_each_dev(tdev) {
if (tdev == dev)
continue;
- for (tmp = 0; tmp < PNP_MAX_PORT; tmp++) {
- if (tdev->res.port_resource[tmp].flags & IORESOURCE_IO) {
+ for (i = 0; i < PNP_MAX_PORT; i++) {
+ if (tdev->res.port_resource[i].flags & IORESOURCE_IO) {
if (cannot_compare
- (tdev->res.port_resource[tmp].flags))
+ (tdev->res.port_resource[i].flags))
continue;
- tport = &tdev->res.port_resource[tmp].start;
- tend = &tdev->res.port_resource[tmp].end;
+ tport = &tdev->res.port_resource[i].start;
+ tend = &tdev->res.port_resource[i].end;
if (ranged_conflict(port, end, tport, tend))
return 0;
}
@@ -299,7 +299,7 @@ int pnp_check_port(struct pnp_dev *dev, int idx)
int pnp_check_mem(struct pnp_dev *dev, int idx)
{
- int tmp;
+ int i;
struct pnp_dev *tdev;
resource_size_t *addr, *end, *taddr, *tend;
@@ -318,18 +318,18 @@ int pnp_check_mem(struct pnp_dev *dev, int idx)
}
/* check if the resource is reserved */
- for (tmp = 0; tmp < 8; tmp++) {
- int raddr = pnp_reserve_mem[tmp << 1];
- int rend = pnp_reserve_mem[(tmp << 1) + 1] + raddr - 1;
+ for (i = 0; i < 8; i++) {
+ int raddr = pnp_reserve_mem[i << 1];
+ int rend = pnp_reserve_mem[(i << 1) + 1] + raddr - 1;
if (ranged_conflict(addr, end, &raddr, &rend))
return 0;
}
/* check for internal conflicts */
- for (tmp = 0; tmp < PNP_MAX_MEM && tmp != idx; tmp++) {
- if (dev->res.mem_resource[tmp].flags & IORESOURCE_MEM) {
- taddr = &dev->res.mem_resource[tmp].start;
- tend = &dev->res.mem_resource[tmp].end;
+ for (i = 0; i < PNP_MAX_MEM && i != idx; i++) {
+ if (dev->res.mem_resource[i].flags & IORESOURCE_MEM) {
+ taddr = &dev->res.mem_resource[i].start;
+ tend = &dev->res.mem_resource[i].end;
if (ranged_conflict(addr, end, taddr, tend))
return 0;
}
@@ -339,13 +339,13 @@ int pnp_check_mem(struct pnp_dev *dev, int idx)
pnp_for_each_dev(tdev) {
if (tdev == dev)
continue;
- for (tmp = 0; tmp < PNP_MAX_MEM; tmp++) {
- if (tdev->res.mem_resource[tmp].flags & IORESOURCE_MEM) {
+ for (i = 0; i < PNP_MAX_MEM; i++) {
+ if (tdev->res.mem_resource[i].flags & IORESOURCE_MEM) {
if (cannot_compare
- (tdev->res.mem_resource[tmp].flags))
+ (tdev->res.mem_resource[i].flags))
continue;
- taddr = &tdev->res.mem_resource[tmp].start;
- tend = &tdev->res.mem_resource[tmp].end;
+ taddr = &tdev->res.mem_resource[i].start;
+ tend = &tdev->res.mem_resource[i].end;
if (ranged_conflict(addr, end, taddr, tend))
return 0;
}
@@ -362,7 +362,7 @@ static irqreturn_t pnp_test_handler(int irq, void *dev_id)
int pnp_check_irq(struct pnp_dev *dev, int idx)
{
- int tmp;
+ int i;
struct pnp_dev *tdev;
resource_size_t *irq = &dev->res.irq_resource[idx].start;
@@ -375,15 +375,15 @@ int pnp_check_irq(struct pnp_dev *dev, int idx)
return 0;
/* check if the resource is reserved */
- for (tmp = 0; tmp < 16; tmp++) {
- if (pnp_reserve_irq[tmp] == *irq)
+ for (i = 0; i < 16; i++) {
+ if (pnp_reserve_irq[i] == *irq)
return 0;
}
/* check for internal conflicts */
- for (tmp = 0; tmp < PNP_MAX_IRQ && tmp != idx; tmp++) {
- if (dev->res.irq_resource[tmp].flags & IORESOURCE_IRQ) {
- if (dev->res.irq_resource[tmp].start == *irq)
+ for (i = 0; i < PNP_MAX_IRQ && i != idx; i++) {
+ if (dev->res.irq_resource[i].flags & IORESOURCE_IRQ) {
+ if (dev->res.irq_resource[i].start == *irq)
return 0;
}
}
@@ -414,12 +414,12 @@ int pnp_check_irq(struct pnp_dev *dev, int idx)
pnp_for_each_dev(tdev) {
if (tdev == dev)
continue;
- for (tmp = 0; tmp < PNP_MAX_IRQ; tmp++) {
- if (tdev->res.irq_resource[tmp].flags & IORESOURCE_IRQ) {
+ for (i = 0; i < PNP_MAX_IRQ; i++) {
+ if (tdev->res.irq_resource[i].flags & IORESOURCE_IRQ) {
if (cannot_compare
- (tdev->res.irq_resource[tmp].flags))
+ (tdev->res.irq_resource[i].flags))
continue;
- if ((tdev->res.irq_resource[tmp].start == *irq))
+ if ((tdev->res.irq_resource[i].start == *irq))
return 0;
}
}
@@ -431,7 +431,7 @@ int pnp_check_irq(struct pnp_dev *dev, int idx)
int pnp_check_dma(struct pnp_dev *dev, int idx)
{
#ifndef CONFIG_IA64
- int tmp;
+ int i;
struct pnp_dev *tdev;
resource_size_t *dma = &dev->res.dma_resource[idx].start;
@@ -444,15 +444,15 @@ int pnp_check_dma(struct pnp_dev *dev, int idx)
return 0;
/* check if the resource is reserved */
- for (tmp = 0; tmp < 8; tmp++) {
- if (pnp_reserve_dma[tmp] == *dma)
+ for (i = 0; i < 8; i++) {
+ if (pnp_reserve_dma[i] == *dma)
return 0;
}
/* check for internal conflicts */
- for (tmp = 0; tmp < PNP_MAX_DMA && tmp != idx; tmp++) {
- if (dev->res.dma_resource[tmp].flags & IORESOURCE_DMA) {
- if (dev->res.dma_resource[tmp].start == *dma)
+ for (i = 0; i < PNP_MAX_DMA && i != idx; i++) {
+ if (dev->res.dma_resource[i].flags & IORESOURCE_DMA) {
+ if (dev->res.dma_resource[i].start == *dma)
return 0;
}
}
@@ -469,12 +469,12 @@ int pnp_check_dma(struct pnp_dev *dev, int idx)
pnp_for_each_dev(tdev) {
if (tdev == dev)
continue;
- for (tmp = 0; tmp < PNP_MAX_DMA; tmp++) {
- if (tdev->res.dma_resource[tmp].flags & IORESOURCE_DMA) {
+ for (i = 0; i < PNP_MAX_DMA; i++) {
+ if (tdev->res.dma_resource[i].flags & IORESOURCE_DMA) {
if (cannot_compare
- (tdev->res.dma_resource[tmp].flags))
+ (tdev->res.dma_resource[i].flags))
continue;
- if ((tdev->res.dma_resource[tmp].start == *dma))
+ if ((tdev->res.dma_resource[i].start == *dma))
return 0;
}
}