Skip to content

Commit

Permalink
proc: use "unsigned int" for /proc/*/stack
Browse files Browse the repository at this point in the history
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@avx2
Signed-off-by: Alexey Dobriyan <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Cc: Al Viro <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Alexey Dobriyan authored and torvalds committed Jun 8, 2018
1 parent 197850a commit 5d008fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,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)
Expand All @@ -414,6 +413,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++) {
Expand Down

0 comments on commit 5d008fb

Please sign in to comment.