X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=kernel%2Fintermodule.c;h=55b1e5b85db97fef9b361ba86daee3dab0211f7f;hb=7172c64a7cee4dfa95864f49c914f7ea8cf497c8;hp=09f556507f57cc450519fd26652f08fb86f70651;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/kernel/intermodule.c b/kernel/intermodule.c index 09f556507..55b1e5b85 100644 --- a/kernel/intermodule.c +++ b/kernel/intermodule.c @@ -14,7 +14,7 @@ */ static struct list_head ime_list = LIST_HEAD_INIT(ime_list); -static spinlock_t ime_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(ime_lock); static int kmalloc_failed; struct inter_module_entry { @@ -39,7 +39,7 @@ void inter_module_register(const char *im_name, struct module *owner, const void struct list_head *tmp; struct inter_module_entry *ime, *ime_new; - if (!(ime_new = kmalloc(sizeof(*ime), GFP_KERNEL))) { + if (!(ime_new = kzalloc(sizeof(*ime), GFP_KERNEL))) { /* Overloaded kernel, not fatal */ printk(KERN_ERR "Aiee, inter_module_register: cannot kmalloc entry for '%s'\n", @@ -47,7 +47,6 @@ void inter_module_register(const char *im_name, struct module *owner, const void kmalloc_failed = 1; return; } - memset(ime_new, 0, sizeof(*ime_new)); ime_new->im_name = im_name; ime_new->owner = owner; ime_new->userdata = userdata; @@ -113,7 +112,7 @@ void inter_module_unregister(const char *im_name) * Try to increment the use count on the owning module, if that fails * then return NULL. Otherwise return the userdata. */ -const void *inter_module_get(const char *im_name) +static const void *inter_module_get(const char *im_name) { struct list_head *tmp; struct inter_module_entry *ime; @@ -178,6 +177,8 @@ void inter_module_put(const char *im_name) EXPORT_SYMBOL(inter_module_register); EXPORT_SYMBOL(inter_module_unregister); -EXPORT_SYMBOL(inter_module_get); EXPORT_SYMBOL(inter_module_get_request); EXPORT_SYMBOL(inter_module_put); + +MODULE_LICENSE("GPL"); +