Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <adobriyan@gmail.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Alexey Dobriyan and committed by
Linus Torvalds
5d008fb4 197850a1

+2 -1
+2 -1
fs/proc/base.c
··· 401 401 struct stack_trace trace; 402 402 unsigned long *entries; 403 403 int err; 404 - int i; 405 404 406 405 entries = kmalloc(MAX_STACK_TRACE_DEPTH * sizeof(*entries), GFP_KERNEL); 407 406 if (!entries) ··· 413 414 414 415 err = lock_trace(task); 415 416 if (!err) { 417 + unsigned int i; 418 + 416 419 save_stack_trace_tsk(task, &trace); 417 420 418 421 for (i = 0; i < trace.nr_entries; i++) {