proc: vmcore - use kzalloc in get_new_element
Subsystems (2)
PATCH 1/1 proc: vmcore - use kzalloc in get_new_element
Instead of kmalloc+memset better use straight kzalloc
--- fs/proc/vmcore.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
fs/proc/vmcore.c +1 -6
@@ -166,12 +166,7 @@ static const struct file_operations procstatic struct vmcore *__init get_new_element (void ) { -struct vmcore *p; - - p =kmalloc (sizeof (*p),GFP_KERNEL ); -if (p) -memset (p,0 ,sizeof (*p)); -return p; +return kzalloc (sizeof (struct vmcore ),GFP_KERNEL ); }static u64 __init get_vmcore_size_elf64 (char *elfptr)
Quoted 3 lines · Cyrill Gorcunov
Instead of kmalloc+memset better use straight kzalloc
Signed-off-by Cyrill Gorcunov <[email protected]>
Looks good!
Quoted 27 lines
---
fs/proc/vmcore.c| 7 +------1 file changed, 1 insertion(+), 6 deletions(-)Index:
linux-2.6.git/fs/proc/vmcore.c
=====================================================================fs/proc/vmcore.c +1
-7@@ -166,12 +166,7 @@ static const struct file_operations procstatic struct vmcore *__init get_new_element (void ) { -struct vmcore *p; - - p =kmalloc (sizeof (*p),GFP_KERNEL ); -if (p) -memset (p,0 ,sizeof (*p)); -return p; +return kzalloc (sizeof (struct vmcore ),GFP_KERNEL ); }static u64 __init get_vmcore_size_elf64 (char *elfptr) --To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Quoted 15 lines · Cyrill Gorcunov
Instead of kmalloc+memset better use straight kzalloc
Signed-off-by Cyrill Gorcunov <[email protected]>--- fs/proc/vmcore.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)Index:
linux-2.6.git/fs/proc/vmcore.c
=====================================================================fs/proc/vmcore.c +0
-0@@ -166,12 +166,7 @@ static const struct file_operations procstatic struct vmcore *__init get_new_element (void ) {
fs/proc/vmcore.c static const struct file_operations proc · line 172
Quoted 10 lines
fs/proc/vmcore.c +1
-6-struct vmcore *p; - - p =kmalloc (sizeof (*p),GFP_KERNEL ); -if (p) -memset (p,0 ,sizeof (*p)); -return p; +return kzalloc (sizeof (struct vmcore ),GFP_KERNEL ); }static u64 __init get_vmcore_size_elf64 (char *elfptr)
Thanks
Vivek