linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ed Cashin <ecashin@coraid.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: Re: [patch] aoe: cleanup an allocation a bit
Date: Sat, 8 Sep 2012 20:25:53 -0500	[thread overview]
Message-ID: <F3A3DC24-1380-447B-AA94-A5FADB8D6E43@coraid.com> (raw)
In-Reply-To: <20120908095921.GD608@elgon.mountain>

Looks OK to me, thanks.

On Sep 7, 2012, at 11:59 PM, "Dan Carpenter" <dan.carpenter@oracle.com> wrote:

> We changed this recently so we can just use kzalloc() here instead of
> kcalloc(1, ...).  Kernel style prefers sizeof(*t) over sizeof *t.  The
> kfree(t) is a no-op now as well so that can be removed.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Only applies to linux-next.
> 
> diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
> index 5461faa..c0adbbd 100644
> --- a/drivers/block/aoe/aoecmd.c
> +++ b/drivers/block/aoe/aoecmd.c
> @@ -1255,9 +1255,8 @@ addtgt(struct aoedev *d, char *addr, ulong nframes)
>            "aoe: device addtgt failure; too many targets\n");
>        return NULL;
>    }
> -    t = kcalloc(1, sizeof *t, GFP_ATOMIC);
> +    t = kzalloc(sizeof(*t), GFP_ATOMIC);
>    if (!t) {
> -        kfree(t);
>        printk(KERN_INFO "aoe: cannot allocate memory to add target\n");
>        return NULL;
>    }

      reply	other threads:[~2012-09-09  1:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-08  9:59 [patch] aoe: cleanup an allocation a bit Dan Carpenter
2012-09-09  1:25 ` Ed Cashin [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=F3A3DC24-1380-447B-AA94-A5FADB8D6E43@coraid.com \
    --to=ecashin@coraid.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).