diff options
author | David S. Miller <davem@davemloft.net> | 2009-12-11 20:12:17 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-11 20:12:17 -0500 |
commit | 501706565b2d4d2d40d0d301d5411ede099b8a6f (patch) | |
tree | 142a18bf1f1e74a09dbfa27540b893ade0fd797d /lib | |
parent | e93737b0f0159a61772894943199fd3b6f315641 (diff) | |
parent | 2fe77b81c77eed92c4c0439f74c8148a295b4a86 (diff) |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Conflicts:
include/net/tcp.h
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Kconfig.debug | 10 | ||||
-rw-r--r-- | lib/decompress_bunzip2.c | 2 | ||||
-rw-r--r-- | lib/dma-debug.c | 2 | ||||
-rw-r--r-- | lib/idr.c | 4 | ||||
-rw-r--r-- | lib/swiotlb.c | 2 | ||||
-rw-r--r-- | lib/vsprintf.c | 87 |
6 files changed, 84 insertions, 23 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 0b8f35918a36..2f22cf4576db 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -105,7 +105,7 @@ config DEBUG_SECTION_MISMATCH | |||
105 | bool "Enable full Section mismatch analysis" | 105 | bool "Enable full Section mismatch analysis" |
106 | depends on UNDEFINED | 106 | depends on UNDEFINED |
107 | # This option is on purpose disabled for now. | 107 | # This option is on purpose disabled for now. |
108 | # It will be enabled when we are down to a resonable number | 108 | # It will be enabled when we are down to a reasonable number |
109 | # of section mismatch warnings (< 10 for an allyesconfig build) | 109 | # of section mismatch warnings (< 10 for an allyesconfig build) |
110 | help | 110 | help |
111 | The section mismatch analysis checks if there are illegal | 111 | The section mismatch analysis checks if there are illegal |
@@ -298,6 +298,14 @@ config DEBUG_OBJECTS_TIMERS | |||
298 | timer routines to track the life time of timer objects and | 298 | timer routines to track the life time of timer objects and |
299 | validate the timer operations. | 299 | validate the timer operations. |
300 | 300 | ||
301 | config DEBUG_OBJECTS_WORK | ||
302 | bool "Debug work objects" | ||
303 | depends on DEBUG_OBJECTS | ||
304 | help | ||
305 | If you say Y here, additional code will be inserted into the | ||
306 | work queue routines to track the life time of work objects and | ||
307 | validate the work operations. | ||
308 | |||
301 | config DEBUG_OBJECTS_ENABLE_DEFAULT | 309 | config DEBUG_OBJECTS_ENABLE_DEFAULT |
302 | int "debug_objects bootup default value (0-1)" | 310 | int "debug_objects bootup default value (0-1)" |
303 | range 0 1 | 311 | range 0 1 |
diff --git a/lib/decompress_bunzip2.c b/lib/decompress_bunzip2.c index 600f473a5610..76074209f9a2 100644 --- a/lib/decompress_bunzip2.c +++ b/lib/decompress_bunzip2.c | |||
@@ -299,7 +299,7 @@ static int INIT get_next_block(struct bunzip_data *bd) | |||
299 | again when using them (during symbol decoding).*/ | 299 | again when using them (during symbol decoding).*/ |
300 | base = hufGroup->base-1; | 300 | base = hufGroup->base-1; |
301 | limit = hufGroup->limit-1; | 301 | limit = hufGroup->limit-1; |
302 | /* Calculate permute[]. Concurently, initialize | 302 | /* Calculate permute[]. Concurrently, initialize |
303 | * temp[] and limit[]. */ | 303 | * temp[] and limit[]. */ |
304 | pp = 0; | 304 | pp = 0; |
305 | for (i = minLen; i <= maxLen; i++) { | 305 | for (i = minLen; i <= maxLen; i++) { |
diff --git a/lib/dma-debug.c b/lib/dma-debug.c index ce6b7eabf674..d9b08e0f7f55 100644 --- a/lib/dma-debug.c +++ b/lib/dma-debug.c | |||
@@ -259,7 +259,7 @@ static struct dma_debug_entry *hash_bucket_find(struct hash_bucket *bucket, | |||
259 | * times. Without a hardware IOMMU this results in the | 259 | * times. Without a hardware IOMMU this results in the |
260 | * same device addresses being put into the dma-debug | 260 | * same device addresses being put into the dma-debug |
261 | * hash multiple times too. This can result in false | 261 | * hash multiple times too. This can result in false |
262 | * positives being reported. Therfore we implement a | 262 | * positives being reported. Therefore we implement a |
263 | * best-fit algorithm here which returns the entry from | 263 | * best-fit algorithm here which returns the entry from |
264 | * the hash which fits best to the reference value | 264 | * the hash which fits best to the reference value |
265 | * instead of the first-fit. | 265 | * instead of the first-fit. |
@@ -281,7 +281,7 @@ static int idr_get_new_above_int(struct idr *idp, void *ptr, int starting_id) | |||
281 | /** | 281 | /** |
282 | * idr_get_new_above - allocate new idr entry above or equal to a start id | 282 | * idr_get_new_above - allocate new idr entry above or equal to a start id |
283 | * @idp: idr handle | 283 | * @idp: idr handle |
284 | * @ptr: pointer you want associated with the ide | 284 | * @ptr: pointer you want associated with the id |
285 | * @start_id: id to start search at | 285 | * @start_id: id to start search at |
286 | * @id: pointer to the allocated handle | 286 | * @id: pointer to the allocated handle |
287 | * | 287 | * |
@@ -313,7 +313,7 @@ EXPORT_SYMBOL(idr_get_new_above); | |||
313 | /** | 313 | /** |
314 | * idr_get_new - allocate new idr entry | 314 | * idr_get_new - allocate new idr entry |
315 | * @idp: idr handle | 315 | * @idp: idr handle |
316 | * @ptr: pointer you want associated with the ide | 316 | * @ptr: pointer you want associated with the id |
317 | * @id: pointer to the allocated handle | 317 | * @id: pointer to the allocated handle |
318 | * | 318 | * |
319 | * This is the allocate id function. It should be called with any | 319 | * This is the allocate id function. It should be called with any |
diff --git a/lib/swiotlb.c b/lib/swiotlb.c index 795472d8ae24..5bc01803f8f8 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c | |||
@@ -485,7 +485,7 @@ do_unmap_single(struct device *hwdev, char *dma_addr, size_t size, int dir) | |||
485 | 485 | ||
486 | /* | 486 | /* |
487 | * Return the buffer to the free list by setting the corresponding | 487 | * Return the buffer to the free list by setting the corresponding |
488 | * entries to indicate the number of contigous entries available. | 488 | * entries to indicate the number of contiguous entries available. |
489 | * While returning the entries to the free list, we merge the entries | 489 | * While returning the entries to the free list, we merge the entries |
490 | * with slots below and above the pool being returned. | 490 | * with slots below and above the pool being returned. |
491 | */ | 491 | */ |
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 33bed5e67a21..6438cd5599ee 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c | |||
@@ -595,37 +595,89 @@ static char *symbol_string(char *buf, char *end, void *ptr, | |||
595 | } | 595 | } |
596 | 596 | ||
597 | static char *resource_string(char *buf, char *end, struct resource *res, | 597 | static char *resource_string(char *buf, char *end, struct resource *res, |
598 | struct printf_spec spec) | 598 | struct printf_spec spec, const char *fmt) |
599 | { | 599 | { |
600 | #ifndef IO_RSRC_PRINTK_SIZE | 600 | #ifndef IO_RSRC_PRINTK_SIZE |
601 | #define IO_RSRC_PRINTK_SIZE 4 | 601 | #define IO_RSRC_PRINTK_SIZE 6 |
602 | #endif | 602 | #endif |
603 | 603 | ||
604 | #ifndef MEM_RSRC_PRINTK_SIZE | 604 | #ifndef MEM_RSRC_PRINTK_SIZE |
605 | #define MEM_RSRC_PRINTK_SIZE 8 | 605 | #define MEM_RSRC_PRINTK_SIZE 10 |
606 | #endif | 606 | #endif |
607 | struct printf_spec num_spec = { | 607 | struct printf_spec hex_spec = { |
608 | .base = 16, | 608 | .base = 16, |
609 | .precision = -1, | 609 | .precision = -1, |
610 | .flags = SPECIAL | SMALL | ZEROPAD, | 610 | .flags = SPECIAL | SMALL | ZEROPAD, |
611 | }; | 611 | }; |
612 | /* room for the actual numbers, the two "0x", -, [, ] and the final zero */ | 612 | struct printf_spec dec_spec = { |
613 | char sym[4*sizeof(resource_size_t) + 8]; | 613 | .base = 10, |
614 | .precision = -1, | ||
615 | .flags = 0, | ||
616 | }; | ||
617 | struct printf_spec str_spec = { | ||
618 | .field_width = -1, | ||
619 | .precision = 10, | ||
620 | .flags = LEFT, | ||
621 | }; | ||
622 | struct printf_spec flag_spec = { | ||
623 | .base = 16, | ||
624 | .precision = -1, | ||
625 | .flags = SPECIAL | SMALL, | ||
626 | }; | ||
627 | |||
628 | /* 32-bit res (sizeof==4): 10 chars in dec, 10 in hex ("0x" + 8) | ||
629 | * 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) | ||
631 | #define FLAG_BUF_SIZE (2 * sizeof(res->flags)) | ||
632 | #define DECODED_BUF_SIZE sizeof("[mem - 64bit pref disabled]") | ||
633 | #define RAW_BUF_SIZE sizeof("[mem - flags 0x]") | ||
634 | char sym[max(2*RSRC_BUF_SIZE + DECODED_BUF_SIZE, | ||
635 | 2*RSRC_BUF_SIZE + FLAG_BUF_SIZE + RAW_BUF_SIZE)]; | ||
636 | |||
614 | char *p = sym, *pend = sym + sizeof(sym); | 637 | char *p = sym, *pend = sym + sizeof(sym); |
615 | int size = -1; | 638 | int size = -1, addr = 0; |
639 | int decode = (fmt[0] == 'R') ? 1 : 0; | ||
616 | 640 | ||
617 | if (res->flags & IORESOURCE_IO) | 641 | if (res->flags & IORESOURCE_IO) { |
618 | size = IO_RSRC_PRINTK_SIZE; | 642 | size = IO_RSRC_PRINTK_SIZE; |
619 | else if (res->flags & IORESOURCE_MEM) | 643 | addr = 1; |
644 | } else if (res->flags & IORESOURCE_MEM) { | ||
620 | size = MEM_RSRC_PRINTK_SIZE; | 645 | size = MEM_RSRC_PRINTK_SIZE; |
646 | addr = 1; | ||
647 | } | ||
621 | 648 | ||
622 | *p++ = '['; | 649 | *p++ = '['; |
623 | num_spec.field_width = size; | 650 | if (res->flags & IORESOURCE_IO) |
624 | p = number(p, pend, res->start, num_spec); | 651 | p = string(p, pend, "io ", str_spec); |
625 | *p++ = '-'; | 652 | else if (res->flags & IORESOURCE_MEM) |
626 | p = number(p, pend, res->end, num_spec); | 653 | p = string(p, pend, "mem ", str_spec); |
654 | else if (res->flags & IORESOURCE_IRQ) | ||
655 | p = string(p, pend, "irq ", str_spec); | ||
656 | else if (res->flags & IORESOURCE_DMA) | ||
657 | p = string(p, pend, "dma ", str_spec); | ||
658 | else { | ||
659 | p = string(p, pend, "??? ", str_spec); | ||
660 | decode = 0; | ||
661 | } | ||
662 | hex_spec.field_width = size; | ||
663 | p = number(p, pend, res->start, addr ? hex_spec : dec_spec); | ||
664 | if (res->start != res->end) { | ||
665 | *p++ = '-'; | ||
666 | p = number(p, pend, res->end, addr ? hex_spec : dec_spec); | ||
667 | } | ||
668 | if (decode) { | ||
669 | if (res->flags & IORESOURCE_MEM_64) | ||
670 | p = string(p, pend, " 64bit", str_spec); | ||
671 | if (res->flags & IORESOURCE_PREFETCH) | ||
672 | p = string(p, pend, " pref", str_spec); | ||
673 | if (res->flags & IORESOURCE_DISABLED) | ||
674 | p = string(p, pend, " disabled", str_spec); | ||
675 | } else { | ||
676 | p = string(p, pend, " flags ", str_spec); | ||
677 | p = number(p, pend, res->flags, flag_spec); | ||
678 | } | ||
627 | *p++ = ']'; | 679 | *p++ = ']'; |
628 | *p = 0; | 680 | *p = '\0'; |
629 | 681 | ||
630 | return string(buf, end, sym, spec); | 682 | return string(buf, end, sym, spec); |
631 | } | 683 | } |
@@ -801,8 +853,8 @@ static char *ip4_addr_string(char *buf, char *end, const u8 *addr, | |||
801 | * - 'f' For simple symbolic function names without offset | 853 | * - 'f' For simple symbolic function names without offset |
802 | * - 'S' For symbolic direct pointers with offset | 854 | * - 'S' For symbolic direct pointers with offset |
803 | * - 's' For symbolic direct pointers without offset | 855 | * - 's' For symbolic direct pointers without offset |
804 | * - 'R' For a struct resource pointer, it prints the range of | 856 | * - 'R' For decoded struct resource, e.g., [mem 0x0-0x1f 64bit pref] |
805 | * addresses (not the name nor the flags) | 857 | * - 'r' For raw struct resource, e.g., [mem 0x0-0x1f flags 0x201] |
806 | * - 'M' For a 6-byte MAC address, it prints the address in the | 858 | * - 'M' For a 6-byte MAC address, it prints the address in the |
807 | * usual colon-separated hex notation | 859 | * usual colon-separated hex notation |
808 | * - 'm' For a 6-byte MAC address, it prints the hex address without colons | 860 | * - 'm' For a 6-byte MAC address, it prints the hex address without colons |
@@ -833,7 +885,8 @@ static char *pointer(const char *fmt, char *buf, char *end, void *ptr, | |||
833 | case 'S': | 885 | case 'S': |
834 | return symbol_string(buf, end, ptr, spec, *fmt); | 886 | return symbol_string(buf, end, ptr, spec, *fmt); |
835 | case 'R': | 887 | case 'R': |
836 | return resource_string(buf, end, ptr, spec); | 888 | case 'r': |
889 | return resource_string(buf, end, ptr, spec, fmt); | ||
837 | case 'M': /* Colon separated: 00:01:02:03:04:05 */ | 890 | case 'M': /* Colon separated: 00:01:02:03:04:05 */ |
838 | case 'm': /* Contiguous: 000102030405 */ | 891 | case 'm': /* Contiguous: 000102030405 */ |
839 | return mac_address_string(buf, end, ptr, spec, fmt); | 892 | return mac_address_string(buf, end, ptr, spec, fmt); |