All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Gil Fruchter <gilf@ezchip.com>
To: <rostedt@goodmis.org>, <mingo@redhat.com>
Cc: <linux-kernel@vger.kernel.org>, <giladb@ezchip.com>,
	<cmetcalf@ezchip.com>, <noamc@ezchip.com>,
	Gil Fruchter <gilf@ezchip.com>
Subject: [PATCH 1/2] tracing: Prefer kcalloc over kzalloc with multiply
Date: Tue, 2 Jun 2015 16:26:28 +0300	[thread overview]
Message-ID: <1433251589-21013-2-git-send-email-gilf@ezchip.com> (raw)
In-Reply-To: <1433251589-21013-1-git-send-email-gilf@ezchip.com>

fix checkpatch warning for using kzalloc with multiply:
WARNING: Prefer kcalloc over kzalloc with multiply
+ iter->buffer_iter = kzalloc(sizeof(*iter->buffer_iter)
						* num_possible_cpus(),

Signed-off-by: Gil Fruchter <gilf@ezchip.com>
---
 kernel/trace/trace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 0533049..57ffc4a 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -3034,7 +3034,7 @@ __tracing_open(struct inode *inode, struct file *file, bool snapshot)
 	if (!iter)
 		return ERR_PTR(-ENOMEM);
 
-	iter->buffer_iter = kzalloc(sizeof(*iter->buffer_iter) * num_possible_cpus(),
+	iter->buffer_iter = kcalloc(num_possible_cpus(), sizeof(*iter->buffer_iter),
 				    GFP_KERNEL);
 	if (!iter->buffer_iter)
 		goto release;
-- 
1.7.1


  reply	other threads:[~2015-06-02 13:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-02 13:26 [PATCH 0/2] Fix tracing with non-continuous cpu ids Gil Fruchter
2015-06-02 13:26 ` Gil Fruchter [this message]
2015-06-02 14:15   ` [PATCH 1/2] tracing: Prefer kcalloc over kzalloc with multiply Steven Rostedt
2015-06-03 11:53     ` Gil Fruchter
2015-06-08 15:21       ` Steven Rostedt
2015-06-02 13:26 ` [PATCH 2/2] tracing: Fix for non-continuous cpu ids Gil Fruchter
2015-06-02 14:26   ` Steven Rostedt
2015-06-02 15:47     ` Gilad Ben-Yossef
2015-06-09  7:32 ` [PATCH v2 0/2] Fix tracing with " Gil Fruchter
2015-06-09  7:32 ` [PATCH v2 1/2] tracing: Prefer kcalloc over kzalloc with multiply Gil Fruchter
2015-06-09  7:32 ` [PATCH v2 2/2] tracing: Fix for non-continuous cpu ids Gil Fruchter
2015-07-13 16:12   ` Steven Rostedt
2015-07-14 10:12     ` Gil Fruchter
2015-07-14 13:22       ` Steven Rostedt

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=1433251589-21013-2-git-send-email-gilf@ezchip.com \
    --to=gilf@ezchip.com \
    --cc=cmetcalf@ezchip.com \
    --cc=giladb@ezchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=noamc@ezchip.com \
    --cc=rostedt@goodmis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.