提交 a6af8fbf 编写于 作者: N Namhyung Kim 提交者: Steven Rostedt

tracing: Cleanup saved_cmdlines_size changes

The recent addition of saved_cmdlines_size file had some remaining
(minor - mostly coding style) issues.  Fix them by passing pointer
name to sizeof() and using scnprintf().

Link: http://lkml.kernel.org/p/1402384295-23680-1-git-send-email-namhyung@kernel.org

Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
上级 8b8b3683
......@@ -1338,7 +1338,7 @@ static int trace_create_savedcmd(void)
{
int ret;
savedcmd = kmalloc(sizeof(struct saved_cmdlines_buffer), GFP_KERNEL);
savedcmd = kmalloc(sizeof(*savedcmd), GFP_KERNEL);
if (!savedcmd)
return -ENOMEM;
......@@ -3840,7 +3840,7 @@ tracing_saved_cmdlines_size_read(struct file *filp, char __user *ubuf,
int r;
arch_spin_lock(&trace_cmdline_lock);
r = sprintf(buf, "%u\n", savedcmd->cmdline_num);
r = scnprintf(buf, sizeof(buf), "%u\n", savedcmd->cmdline_num);
arch_spin_unlock(&trace_cmdline_lock);
return simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
......@@ -3857,7 +3857,7 @@ static int tracing_resize_saved_cmdlines(unsigned int val)
{
struct saved_cmdlines_buffer *s, *savedcmd_temp;
s = kmalloc(sizeof(struct saved_cmdlines_buffer), GFP_KERNEL);
s = kmalloc(sizeof(*s), GFP_KERNEL);
if (!s)
return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册