From: Cyrill Gorcunov <gorcunov@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>, Vivek Goyal <vgoyal@redhat.com>
Subject: [PATCH] proc: vmcore - use kzalloc in get_new_element
Date: Sat, 6 Jun 2009 21:12:07 +0400 [thread overview]
Message-ID: <20090606171207.GC20807@lenovo> (raw)
Instead of kmalloc+memset better use straight kzalloc
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
---
fs/proc/vmcore.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
Index: linux-2.6.git/fs/proc/vmcore.c
=====================================================================
--- linux-2.6.git.orig/fs/proc/vmcore.c
+++ linux-2.6.git/fs/proc/vmcore.c
@@ -166,12 +166,7 @@ static const struct file_operations proc
static 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)
next reply other threads:[~2009-06-06 17:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-06 17:12 Cyrill Gorcunov [this message]
2009-06-08 1:50 ` [PATCH] proc: vmcore - use kzalloc in get_new_element Amerigo Wang
2009-06-08 12:53 ` Vivek Goyal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090606171207.GC20807@lenovo \
--to=gorcunov@gmail.com \
--cc=adobriyan@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=vgoyal@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox