aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2014-06-10 03:11:35 -0400
committerSteven Rostedt <rostedt@goodmis.org>2014-06-10 09:51:10 -0400
commita6af8fbf17989e41fef5cacf3988a724fb687d78 (patch)
tree0bd323ac9d8e3c80477a6245fbda708184768fbb /kernel
parent8b8b36834d0fff67fc8668093f4312dd04dcf21d (diff)
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: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 56422f1decba..2b458c60e0da 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1338,7 +1338,7 @@ static int trace_create_savedcmd(void)
1338{ 1338{
1339 int ret; 1339 int ret;
1340 1340
1341 savedcmd = kmalloc(sizeof(struct saved_cmdlines_buffer), GFP_KERNEL); 1341 savedcmd = kmalloc(sizeof(*savedcmd), GFP_KERNEL);
1342 if (!savedcmd) 1342 if (!savedcmd)
1343 return -ENOMEM; 1343 return -ENOMEM;
1344 1344
@@ -3840,7 +3840,7 @@ tracing_saved_cmdlines_size_read(struct file *filp, char __user *ubuf,
3840 int r; 3840 int r;
3841 3841
3842 arch_spin_lock(&trace_cmdline_lock); 3842 arch_spin_lock(&trace_cmdline_lock);
3843 r = sprintf(buf, "%u\n", savedcmd->cmdline_num); 3843 r = scnprintf(buf, sizeof(buf), "%u\n", savedcmd->cmdline_num);
3844 arch_spin_unlock(&trace_cmdline_lock); 3844 arch_spin_unlock(&trace_cmdline_lock);
3845 3845
3846 return simple_read_from_buffer(ubuf, cnt, ppos, buf, r); 3846 return simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
@@ -3857,7 +3857,7 @@ static int tracing_resize_saved_cmdlines(unsigned int val)
3857{ 3857{
3858 struct saved_cmdlines_buffer *s, *savedcmd_temp; 3858 struct saved_cmdlines_buffer *s, *savedcmd_temp;
3859 3859
3860 s = kmalloc(sizeof(struct saved_cmdlines_buffer), GFP_KERNEL); 3860 s = kmalloc(sizeof(*s), GFP_KERNEL);
3861 if (!s) 3861 if (!s)
3862 return -ENOMEM; 3862 return -ENOMEM;
3863 3863