Skip to content

Commit 5d008fb

Browse files
Alexey Dobriyantorvalds
authored andcommitted
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@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]>
1 parent 197850a commit 5d008fb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/proc/base.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ static int proc_pid_stack(struct seq_file *m, struct pid_namespace *ns,
401401
struct stack_trace trace;
402402
unsigned long *entries;
403403
int err;
404-
int i;
405404

406405
entries = kmalloc(MAX_STACK_TRACE_DEPTH * sizeof(*entries), GFP_KERNEL);
407406
if (!entries)
@@ -414,6 +413,8 @@ static int proc_pid_stack(struct seq_file *m, struct pid_namespace *ns,
414413

415414
err = lock_trace(task);
416415
if (!err) {
416+
unsigned int i;
417+
417418
save_stack_trace_tsk(task, &trace);
418419

419420
for (i = 0; i < trace.nr_entries; i++) {

0 commit comments

Comments
 (0)