From: Andrew Morton Cc: Dave Hansen Cc: Greg KH Signed-off-by: Andrew Morton --- arch/i386/kernel/vmlinux.lds.S | 2 - lib/kobject.c | 43 ------------------------------- 2 files changed, 45 deletions(-) diff -puN arch/i386/kernel/vmlinux.lds.S~revert-gregkh-driver-warn-when-statically-allocated-kobjects-are-used arch/i386/kernel/vmlinux.lds.S --- a/arch/i386/kernel/vmlinux.lds.S~revert-gregkh-driver-warn-when-statically-allocated-kobjects-are-used +++ a/arch/i386/kernel/vmlinux.lds.S @@ -71,8 +71,6 @@ SECTIONS __tracedata_end = .; } - _sdata = .; /* End of text section */ - RODATA /* writeable */ diff -puN lib/kobject.c~revert-gregkh-driver-warn-when-statically-allocated-kobjects-are-used lib/kobject.c --- a/lib/kobject.c~revert-gregkh-driver-warn-when-statically-allocated-kobjects-are-used +++ a/lib/kobject.c @@ -15,8 +15,6 @@ #include #include #include -#include -#include /** * populate_dir - populate directory with attributes. @@ -123,46 +121,6 @@ char *kobject_get_path(struct kobject *k } EXPORT_SYMBOL_GPL(kobject_get_path); -#ifdef CONFIG_X86_32 -static int ptr_in_range(void *ptr, void *start, void *end) -{ - /* - * This should hopefully get rid of causing warnings - * if the architecture did not set one of the section - * variables up. - */ - if (start >= end) - return 0; - - if ((ptr >= start) && (ptr < end)) - return 1; - return 0; -} - -static void verify_dynamic_kobject_allocation(struct kobject *kobj) -{ - if (ptr_in_range(kobj, &_sdata[0], &_edata[0])) - goto warn; - if (ptr_in_range(kobj, &__bss_start[0], &__bss_stop[0])) - goto warn; - return; -warn: - pr_debug("---- begin silly warning ----\n"); - pr_debug("This is a janitorial warning, not a kernel bug.\n"); -#ifdef CONFIG_DEBUG_KOBJECT - print_symbol("The kobject at, or inside %s is not dynamically allocated.\n", - (unsigned long)kobj); -#endif - pr_debug("kobjects must be dynamically allocated, not static\n"); - /* dump_stack(); */ - pr_debug("---- end silly warning ----\n"); -} -#else -static void verify_dynamic_kobject_allocation(struct kobject *kobj) -{ -} -#endif - /** * kobject_init - initialize object. * @kobj: object in question. @@ -172,7 +130,6 @@ void kobject_init(struct kobject * kobj) if (!kobj) return; WARN_ON(atomic_read(&kobj->kref.refcount)); - verify_dynamic_kobject_allocation(kobj); kref_init(&kobj->kref); INIT_LIST_HEAD(&kobj->entry); init_waitqueue_head(&kobj->poll); _