Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=66a21736defda339cd93a0e70c1120ab813640f6
Commit:     66a21736defda339cd93a0e70c1120ab813640f6
Parent:     2c838197751db19d08a00e633e33dce23a69fb0c
Author:     Len Brown <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 12 17:56:36 2008 -0500
Committer:  Len Brown <[EMAIL PROTECTED]>
CommitDate: Sat Jan 12 17:56:36 2008 -0500

    pnpacpi: print resource shortage message only once
    
    pnpacpi: exceeded the max number of IO resources: 40
    
    While this message is a real error and should thus
    remain KERN_ERR (even a new dmesg line is seen as a regression
    by some, since it was not printed in 2.6.23...) it is certainly
    impolite to print this warning 50 times should you happen to
    have the oddball system with 90 io resources under a device...
    
    So print the warning just once.
    
    In 2.6.25 we'll get rid of the limits altogether
    and these warnings will vanish with them.
    
    http://bugzilla.kernel.org/show_bug.cgi?id=9535
    
    Signed-off-by: Len Brown <[EMAIL PROTECTED]>
---
 drivers/pnp/pnpacpi/rsparser.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index 3c5eb37..f7b8648 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -76,6 +76,7 @@ static void pnpacpi_parse_allocated_irqresource(struct 
pnp_resource_table *res,
        int i = 0;
        int irq;
        int p, t;
+       static unsigned char warned;
 
        if (!valid_IRQ(gsi))
                return;
@@ -83,9 +84,10 @@ static void pnpacpi_parse_allocated_irqresource(struct 
pnp_resource_table *res,
        while (!(res->irq_resource[i].flags & IORESOURCE_UNSET) &&
               i < PNP_MAX_IRQ)
                i++;
-       if (i >= PNP_MAX_IRQ) {
+       if (i >= PNP_MAX_IRQ && !warned) {
                printk(KERN_ERR "pnpacpi: exceeded the max number of IRQ "
                                "resources: %d \n", PNP_MAX_IRQ);
+               warned = 1;
                return;
        }
        /*
@@ -169,6 +171,7 @@ static void pnpacpi_parse_allocated_dmaresource(struct 
pnp_resource_table *res,
                                                int bus_master, int transfer)
 {
        int i = 0;
+       static unsigned char warned;
 
        while (i < PNP_MAX_DMA &&
               !(res->dma_resource[i].flags & IORESOURCE_UNSET))
@@ -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].end = dma;
-       } else {
+       } else if (!warned) {
                printk(KERN_ERR "pnpacpi: exceeded the max number of DMA "
                                "resources: %d \n", PNP_MAX_DMA);
+               warned = 1;
        }
 }
 
@@ -193,6 +197,7 @@ static void pnpacpi_parse_allocated_ioresource(struct 
pnp_resource_table *res,
                                               u64 io, u64 len, int io_decode)
 {
        int i = 0;
+       static unsigned char warned;
 
        while (!(res->port_resource[i].flags & IORESOURCE_UNSET) &&
               i < PNP_MAX_PORT)
@@ -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].end = io + len - 1;
-       } else {
+       } else if (!warned) {
                printk(KERN_ERR "pnpacpi: exceeded the max number of IO "
                                "resources: %d \n", PNP_MAX_PORT);
        }
@@ -218,6 +223,7 @@ static void pnpacpi_parse_allocated_memresource(struct 
pnp_resource_table *res,
                                                int write_protect)
 {
        int i = 0;
+       static unsigned char warned;
 
        while (!(res->mem_resource[i].flags & IORESOURCE_UNSET) &&
               (i < PNP_MAX_MEM))
@@ -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].end = mem + len - 1;
-       } else {
+       } else if (!warned) {
                printk(KERN_ERR "pnpacpi: exceeded the max number of mem "
                                "resources: %d\n", PNP_MAX_MEM);
        }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to