[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1433835155-6894-2-git-send-email-gilf@ezchip.com>
Date: Tue, 9 Jun 2015 10:32:34 +0300
From: Gil Fruchter <gilf@...hip.com>
To: <rostedt@...dmis.org>, <mingo@...hat.com>
CC: <linux-kernel@...r.kernel.org>, <giladb@...hip.com>,
<cmetcalf@...hip.com>, <noamc@...hip.com>,
Gil Fruchter <gilf@...hip.com>
Subject: [PATCH v2 1/2] tracing: Prefer kcalloc over kzalloc with multiply
Use kcalloc for allocating an array instead of kzalloc with multiply,
as that is what kcalloc is used for.
Found with checkpatch.
Signed-off-by: Gil Fruchter <gilf@...hip.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists