aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Kconfig.debug4
-rw-r--r--lib/Makefile4
-rw-r--r--lib/bitmap.c4
-rw-r--r--lib/kobject.c13
-rw-r--r--lib/libcrc32c.c7
5 files changed, 23 insertions, 9 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 1e5f207b9074..a60109307d32 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -359,7 +359,7 @@ config DEBUG_HIGHMEM
359config DEBUG_BUGVERBOSE 359config DEBUG_BUGVERBOSE
360 bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EMBEDDED 360 bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EMBEDDED
361 depends on BUG 361 depends on BUG
362 depends on ARM || AVR32 || M32R || M68K || SPARC32 || SPARC64 || FRV || SUPERH || GENERIC_BUG || BFIN 362 depends on ARM || AVR32 || M32R || M68K || SPARC32 || SPARC64 || FRV || SUPERH || GENERIC_BUG || BLACKFIN
363 default !EMBEDDED 363 default !EMBEDDED
364 help 364 help
365 Say Y here to make BUG() panics output the file name and line number 365 Say Y here to make BUG() panics output the file name and line number
@@ -409,7 +409,7 @@ config DEBUG_SG
409 409
410config FRAME_POINTER 410config FRAME_POINTER
411 bool "Compile the kernel with frame pointers" 411 bool "Compile the kernel with frame pointers"
412 depends on DEBUG_KERNEL && (X86 || CRIS || M68K || M68KNOMMU || FRV || UML || S390 || AVR32 || SUPERH || BFIN) 412 depends on DEBUG_KERNEL && (X86 || CRIS || M68K || M68KNOMMU || FRV || UML || S390 || AVR32 || SUPERH || BLACKFIN)
413 default y if DEBUG_INFO && UML 413 default y if DEBUG_INFO && UML
414 help 414 help
415 If you say Y here the resulting kernel image will be slightly larger 415 If you say Y here the resulting kernel image will be slightly larger
diff --git a/lib/Makefile b/lib/Makefile
index 3a0983b77412..b6793ed28d84 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -4,7 +4,7 @@
4 4
5lib-y := ctype.o string.o vsprintf.o cmdline.o \ 5lib-y := ctype.o string.o vsprintf.o cmdline.o \
6 rbtree.o radix-tree.o dump_stack.o \ 6 rbtree.o radix-tree.o dump_stack.o \
7 idr.o int_sqrt.o bitmap.o extable.o prio_tree.o \ 7 idr.o int_sqrt.o extable.o prio_tree.o \
8 sha1.o irq_regs.o reciprocal_div.o argv_split.o \ 8 sha1.o irq_regs.o reciprocal_div.o argv_split.o \
9 proportions.o prio_heap.o 9 proportions.o prio_heap.o
10 10
@@ -14,7 +14,7 @@ lib-$(CONFIG_SMP) += cpumask.o
14lib-y += kobject.o kref.o klist.o 14lib-y += kobject.o kref.o klist.o
15 15
16obj-y += div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \ 16obj-y += div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \
17 bust_spinlocks.o hexdump.o kasprintf.o 17 bust_spinlocks.o hexdump.o kasprintf.o bitmap.o
18 18
19ifeq ($(CONFIG_DEBUG_KOBJECT),y) 19ifeq ($(CONFIG_DEBUG_KOBJECT),y)
20CFLAGS_kobject.o += -DDEBUG 20CFLAGS_kobject.o += -DDEBUG
diff --git a/lib/bitmap.c b/lib/bitmap.c
index 26ebafa8c41d..2c9242e3fed0 100644
--- a/lib/bitmap.c
+++ b/lib/bitmap.c
@@ -469,6 +469,10 @@ int bitmap_scnlistprintf(char *buf, unsigned int buflen,
469 /* current bit is 'cur', most recently seen range is [rbot, rtop] */ 469 /* current bit is 'cur', most recently seen range is [rbot, rtop] */
470 int cur, rbot, rtop; 470 int cur, rbot, rtop;
471 471
472 if (buflen == 0)
473 return 0;
474 buf[0] = 0;
475
472 rbot = cur = find_first_bit(maskp, nmaskbits); 476 rbot = cur = find_first_bit(maskp, nmaskbits);
473 while (cur < nmaskbits) { 477 while (cur < nmaskbits) {
474 rtop = cur; 478 rtop = cur;
diff --git a/lib/kobject.c b/lib/kobject.c
index 03d40360ff1b..a7e3bf4d3c70 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -308,6 +308,19 @@ int kobject_rename(struct kobject * kobj, const char *new_name)
308 if (!kobj->parent) 308 if (!kobj->parent)
309 return -EINVAL; 309 return -EINVAL;
310 310
311 /* see if this name is already in use */
312 if (kobj->kset) {
313 struct kobject *temp_kobj;
314 temp_kobj = kset_find_obj(kobj->kset, new_name);
315 if (temp_kobj) {
316 printk(KERN_WARNING "kobject '%s' can not be renamed "
317 "to '%s' as '%s' is already in existance.\n",
318 kobject_name(kobj), new_name, new_name);
319 kobject_put(temp_kobj);
320 return -EINVAL;
321 }
322 }
323
311 devpath = kobject_get_path(kobj, GFP_KERNEL); 324 devpath = kobject_get_path(kobj, GFP_KERNEL);
312 if (!devpath) { 325 if (!devpath) {
313 error = -ENOMEM; 326 error = -ENOMEM;
diff --git a/lib/libcrc32c.c b/lib/libcrc32c.c
index 802f11f0bf5b..b5c3287d8ea4 100644
--- a/lib/libcrc32c.c
+++ b/lib/libcrc32c.c
@@ -33,7 +33,6 @@
33#include <linux/crc32c.h> 33#include <linux/crc32c.h>
34#include <linux/compiler.h> 34#include <linux/compiler.h>
35#include <linux/module.h> 35#include <linux/module.h>
36#include <asm/byteorder.h>
37 36
38MODULE_AUTHOR("Clay Haapala <chaapala@cisco.com>"); 37MODULE_AUTHOR("Clay Haapala <chaapala@cisco.com>");
39MODULE_DESCRIPTION("CRC32c (Castagnoli) calculations"); 38MODULE_DESCRIPTION("CRC32c (Castagnoli) calculations");
@@ -161,15 +160,13 @@ static const u32 crc32c_table[256] = {
161 */ 160 */
162 161
163u32 __pure 162u32 __pure
164crc32c_le(u32 seed, unsigned char const *data, size_t length) 163crc32c_le(u32 crc, unsigned char const *data, size_t length)
165{ 164{
166 u32 crc = __cpu_to_le32(seed);
167
168 while (length--) 165 while (length--)
169 crc = 166 crc =
170 crc32c_table[(crc ^ *data++) & 0xFFL] ^ (crc >> 8); 167 crc32c_table[(crc ^ *data++) & 0xFFL] ^ (crc >> 8);
171 168
172 return __le32_to_cpu(crc); 169 return crc;
173} 170}
174 171
175#endif /* CRC_LE_BITS == 8 */ 172#endif /* CRC_LE_BITS == 8 */