mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Sangjung Woo <sangjung.woo@samsung.com>
Cc: Alessandro Rubini <rubini@gnudd.com>,
	Russell King <rmk+kernel@arm.linux.org.uk>,
	rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rtc: pl030: Use devm_kzalloc() instead of kmalloc()
Date: Tue, 08 Oct 2013 21:07:29 -0700	[thread overview]
Message-ID: <1381291649.2040.1.camel@joe-AO722> (raw)
In-Reply-To: <1381291240-23727-1-git-send-email-sangjung.woo@samsung.com>

On Wed, 2013-10-09 at 13:00 +0900, Sangjung Woo wrote:
> In order to be free automatically and make the cleanup paths more
> simple, use devm_kzalloc() instead of kzalloc().
[]
> diff --git a/drivers/rtc/rtc-pl030.c b/drivers/rtc/rtc-pl030.c
[]
> @@ -106,7 +106,7 @@ static int pl030_probe(struct amba_device *dev, const struct amba_id *id)
>  	if (ret)
>  		goto err_req;
>  
> -	rtc = kmalloc(sizeof(*rtc), GFP_KERNEL);
> +	rtc = devm_kzalloc(&dev->dev, sizeof(*rtc), GFP_KERNEL);

You're not deleting a memset and you're
converting a kmalloc.

Why do you need the zalloc version?


  reply	other threads:[~2013-10-09  4:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-09  4:00 Sangjung Woo
2013-10-09  4:07 ` Joe Perches [this message]
2013-10-09  4:36   ` sangjung.woo
2013-10-09  4:59     ` Joe Perches
2013-10-09  5:32       ` sangjung.woo
2013-10-10 23:06       ` Andrew Morton
2013-10-10 23:14         ` Joe Perches
2013-10-10 23:46           ` Andrew Morton
2013-10-10 23:18         ` Tejun Heo
2013-10-10 23:25           ` Joe Perches

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=1381291649.2040.1.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=rtc-linux@googlegroups.com \
    --cc=rubini@gnudd.com \
    --cc=sangjung.woo@samsung.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

all inboxes | Powered by JetHome®