提交 5d008fb4 编写于 作者: A Alexey Dobriyan 提交者: Linus Torvalds

proc: use "unsigned int" for /proc/*/stack

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.

Link: http://lkml.kernel.org/r/20180423215248.GG9043@avx2Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
Reviewed-by: NAndrew Morton <akpm@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 197850a1
...@@ -401,7 +401,6 @@ static int proc_pid_stack(struct seq_file *m, struct pid_namespace *ns, ...@@ -401,7 +401,6 @@ static int proc_pid_stack(struct seq_file *m, struct pid_namespace *ns,
struct stack_trace trace; struct stack_trace trace;
unsigned long *entries; unsigned long *entries;
int err; int err;
int i;
entries = kmalloc(MAX_STACK_TRACE_DEPTH * sizeof(*entries), GFP_KERNEL); entries = kmalloc(MAX_STACK_TRACE_DEPTH * sizeof(*entries), GFP_KERNEL);
if (!entries) if (!entries)
...@@ -414,6 +413,8 @@ static int proc_pid_stack(struct seq_file *m, struct pid_namespace *ns, ...@@ -414,6 +413,8 @@ static int proc_pid_stack(struct seq_file *m, struct pid_namespace *ns,
err = lock_trace(task); err = lock_trace(task);
if (!err) { if (!err) {
unsigned int i;
save_stack_trace_tsk(task, &trace); save_stack_trace_tsk(task, &trace);
for (i = 0; i < trace.nr_entries; i++) { for (i = 0; i < trace.nr_entries; i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册