public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Alexey Dobriyan <adobriyan@gmail.com>
Subject: Re: [PATCH] proc: vmcore - use kzalloc in get_new_element
Date: Mon, 8 Jun 2009 08:53:59 -0400	[thread overview]
Message-ID: <20090608125359.GA3652@redhat.com> (raw)
In-Reply-To: <20090606171207.GC20807@lenovo>

On Sat, Jun 06, 2009 at 09:12:07PM +0400, Cyrill Gorcunov wrote:
> 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)

Acked-by: Vivek Goyal <vgoyal@redhat.com>

Thanks
Vivek


      parent reply	other threads:[~2009-06-08 12:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-06 17:12 [PATCH] proc: vmcore - use kzalloc in get_new_element Cyrill Gorcunov
2009-06-08  1:50 ` Amerigo Wang
2009-06-08 12:53 ` Vivek Goyal [this message]

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=20090608125359.GA3652@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=adobriyan@gmail.com \
    --cc=gorcunov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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