aboutsummaryrefslogtreecommitdiffstats
path: root/lib/vsprintf.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2010-03-19 03:05:10 -0400
committerJens Axboe <jens.axboe@oracle.com>2010-03-19 03:05:10 -0400
commitb4b7a4ef097f288f724420b473dbf92a89c0ab7e (patch)
tree23ad8101e3e77c32a8d1e1b95a9c1cd7f7a475b7 /lib/vsprintf.c
parente9ce335df51ff782035a15c261a3c0c9892a1767 (diff)
parenta3d3203e4bb40f253b1541e310dc0f9305be7c84 (diff)
Merge branch 'master' into for-linus
Conflicts: block/Kconfig Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r--lib/vsprintf.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 0d461c7c14db..24112e5a5780 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -609,6 +609,12 @@ static char *resource_string(char *buf, char *end, struct resource *res,
609 .precision = -1, 609 .precision = -1,
610 .flags = SPECIAL | SMALL | ZEROPAD, 610 .flags = SPECIAL | SMALL | ZEROPAD,
611 }; 611 };
612 static const struct printf_spec bus_spec = {
613 .base = 16,
614 .field_width = 2,
615 .precision = -1,
616 .flags = SMALL | ZEROPAD,
617 };
612 static const struct printf_spec dec_spec = { 618 static const struct printf_spec dec_spec = {
613 .base = 10, 619 .base = 10,
614 .precision = -1, 620 .precision = -1,
@@ -629,7 +635,7 @@ static char *resource_string(char *buf, char *end, struct resource *res,
629 * 64-bit res (sizeof==8): 20 chars in dec, 18 in hex ("0x" + 16) */ 635 * 64-bit res (sizeof==8): 20 chars in dec, 18 in hex ("0x" + 16) */
630#define RSRC_BUF_SIZE ((2 * sizeof(resource_size_t)) + 4) 636#define RSRC_BUF_SIZE ((2 * sizeof(resource_size_t)) + 4)
631#define FLAG_BUF_SIZE (2 * sizeof(res->flags)) 637#define FLAG_BUF_SIZE (2 * sizeof(res->flags))
632#define DECODED_BUF_SIZE sizeof("[mem - 64bit pref disabled]") 638#define DECODED_BUF_SIZE sizeof("[mem - 64bit pref window disabled]")
633#define RAW_BUF_SIZE sizeof("[mem - flags 0x]") 639#define RAW_BUF_SIZE sizeof("[mem - flags 0x]")
634 char sym[max(2*RSRC_BUF_SIZE + DECODED_BUF_SIZE, 640 char sym[max(2*RSRC_BUF_SIZE + DECODED_BUF_SIZE,
635 2*RSRC_BUF_SIZE + FLAG_BUF_SIZE + RAW_BUF_SIZE)]; 641 2*RSRC_BUF_SIZE + FLAG_BUF_SIZE + RAW_BUF_SIZE)];
@@ -651,6 +657,9 @@ static char *resource_string(char *buf, char *end, struct resource *res,
651 } else if (res->flags & IORESOURCE_DMA) { 657 } else if (res->flags & IORESOURCE_DMA) {
652 p = string(p, pend, "dma ", str_spec); 658 p = string(p, pend, "dma ", str_spec);
653 specp = &dec_spec; 659 specp = &dec_spec;
660 } else if (res->flags & IORESOURCE_BUS) {
661 p = string(p, pend, "bus ", str_spec);
662 specp = &bus_spec;
654 } else { 663 } else {
655 p = string(p, pend, "??? ", str_spec); 664 p = string(p, pend, "??? ", str_spec);
656 specp = &mem_spec; 665 specp = &mem_spec;
@@ -666,6 +675,8 @@ static char *resource_string(char *buf, char *end, struct resource *res,
666 p = string(p, pend, " 64bit", str_spec); 675 p = string(p, pend, " 64bit", str_spec);
667 if (res->flags & IORESOURCE_PREFETCH) 676 if (res->flags & IORESOURCE_PREFETCH)
668 p = string(p, pend, " pref", str_spec); 677 p = string(p, pend, " pref", str_spec);
678 if (res->flags & IORESOURCE_WINDOW)
679 p = string(p, pend, " window", str_spec);
669 if (res->flags & IORESOURCE_DISABLED) 680 if (res->flags & IORESOURCE_DISABLED)
670 p = string(p, pend, " disabled", str_spec); 681 p = string(p, pend, " disabled", str_spec);
671 } else { 682 } else {