]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - lib/vsprintf.c
vsprintf: Add support for IORESOURCE_UNSET in %pR
[mirror_ubuntu-artful-kernel.git] / lib / vsprintf.c
index 185b6d300ebcedb86c0214c7007716ac868c17a1..5e2cf6f342f8cac5dad0d91481c0622c36542179 100644 (file)
@@ -719,10 +719,15 @@ char *resource_string(char *buf, char *end, struct resource *res,
                specp = &mem_spec;
                decode = 0;
        }
-       p = number(p, pend, res->start, *specp);
-       if (res->start != res->end) {
-               *p++ = '-';
-               p = number(p, pend, res->end, *specp);
+       if (decode && res->flags & IORESOURCE_UNSET) {
+               p = string(p, pend, "size ", str_spec);
+               p = number(p, pend, resource_size(res), *specp);
+       } else {
+               p = number(p, pend, res->start, *specp);
+               if (res->start != res->end) {
+                       *p++ = '-';
+                       p = number(p, pend, res->end, *specp);
+               }
        }
        if (decode) {
                if (res->flags & IORESOURCE_MEM_64)