LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] proc: use "unsigned int" for /proc/*/stack
@ 2018-04-23 21:52 Alexey Dobriyan
0 siblings, 0 replies; only message in thread
From: Alexey Dobriyan @ 2018-04-23 21:52 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel
struct stack_trace::nr_entries is defined as "unsigned int" (YAY!)
so the iterator should be unsigned as well.
It saves 1 byte of code or something like that.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
fs/proc/base.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -430,7 +430,6 @@ static int proc_pid_stack(struct seq_file *m, struct pid_namespace *ns,
struct stack_trace trace;
unsigned long *entries;
int err;
- int i;
entries = kmalloc(MAX_STACK_TRACE_DEPTH * sizeof(*entries), GFP_KERNEL);
if (!entries)
@@ -443,6 +442,8 @@ static int proc_pid_stack(struct seq_file *m, struct pid_namespace *ns,
err = lock_trace(task);
if (!err) {
+ unsigned int i;
+
save_stack_trace_tsk(task, &trace);
for (i = 0; i < trace.nr_entries; i++) {
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-04-23 21:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-23 21:52 [PATCH] proc: use "unsigned int" for /proc/*/stack Alexey Dobriyan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).