* [PATCH] trace: code optimization @ 2020-01-10 0:57 ` liuyang34 0 siblings, 0 replies; 6+ messages in thread From: liuyang34 @ 2020-01-09 9:12 UTC (permalink / raw) To: Steven Rostedt, Ingo Molnar, linux-kernel; +Cc: liuyang34 use scnprintf instead of snprinr and no need to check the return size again Signed-off-by: liuyang34 <liuyang34@xiaomi.com> --- kernel/trace/trace_stack.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c index c557f42..7b15e9a 100644 --- a/kernel/trace/trace_stack.c +++ b/kernel/trace/trace_stack.c @@ -329,9 +329,7 @@ stack_max_size_read(struct file *filp, char __user *ubuf, char buf[64]; int r; - r = snprintf(buf, sizeof(buf), "%ld\n", *ptr); - if (r > sizeof(buf)) - r = sizeof(buf); + r = scnprintf(buf, sizeof(buf), "%ld\n", *ptr); return simple_read_from_buffer(ubuf, count, ppos, buf, r); } -- 2.7.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [RESEND PATCH] trace: code optimization @ 2020-01-10 0:57 ` liuyang34 0 siblings, 0 replies; 6+ messages in thread From: liuyang34 @ 2020-01-10 0:57 UTC (permalink / raw) To: Steven Rostedt, Ingo Molnar, linux-kernel; +Cc: liuyang34 use scnprintf instead of snprintf and no need to check the return size again Signed-off-by: liuyang <liuyang34@xiaomi.com> --- kernel/trace/trace_stack.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c index c557f42..7b15e9a 100644 --- a/kernel/trace/trace_stack.c +++ b/kernel/trace/trace_stack.c @@ -329,9 +329,7 @@ stack_max_size_read(struct file *filp, char __user *ubuf, char buf[64]; int r; - r = snprintf(buf, sizeof(buf), "%ld\n", *ptr); - if (r > sizeof(buf)) - r = sizeof(buf); + r = scnprintf(buf, sizeof(buf), "%ld\n", *ptr); return simple_read_from_buffer(ubuf, count, ppos, buf, r); } -- 2.7.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] trace: code optimization 2020-01-10 0:57 ` [RESEND PATCH] " liuyang34 @ 2020-01-09 13:16 ` Markus Elfring -1 siblings, 0 replies; 6+ messages in thread From: Markus Elfring @ 2020-01-09 13:16 UTC (permalink / raw) To: yangliuxm34, kernel-janitors Cc: linux-kernel, liuyang34, Ingo Molnar, Steven Rostedt > use scnprintf instead of snprinr and no need to check Will a typo be avoided in the final change description? > Signed-off-by: liuyang34 … Will this information need also an adjustment for the desired specification of a real name? https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=b07f636fca1c8fbba124b0082487c0b3890a0e0c#n458 Regards, Markus ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] trace: code optimization @ 2020-01-09 13:16 ` Markus Elfring 0 siblings, 0 replies; 6+ messages in thread From: Markus Elfring @ 2020-01-09 13:16 UTC (permalink / raw) To: yangliuxm34, kernel-janitors Cc: linux-kernel, liuyang34, Ingo Molnar, Steven Rostedt > use scnprintf instead of snprinr and no need to check Will a typo be avoided in the final change description? > Signed-off-by: liuyang34 … Will this information need also an adjustment for the desired specification of a real name? https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=b07f636fca1c8fbba124b0082487c0b3890a0e0c#n458 Regards, Markus ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] trace: code optimization 2020-01-09 13:16 ` Markus Elfring @ 2020-01-09 14:32 ` Steven Rostedt -1 siblings, 0 replies; 6+ messages in thread From: Steven Rostedt @ 2020-01-09 14:32 UTC (permalink / raw) To: Markus Elfring Cc: yangliuxm34, kernel-janitors, linux-kernel, liuyang34, Ingo Molnar On Thu, 9 Jan 2020 14:16:46 +0100 Markus Elfring <Markus.Elfring@web.de> wrote: > > use scnprintf instead of snprinr and no need to check > > Will a typo be avoided in the final change description? > > > > Signed-off-by: liuyang34 … > > Will this information need also an adjustment for the desired specification > of a real name? > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=b07f636fca1c8fbba124b0082487c0b3890a0e0c#n458 > Correct. Please resend the patch with the typo fix and a real name for the Signed-off-by. Thanks! -- Steve ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] trace: code optimization @ 2020-01-09 14:32 ` Steven Rostedt 0 siblings, 0 replies; 6+ messages in thread From: Steven Rostedt @ 2020-01-09 14:32 UTC (permalink / raw) To: Markus Elfring Cc: yangliuxm34, kernel-janitors, linux-kernel, liuyang34, Ingo Molnar On Thu, 9 Jan 2020 14:16:46 +0100 Markus Elfring <Markus.Elfring@web.de> wrote: > > use scnprintf instead of snprinr and no need to check > > Will a typo be avoided in the final change description? > > > > Signed-off-by: liuyang34 … > > Will this information need also an adjustment for the desired specification > of a real name? > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id°7f636fca1c8fbba124b0082487c0b3890a0e0c#n458 > Correct. Please resend the patch with the typo fix and a real name for the Signed-off-by. Thanks! -- Steve ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-01-10 0:57 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <cover.1578561009.git.liuyang34@xiaomi.com> 2020-01-09 9:12 ` [PATCH] trace: code optimization liuyang34 2020-01-10 0:57 ` [RESEND PATCH] " liuyang34 2020-01-09 13:16 ` [PATCH] " Markus Elfring 2020-01-09 13:16 ` Markus Elfring 2020-01-09 14:32 ` Steven Rostedt 2020-01-09 14:32 ` Steven Rostedt
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.