Commit 55d1bb9a authored by Len Brown's avatar Len Brown

Pull bugzilla-9535 into release branch

parents 8df042e8 66a21736
...@@ -76,6 +76,7 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res, ...@@ -76,6 +76,7 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res,
int i = 0; int i = 0;
int irq; int irq;
int p, t; int p, t;
static unsigned char warned;
if (!valid_IRQ(gsi)) if (!valid_IRQ(gsi))
return; return;
...@@ -83,9 +84,10 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res, ...@@ -83,9 +84,10 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res,
while (!(res->irq_resource[i].flags & IORESOURCE_UNSET) && while (!(res->irq_resource[i].flags & IORESOURCE_UNSET) &&
i < PNP_MAX_IRQ) i < PNP_MAX_IRQ)
i++; i++;
if (i >= PNP_MAX_IRQ) { if (i >= PNP_MAX_IRQ && !warned) {
printk(KERN_ERR "pnpacpi: exceeded the max number of IRQ " printk(KERN_ERR "pnpacpi: exceeded the max number of IRQ "
"resources: %d \n", PNP_MAX_IRQ); "resources: %d \n", PNP_MAX_IRQ);
warned = 1;
return; return;
} }
/* /*
...@@ -169,6 +171,7 @@ static void pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res, ...@@ -169,6 +171,7 @@ static void pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res,
int bus_master, int transfer) int bus_master, int transfer)
{ {
int i = 0; int i = 0;
static unsigned char warned;
while (i < PNP_MAX_DMA && while (i < PNP_MAX_DMA &&
!(res->dma_resource[i].flags & IORESOURCE_UNSET)) !(res->dma_resource[i].flags & IORESOURCE_UNSET))
...@@ -183,9 +186,10 @@ static void pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res, ...@@ -183,9 +186,10 @@ static void pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res,
} }
res->dma_resource[i].start = dma; res->dma_resource[i].start = dma;
res->dma_resource[i].end = dma; res->dma_resource[i].end = dma;
} else { } else if (!warned) {
printk(KERN_ERR "pnpacpi: exceeded the max number of DMA " printk(KERN_ERR "pnpacpi: exceeded the max number of DMA "
"resources: %d \n", PNP_MAX_DMA); "resources: %d \n", PNP_MAX_DMA);
warned = 1;
} }
} }
...@@ -193,6 +197,7 @@ static void pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res, ...@@ -193,6 +197,7 @@ static void pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res,
u64 io, u64 len, int io_decode) u64 io, u64 len, int io_decode)
{ {
int i = 0; int i = 0;
static unsigned char warned;
while (!(res->port_resource[i].flags & IORESOURCE_UNSET) && while (!(res->port_resource[i].flags & IORESOURCE_UNSET) &&
i < PNP_MAX_PORT) i < PNP_MAX_PORT)
...@@ -207,7 +212,7 @@ static void pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res, ...@@ -207,7 +212,7 @@ static void pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res,
} }
res->port_resource[i].start = io; res->port_resource[i].start = io;
res->port_resource[i].end = io + len - 1; res->port_resource[i].end = io + len - 1;
} else { } else if (!warned) {
printk(KERN_ERR "pnpacpi: exceeded the max number of IO " printk(KERN_ERR "pnpacpi: exceeded the max number of IO "
"resources: %d \n", PNP_MAX_PORT); "resources: %d \n", PNP_MAX_PORT);
} }
...@@ -218,6 +223,7 @@ static void pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res, ...@@ -218,6 +223,7 @@ static void pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res,
int write_protect) int write_protect)
{ {
int i = 0; int i = 0;
static unsigned char warned;
while (!(res->mem_resource[i].flags & IORESOURCE_UNSET) && while (!(res->mem_resource[i].flags & IORESOURCE_UNSET) &&
(i < PNP_MAX_MEM)) (i < PNP_MAX_MEM))
...@@ -233,7 +239,7 @@ static void pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res, ...@@ -233,7 +239,7 @@ static void pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res,
res->mem_resource[i].start = mem; res->mem_resource[i].start = mem;
res->mem_resource[i].end = mem + len - 1; res->mem_resource[i].end = mem + len - 1;
} else { } else if (!warned) {
printk(KERN_ERR "pnpacpi: exceeded the max number of mem " printk(KERN_ERR "pnpacpi: exceeded the max number of mem "
"resources: %d\n", PNP_MAX_MEM); "resources: %d\n", PNP_MAX_MEM);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment