From: Bjorn Helgaas 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 Acked-by: Rene Herman Cc: Len Brown Cc: Adam M Belay Cc: Li Shaohua Cc: Matthieu Castet Cc: Thomas Renninger Cc: Jaroslav Kysela Cc: Takashi Iwai Signed-off-by: Andrew Morton --- drivers/pnp/support.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff -puN drivers/pnp/support.c~pnp-in-debug-resource-dump-make-empty-list-obvious drivers/pnp/support.c --- a/drivers/pnp/support.c~pnp-in-debug-resource-dump-make-empty-list-obvious +++ a/drivers/pnp/support.c @@ -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; _