[PATCH 3/5] resources: Print warning when inserting resource [mem 0x00000000]

2012-11-07 Thread Peter Hurley
Inserting iomem resource [0x0-0x0] is most likely a bug; at least
print a warning message. Eg.,
  resource: inserting NULL resource iTCO_wdt [mem 0x]

Cc: Bjorn Helgaas 
Signed-off-by: Peter Hurley 
---
 kernel/resource.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/resource.c b/kernel/resource.c
index 268b5fa..ab758bb 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -589,6 +589,9 @@ static struct resource * __insert_resource(struct resource 
*parent, struct resou
 {
struct resource *first, *next;
 
+   if (new->flags & IORESOURCE_MEM && !new->start && !new->end)
+   pr_warn("inserting NULL resource %s %pR", new->name, new);
+
for (;; parent = first) {
first = __request_resource(parent, new);
if (!first)
-- 
1.7.12.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/5] resources: Print warning when inserting resource [mem 0x00000000]

2012-11-07 Thread Peter Hurley
Inserting iomem resource [0x0-0x0] is most likely a bug; at least
print a warning message. Eg.,
  resource: inserting NULL resource iTCO_wdt [mem 0x]

Cc: Bjorn Helgaas bhelg...@google.com
Signed-off-by: Peter Hurley pe...@hurleysoftware.com
---
 kernel/resource.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/resource.c b/kernel/resource.c
index 268b5fa..ab758bb 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -589,6 +589,9 @@ static struct resource * __insert_resource(struct resource 
*parent, struct resou
 {
struct resource *first, *next;
 
+   if (new-flags  IORESOURCE_MEM  !new-start  !new-end)
+   pr_warn(inserting NULL resource %s %pR, new-name, new);
+
for (;; parent = first) {
first = __request_resource(parent, new);
if (!first)
-- 
1.7.12.3

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/