[PATCH] introduce and use kzalloc
This patch introduces a kzalloc wrapper and converts kernel/ to use it. It saves a little program text. Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
640e803376
commit
dd3927105b
+2
-2
@@ -542,8 +542,8 @@ static void __init kernel_param_sysfs_setup(const char *name,
|
||||
{
|
||||
struct module_kobject *mk;
|
||||
|
||||
mk = kmalloc(sizeof(struct module_kobject), GFP_KERNEL);
|
||||
memset(mk, 0, sizeof(struct module_kobject));
|
||||
mk = kzalloc(sizeof(struct module_kobject), GFP_KERNEL);
|
||||
BUG_ON(!mk);
|
||||
|
||||
mk->mod = THIS_MODULE;
|
||||
kobj_set_kset_s(mk, module_subsys);
|
||||
|
||||
Reference in New Issue
Block a user