lkml.org 
[lkml]   [2015]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] tracing: Prefer kcalloc over kzalloc with multiply
Date
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


\
 
 \ /
  Last update: 2015-06-02 16:01    [W:0.140 / U:0.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site