From: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
To: Maninder Singh <maninder1.s@samsung.com>,
linux-kernel@vger.kernel.org, shanky.cool1992@gmail.com
Cc: pankaj.m@samsung.com
Subject: Re: [Resend PATCH 1/1] kernel/gcov/fs.c: Use kzalloc for allocating one thing
Date: Mon, 22 Jun 2015 16:13:25 +0200 [thread overview]
Message-ID: <55881805.8040209@linux.vnet.ibm.com> (raw)
In-Reply-To: <1434979459-30970-1-git-send-email-maninder1.s@samsung.com>
On 22.06.2015 15:24, Maninder Singh wrote:
> Use kzalloc rather than kcalloc(1.. for allocation
> of one thing.
>
> Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
> Reviewed-by: Vaneet Narang <v.narang@samsung.com>
> ---
> kernel/gcov/fs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/gcov/fs.c b/kernel/gcov/fs.c
> index edf67c4..b31701a 100644
> --- a/kernel/gcov/fs.c
> +++ b/kernel/gcov/fs.c
> @@ -437,7 +437,7 @@ static struct gcov_node *new_node(struct gcov_node *parent,
> if (!node)
> goto err_nomem;
> if (info) {
> - node->loaded_info = kcalloc(1, sizeof(struct gcov_info *),
> + node->loaded_info = kzalloc(sizeof(struct gcov_info *),
Using kcalloc makes it more obvious to readers that the entity being
allocated is in fact an array, even if it starts out with only one
element. This implicit bit of information would be lost when using
kzalloc. Therefore I'd like to keep the current version for better
readability.
> GFP_KERNEL);
> if (!node->loaded_info)
> goto err_nomem;
>
--
Peter Oberparleiter
Linux on z Systems Development - IBM Germany
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/
prev parent reply other threads:[~2015-06-22 14:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-22 13:24 [Resend PATCH 1/1] kernel/gcov/fs.c: Use kzalloc for allocating one thing Maninder Singh
2015-06-22 14:13 ` Peter Oberparleiter [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=55881805.8040209@linux.vnet.ibm.com \
--to=oberpar@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maninder1.s@samsung.com \
--cc=pankaj.m@samsung.com \
--cc=shanky.cool1992@gmail.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