PNP: in debug resource dump, make empty list obvious

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Wednesday, July 16, 2008 - 4:08 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=819bea...
Commit:     819beac3806a5e986d81f476b999b7fffce1a233
Parent:     fcfb7ce3d688d5c15fc9bc0a2a48e1ededdb046f
Author:     Bjorn Helgaas <bjorn.helgaas@hp.com>
AuthorDate: Fri Jun 27 16:57:08 2008 -0600
Committer:  Andi Kleen <andi@basil.nowhere.org>
CommitDate: Wed Jul 16 23:27:06 2008 +0200

    PNP: in debug resource dump, make empty list obvious
    
    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>
    Signed-off-by: Andi Kleen <ak@linux.intel.com>
    Acked-by: Rene Herman <rene.herman@gmail.com>
    Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/pnp/support.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/pnp/support.c b/drivers/pnp/support.c
index 1566e4a..0ad42db 100644
--- a/drivers/pnp/support.c
+++ b/drivers/pnp/support.c
@@ -79,7 +79,12 @@ void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc)
 	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;
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
PNP: in debug resource dump, make empty list obvious, Linux Kernel Mailing ..., (Wed Jul 16, 4:08 pm)