projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
197850a
)
proc: use "unsigned int" for /proc/*/stack
author
Alexey Dobriyan
<
[email protected]
>
Fri, 8 Jun 2018 00:10:17 +0000
(17:10 -0700)
committer
Linus Torvalds
<
[email protected]
>
Fri, 8 Jun 2018 00:34:38 +0000
(17:34 -0700)
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]
>
fs/proc/base.c
patch
|
blob
|
history
diff --git
a/fs/proc/base.c
b/fs/proc/base.c
index 720205aa1e34732de915e1045191666f05f9a577..44dec22e5e9e61e2f6b90befec5a5355ac6676f9 100644
(file)
--- a/
fs/proc/base.c
+++ b/
fs/proc/base.c
@@
-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)
@@
-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++) {