diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Kconfig | 28 | ||||
-rw-r--r-- | lib/bitmap.c | 3 | ||||
-rw-r--r-- | lib/sha1.c | 2 |
3 files changed, 8 insertions, 25 deletions
diff --git a/lib/Kconfig b/lib/Kconfig index 455833a9e3..eeb429a521 100644 --- a/lib/Kconfig +++ b/lib/Kconfig | |||
@@ -63,32 +63,16 @@ config REED_SOLOMON_ENC16 | |||
63 | config REED_SOLOMON_DEC16 | 63 | config REED_SOLOMON_DEC16 |
64 | boolean | 64 | boolean |
65 | 65 | ||
66 | # | ||
67 | # Textsearch support is select'ed if needed | ||
68 | # | ||
66 | config TEXTSEARCH | 69 | config TEXTSEARCH |
67 | boolean "Textsearch infrastructure" | 70 | boolean |
68 | default y | ||
69 | help | ||
70 | Say Y here if you want to provide a textsearch infrastructure | ||
71 | to other subsystems. | ||
72 | 71 | ||
73 | config TEXTSEARCH_KMP | 72 | config TEXTSEARCH_KMP |
74 | depends on TEXTSEARCH | 73 | tristate |
75 | tristate "Knuth-Morris-Pratt" | ||
76 | help | ||
77 | Say Y here if you want to be able to search text using the | ||
78 | Knuth-Morris-Pratt textsearch algorithm. | ||
79 | |||
80 | To compile this code as a module, choose M here: the | ||
81 | module will be called ts_kmp. | ||
82 | 74 | ||
83 | config TEXTSEARCH_FSM | 75 | config TEXTSEARCH_FSM |
84 | depends on TEXTSEARCH | 76 | tristate |
85 | tristate "Finite state machine" | ||
86 | help | ||
87 | Say Y here if you want to be able to search text using a | ||
88 | naive finite state machine approach implementing a subset | ||
89 | of regular expressions. | ||
90 | |||
91 | To compile this code as a module, choose M here: the | ||
92 | module will be called ts_fsm. | ||
93 | 77 | ||
94 | endmenu | 78 | endmenu |
diff --git a/lib/bitmap.c b/lib/bitmap.c index d1388a5ce8..fb9371fdd4 100644 --- a/lib/bitmap.c +++ b/lib/bitmap.c | |||
@@ -289,7 +289,6 @@ EXPORT_SYMBOL(__bitmap_weight); | |||
289 | 289 | ||
290 | #define CHUNKSZ 32 | 290 | #define CHUNKSZ 32 |
291 | #define nbits_to_hold_value(val) fls(val) | 291 | #define nbits_to_hold_value(val) fls(val) |
292 | #define roundup_power2(val,modulus) (((val) + (modulus) - 1) & ~((modulus) - 1)) | ||
293 | #define unhex(c) (isdigit(c) ? (c - '0') : (toupper(c) - 'A' + 10)) | 292 | #define unhex(c) (isdigit(c) ? (c - '0') : (toupper(c) - 'A' + 10)) |
294 | #define BASEDEC 10 /* fancier cpuset lists input in decimal */ | 293 | #define BASEDEC 10 /* fancier cpuset lists input in decimal */ |
295 | 294 | ||
@@ -316,7 +315,7 @@ int bitmap_scnprintf(char *buf, unsigned int buflen, | |||
316 | if (chunksz == 0) | 315 | if (chunksz == 0) |
317 | chunksz = CHUNKSZ; | 316 | chunksz = CHUNKSZ; |
318 | 317 | ||
319 | i = roundup_power2(nmaskbits, CHUNKSZ) - CHUNKSZ; | 318 | i = ALIGN(nmaskbits, CHUNKSZ) - CHUNKSZ; |
320 | for (; i >= 0; i -= CHUNKSZ) { | 319 | for (; i >= 0; i -= CHUNKSZ) { |
321 | chunkmask = ((1ULL << chunksz) - 1); | 320 | chunkmask = ((1ULL << chunksz) - 1); |
322 | word = i / BITS_PER_LONG; | 321 | word = i / BITS_PER_LONG; |
diff --git a/lib/sha1.c b/lib/sha1.c index 2f7f1148df..1cdabe3065 100644 --- a/lib/sha1.c +++ b/lib/sha1.c | |||
@@ -41,7 +41,7 @@ void sha_transform(__u32 *digest, const char *in, __u32 *W) | |||
41 | __u32 a, b, c, d, e, t, i; | 41 | __u32 a, b, c, d, e, t, i; |
42 | 42 | ||
43 | for (i = 0; i < 16; i++) | 43 | for (i = 0; i < 16; i++) |
44 | W[i] = be32_to_cpu(((const __u32 *)in)[i]); | 44 | W[i] = be32_to_cpu(((const __be32 *)in)[i]); |
45 | 45 | ||
46 | for (i = 0; i < 64; i++) | 46 | for (i = 0; i < 64; i++) |
47 | W[i+16] = rol32(W[i+13] ^ W[i+8] ^ W[i+2] ^ W[i], 1); | 47 | W[i+16] = rol32(W[i+13] ^ W[i+8] ^ W[i+2] ^ W[i], 1); |