[patch 09/18] PNP: in debug resource dump, make empty list obvious

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Len Brown <lenb@...>
Cc: <linux-acpi@...>, Rene Herman <rene.herman@...>, <linux-kernel@...>, Adam Belay <ambx1@...>, Adam M Belay <abelay@...>, Li Shaohua <shaohua.li@...>, Matthieu Castet <castet.matthieu@...>, Thomas Renninger <trenn@...>, Rene Herman <rene.herman@...>, Jaroslav Kysela <perex@...>, Andrew Morton <akpm@...>, Takashi Iwai <tiwai@...>
Date: Wednesday, June 4, 2008 - 6:09 pm

If the resource list is empty, say that explicitly.  Previously,
it was confusing because often the heading was followed by zero
resource lines, then some "add resource" lines from auto-assignment,
so the "add" lines looked like current resources.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Rene Herman <rene.herman@gmail.com>

Index: work10/drivers/pnp/support.c
===================================================================
--- work10.orig/drivers/pnp/support.c	2008-05-16 16:01:26.000000000 -0600
+++ work10/drivers/pnp/support.c	2008-05-16 16:13:42.000000000 -0600
@@ -77,7 +77,12 @@ void dbg_pnp_show_resources(struct pnp_d
 	struct pnp_resource *pnp_res;
 	struct resource *res;
 
-	dev_dbg(&dev->dev, "current resources: %s\n", desc);
+	if (list_empty(&dev->resources)) {
+		dev_dbg(&dev->dev, "%s: no current resources\n", desc);
+		return;
+	}
+
+	dev_dbg(&dev->dev, "%s: current resources:\n", desc);
 	list_for_each_entry(pnp_res, &dev->resources, list) {
 		res = &pnp_res->res;
 

-- 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 09/18] PNP: in debug resource dump, make empty list o..., Bjorn Helgaas, (Wed Jun 4, 6:09 pm)