diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Kconfig.debug | 6 | ||||
-rw-r--r-- | lib/bitmap.c | 2 | ||||
-rw-r--r-- | lib/btree.c | 4 | ||||
-rw-r--r-- | lib/decompress_unxz.c | 2 | ||||
-rw-r--r-- | lib/kstrtox.c | 9 | ||||
-rw-r--r-- | lib/parser.c | 2 | ||||
-rw-r--r-- | lib/test-kstrtox.c | 32 | ||||
-rw-r--r-- | lib/timerqueue.c | 2 |
8 files changed, 27 insertions, 32 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index df9234c5f9d1..c768bcdda1b7 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -434,11 +434,9 @@ config DEBUG_KMEMLEAK_EARLY_LOG_SIZE | |||
434 | 434 | ||
435 | config DEBUG_KMEMLEAK_TEST | 435 | config DEBUG_KMEMLEAK_TEST |
436 | tristate "Simple test for the kernel memory leak detector" | 436 | tristate "Simple test for the kernel memory leak detector" |
437 | depends on DEBUG_KMEMLEAK | 437 | depends on DEBUG_KMEMLEAK && m |
438 | help | 438 | help |
439 | Say Y or M here to build a test for the kernel memory leak | 439 | This option enables a module that explicitly leaks memory. |
440 | detector. This option enables a module that explicitly leaks | ||
441 | memory. | ||
442 | 440 | ||
443 | If unsure, say N. | 441 | If unsure, say N. |
444 | 442 | ||
diff --git a/lib/bitmap.c b/lib/bitmap.c index 741fae905ae3..91e0ccfdb424 100644 --- a/lib/bitmap.c +++ b/lib/bitmap.c | |||
@@ -830,7 +830,7 @@ EXPORT_SYMBOL(bitmap_bitremap); | |||
830 | * @orig (i.e. bits 3, 5, 7 and 9) were also set. | 830 | * @orig (i.e. bits 3, 5, 7 and 9) were also set. |
831 | * | 831 | * |
832 | * When bit 11 is set in @orig, it means turn on the bit in | 832 | * When bit 11 is set in @orig, it means turn on the bit in |
833 | * @dst corresponding to whatever is the twelth bit that is | 833 | * @dst corresponding to whatever is the twelfth bit that is |
834 | * turned on in @relmap. In the above example, there were | 834 | * turned on in @relmap. In the above example, there were |
835 | * only ten bits turned on in @relmap (30..39), so that bit | 835 | * only ten bits turned on in @relmap (30..39), so that bit |
836 | * 11 was set in @orig had no affect on @dst. | 836 | * 11 was set in @orig had no affect on @dst. |
diff --git a/lib/btree.c b/lib/btree.c index c9c6f0351526..2a34392bcecc 100644 --- a/lib/btree.c +++ b/lib/btree.c | |||
@@ -11,7 +11,7 @@ | |||
11 | * see http://programming.kicks-ass.net/kernel-patches/vma_lookup/btree.patch | 11 | * see http://programming.kicks-ass.net/kernel-patches/vma_lookup/btree.patch |
12 | * | 12 | * |
13 | * A relatively simple B+Tree implementation. I have written it as a learning | 13 | * A relatively simple B+Tree implementation. I have written it as a learning |
14 | * excercise to understand how B+Trees work. Turned out to be useful as well. | 14 | * exercise to understand how B+Trees work. Turned out to be useful as well. |
15 | * | 15 | * |
16 | * B+Trees can be used similar to Linux radix trees (which don't have anything | 16 | * B+Trees can be used similar to Linux radix trees (which don't have anything |
17 | * in common with textbook radix trees, beware). Prerequisite for them working | 17 | * in common with textbook radix trees, beware). Prerequisite for them working |
@@ -541,7 +541,7 @@ static void rebalance(struct btree_head *head, struct btree_geo *geo, | |||
541 | int i, no_left, no_right; | 541 | int i, no_left, no_right; |
542 | 542 | ||
543 | if (fill == 0) { | 543 | if (fill == 0) { |
544 | /* Because we don't steal entries from a neigbour, this case | 544 | /* Because we don't steal entries from a neighbour, this case |
545 | * can happen. Parent node contains a single child, this | 545 | * can happen. Parent node contains a single child, this |
546 | * node, so merging with a sibling never happens. | 546 | * node, so merging with a sibling never happens. |
547 | */ | 547 | */ |
diff --git a/lib/decompress_unxz.c b/lib/decompress_unxz.c index cecd23df2b9a..9f34eb56854d 100644 --- a/lib/decompress_unxz.c +++ b/lib/decompress_unxz.c | |||
@@ -83,7 +83,7 @@ | |||
83 | * safety_margin = 128 + uncompressed_size * 8 / 32768 + 65536 | 83 | * safety_margin = 128 + uncompressed_size * 8 / 32768 + 65536 |
84 | * = 128 + (uncompressed_size >> 12) + 65536 | 84 | * = 128 + (uncompressed_size >> 12) + 65536 |
85 | * | 85 | * |
86 | * For comparision, according to arch/x86/boot/compressed/misc.c, the | 86 | * For comparison, according to arch/x86/boot/compressed/misc.c, the |
87 | * equivalent formula for Deflate is this: | 87 | * equivalent formula for Deflate is this: |
88 | * | 88 | * |
89 | * safety_margin = 18 + (uncompressed_size >> 12) + 32768 | 89 | * safety_margin = 18 + (uncompressed_size >> 12) + 32768 |
diff --git a/lib/kstrtox.c b/lib/kstrtox.c index 05672e819f8c..a235f3cc471c 100644 --- a/lib/kstrtox.c +++ b/lib/kstrtox.c | |||
@@ -49,12 +49,9 @@ static int _kstrtoull(const char *s, unsigned int base, unsigned long long *res) | |||
49 | val = *s - '0'; | 49 | val = *s - '0'; |
50 | else if ('a' <= _tolower(*s) && _tolower(*s) <= 'f') | 50 | else if ('a' <= _tolower(*s) && _tolower(*s) <= 'f') |
51 | val = _tolower(*s) - 'a' + 10; | 51 | val = _tolower(*s) - 'a' + 10; |
52 | else if (*s == '\n') { | 52 | else if (*s == '\n' && *(s + 1) == '\0') |
53 | if (*(s + 1) == '\0') | 53 | break; |
54 | break; | 54 | else |
55 | else | ||
56 | return -EINVAL; | ||
57 | } else | ||
58 | return -EINVAL; | 55 | return -EINVAL; |
59 | 56 | ||
60 | if (val >= base) | 57 | if (val >= base) |
diff --git a/lib/parser.c b/lib/parser.c index 6e89eca5cca0..dcbaaef6cf11 100644 --- a/lib/parser.c +++ b/lib/parser.c | |||
@@ -13,7 +13,7 @@ | |||
13 | 13 | ||
14 | /** | 14 | /** |
15 | * match_one: - Determines if a string matches a simple pattern | 15 | * match_one: - Determines if a string matches a simple pattern |
16 | * @s: the string to examine for presense of the pattern | 16 | * @s: the string to examine for presence of the pattern |
17 | * @p: the string containing the pattern | 17 | * @p: the string containing the pattern |
18 | * @args: array of %MAX_OPT_ARGS &substring_t elements. Used to return match | 18 | * @args: array of %MAX_OPT_ARGS &substring_t elements. Used to return match |
19 | * locations. | 19 | * locations. |
diff --git a/lib/test-kstrtox.c b/lib/test-kstrtox.c index 325c2f9ecebd..d55769d63cb8 100644 --- a/lib/test-kstrtox.c +++ b/lib/test-kstrtox.c | |||
@@ -315,12 +315,12 @@ static void __init test_kstrtou64_ok(void) | |||
315 | {"65537", 10, 65537}, | 315 | {"65537", 10, 65537}, |
316 | {"2147483646", 10, 2147483646}, | 316 | {"2147483646", 10, 2147483646}, |
317 | {"2147483647", 10, 2147483647}, | 317 | {"2147483647", 10, 2147483647}, |
318 | {"2147483648", 10, 2147483648}, | 318 | {"2147483648", 10, 2147483648ULL}, |
319 | {"2147483649", 10, 2147483649}, | 319 | {"2147483649", 10, 2147483649ULL}, |
320 | {"4294967294", 10, 4294967294}, | 320 | {"4294967294", 10, 4294967294ULL}, |
321 | {"4294967295", 10, 4294967295}, | 321 | {"4294967295", 10, 4294967295ULL}, |
322 | {"4294967296", 10, 4294967296}, | 322 | {"4294967296", 10, 4294967296ULL}, |
323 | {"4294967297", 10, 4294967297}, | 323 | {"4294967297", 10, 4294967297ULL}, |
324 | {"9223372036854775806", 10, 9223372036854775806ULL}, | 324 | {"9223372036854775806", 10, 9223372036854775806ULL}, |
325 | {"9223372036854775807", 10, 9223372036854775807ULL}, | 325 | {"9223372036854775807", 10, 9223372036854775807ULL}, |
326 | {"9223372036854775808", 10, 9223372036854775808ULL}, | 326 | {"9223372036854775808", 10, 9223372036854775808ULL}, |
@@ -369,12 +369,12 @@ static void __init test_kstrtos64_ok(void) | |||
369 | {"65537", 10, 65537}, | 369 | {"65537", 10, 65537}, |
370 | {"2147483646", 10, 2147483646}, | 370 | {"2147483646", 10, 2147483646}, |
371 | {"2147483647", 10, 2147483647}, | 371 | {"2147483647", 10, 2147483647}, |
372 | {"2147483648", 10, 2147483648}, | 372 | {"2147483648", 10, 2147483648LL}, |
373 | {"2147483649", 10, 2147483649}, | 373 | {"2147483649", 10, 2147483649LL}, |
374 | {"4294967294", 10, 4294967294}, | 374 | {"4294967294", 10, 4294967294LL}, |
375 | {"4294967295", 10, 4294967295}, | 375 | {"4294967295", 10, 4294967295LL}, |
376 | {"4294967296", 10, 4294967296}, | 376 | {"4294967296", 10, 4294967296LL}, |
377 | {"4294967297", 10, 4294967297}, | 377 | {"4294967297", 10, 4294967297LL}, |
378 | {"9223372036854775806", 10, 9223372036854775806LL}, | 378 | {"9223372036854775806", 10, 9223372036854775806LL}, |
379 | {"9223372036854775807", 10, 9223372036854775807LL}, | 379 | {"9223372036854775807", 10, 9223372036854775807LL}, |
380 | }; | 380 | }; |
@@ -418,10 +418,10 @@ static void __init test_kstrtou32_ok(void) | |||
418 | {"65537", 10, 65537}, | 418 | {"65537", 10, 65537}, |
419 | {"2147483646", 10, 2147483646}, | 419 | {"2147483646", 10, 2147483646}, |
420 | {"2147483647", 10, 2147483647}, | 420 | {"2147483647", 10, 2147483647}, |
421 | {"2147483648", 10, 2147483648}, | 421 | {"2147483648", 10, 2147483648U}, |
422 | {"2147483649", 10, 2147483649}, | 422 | {"2147483649", 10, 2147483649U}, |
423 | {"4294967294", 10, 4294967294}, | 423 | {"4294967294", 10, 4294967294U}, |
424 | {"4294967295", 10, 4294967295}, | 424 | {"4294967295", 10, 4294967295U}, |
425 | }; | 425 | }; |
426 | TEST_OK(kstrtou32, u32, "%u", test_u32_ok); | 426 | TEST_OK(kstrtou32, u32, "%u", test_u32_ok); |
427 | } | 427 | } |
diff --git a/lib/timerqueue.c b/lib/timerqueue.c index e3a1050e6820..191176a43e9a 100644 --- a/lib/timerqueue.c +++ b/lib/timerqueue.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * Uses rbtrees for quick list adds and expiration. | 5 | * Uses rbtrees for quick list adds and expiration. |
6 | * | 6 | * |
7 | * NOTE: All of the following functions need to be serialized | 7 | * NOTE: All of the following functions need to be serialized |
8 | * to avoid races. No locking is done by this libary code. | 8 | * to avoid races. No locking is done by this library code. |
9 | * | 9 | * |
10 | * This program is free software; you can redistribute it and/or modify | 10 | * This program is free software; you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License as published by | 11 | * it under the terms of the GNU General Public License as published by |