From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bjorn Helgaas Subject: [patch 46/53] PNP: remove ratelimit on add resource failures Date: Fri, 18 Apr 2008 14:50:41 -0600 Message-ID: <20080418205056.574167384@ldl.fc.hp.com> References: <20080418204955.342963315@ldl.fc.hp.com> Return-path: Content-Disposition: inline; filename=pnp-remove-warning-ratelimit Sender: linux-kernel-owner@vger.kernel.org To: Len Brown Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Adam Belay , Li Shaohua , Matthieu Castet , Thomas Renninger , Rene Herman , Jaroslav Kysela , Andrew Morton List-Id: linux-acpi@vger.kernel.org We used to have a fixed-size resource table. If a device had twenty resources when the table only had space for ten, we didn't need ten warnings, so we added the ratelimit. Now that we can dynamically allocate new resources, we should only get failures if the allocation fails. That should be rare enough that we don't need to ratelimit the messages. Signed-off-by: Bjorn Helgaas Index: work8/drivers/pnp/resource.c =================================================================== --- work8.orig/drivers/pnp/resource.c 2008-04-17 14:39:12.000000000 -0600 +++ work8/drivers/pnp/resource.c 2008-04-17 14:40:09.000000000 -0600 @@ -538,15 +538,10 @@ { struct pnp_resource *pnp_res; struct resource *res; - static unsigned char warned; pnp_res = pnp_new_resource(dev, IORESOURCE_IRQ); if (!pnp_res) { - if (!warned) { - dev_err(&dev->dev, "can't add resource for IRQ %d\n", - irq); - warned = 1; - } + dev_err(&dev->dev, "can't add resource for IRQ %d\n", irq); return NULL; } @@ -562,15 +557,10 @@ { struct pnp_resource *pnp_res; struct resource *res; - static unsigned char warned; pnp_res = pnp_new_resource(dev, IORESOURCE_DMA); if (!pnp_res) { - if (!warned) { - dev_err(&dev->dev, "can't add resource for DMA %d\n", - dma); - warned = 1; - } + dev_err(&dev->dev, "can't add resource for DMA %d\n", dma); return NULL; } @@ -587,16 +577,11 @@ { struct pnp_resource *pnp_res; struct resource *res; - static unsigned char warned; pnp_res = pnp_new_resource(dev, IORESOURCE_IO); if (!pnp_res) { - if (!warned) { - dev_err(&dev->dev, "can't add resource for IO " - "0x%llx-0x%llx\n",(unsigned long long) start, - (unsigned long long) end); - warned = 1; - } + dev_err(&dev->dev, "can't add resource for IO 0x%llx-0x%llx\n", + (unsigned long long) start, (unsigned long long) end); return NULL; } @@ -613,16 +598,11 @@ { struct pnp_resource *pnp_res; struct resource *res; - static unsigned char warned; pnp_res = pnp_new_resource(dev, IORESOURCE_MEM); if (!pnp_res) { - if (!warned) { - dev_err(&dev->dev, "can't add resource for MEM " - "0x%llx-0x%llx\n",(unsigned long long) start, - (unsigned long long) end); - warned = 1; - } + dev_err(&dev->dev, "can't add resource for MEM 0x%llx-0x%llx\n", + (unsigned long long) start, (unsigned long long) end); return NULL; } -- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762147AbYDRVKv (ORCPT ); Fri, 18 Apr 2008 17:10:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761232AbYDRUx1 (ORCPT ); Fri, 18 Apr 2008 16:53:27 -0400 Received: from g5t0008.atlanta.hp.com ([15.192.0.45]:21855 "EHLO g5t0008.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761309AbYDRUwd (ORCPT ); Fri, 18 Apr 2008 16:52:33 -0400 Message-Id: <20080418205056.574167384@ldl.fc.hp.com> References: <20080418204955.342963315@ldl.fc.hp.com> User-Agent: quilt/0.46-1 Date: Fri, 18 Apr 2008 14:50:41 -0600 From: Bjorn Helgaas To: Len Brown Cc: linux-acpi@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Adam Belay Cc: Li Shaohua Cc: Matthieu Castet Cc: Thomas Renninger Cc: Rene Herman Cc: Jaroslav Kysela Cc: Andrew Morton Subject: [patch 46/53] PNP: remove ratelimit on add resource failures Content-Disposition: inline; filename=pnp-remove-warning-ratelimit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We used to have a fixed-size resource table. If a device had twenty resources when the table only had space for ten, we didn't need ten warnings, so we added the ratelimit. Now that we can dynamically allocate new resources, we should only get failures if the allocation fails. That should be rare enough that we don't need to ratelimit the messages. Signed-off-by: Bjorn Helgaas Index: work8/drivers/pnp/resource.c =================================================================== --- work8.orig/drivers/pnp/resource.c 2008-04-17 14:39:12.000000000 -0600 +++ work8/drivers/pnp/resource.c 2008-04-17 14:40:09.000000000 -0600 @@ -538,15 +538,10 @@ { struct pnp_resource *pnp_res; struct resource *res; - static unsigned char warned; pnp_res = pnp_new_resource(dev, IORESOURCE_IRQ); if (!pnp_res) { - if (!warned) { - dev_err(&dev->dev, "can't add resource for IRQ %d\n", - irq); - warned = 1; - } + dev_err(&dev->dev, "can't add resource for IRQ %d\n", irq); return NULL; } @@ -562,15 +557,10 @@ { struct pnp_resource *pnp_res; struct resource *res; - static unsigned char warned; pnp_res = pnp_new_resource(dev, IORESOURCE_DMA); if (!pnp_res) { - if (!warned) { - dev_err(&dev->dev, "can't add resource for DMA %d\n", - dma); - warned = 1; - } + dev_err(&dev->dev, "can't add resource for DMA %d\n", dma); return NULL; } @@ -587,16 +577,11 @@ { struct pnp_resource *pnp_res; struct resource *res; - static unsigned char warned; pnp_res = pnp_new_resource(dev, IORESOURCE_IO); if (!pnp_res) { - if (!warned) { - dev_err(&dev->dev, "can't add resource for IO " - "0x%llx-0x%llx\n",(unsigned long long) start, - (unsigned long long) end); - warned = 1; - } + dev_err(&dev->dev, "can't add resource for IO 0x%llx-0x%llx\n", + (unsigned long long) start, (unsigned long long) end); return NULL; } @@ -613,16 +598,11 @@ { struct pnp_resource *pnp_res; struct resource *res; - static unsigned char warned; pnp_res = pnp_new_resource(dev, IORESOURCE_MEM); if (!pnp_res) { - if (!warned) { - dev_err(&dev->dev, "can't add resource for MEM " - "0x%llx-0x%llx\n",(unsigned long long) start, - (unsigned long long) end); - warned = 1; - } + dev_err(&dev->dev, "can't add resource for MEM 0x%llx-0x%llx\n", + (unsigned long long) start, (unsigned long long) end); return NULL; } --