summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2019-07-22 14:24:41 -0400
committerIngo Molnar <mingo@kernel.org>2019-07-25 09:43:26 -0400
commita2970421640bd9b6a78f2685d7750a791abdfd4e (patch)
treef0c7d294f17f03a2c8df0a8a26f8ef1ca01c8241
parent364f6afc4f5537b79cf454eb35cae92920676075 (diff)
stacktrace: Constify 'entries' arguments
Make it clear to humans and to the compiler that the stack trace ('entries') arguments are not modified. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Waiman Long <longman@redhat.com> Cc: Will Deacon <will.deacon@arm.com> Link: https://lkml.kernel.org/r/20190722182443.216015-3-bvanassche@acm.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--include/linux/stacktrace.h4
-rw-r--r--kernel/stacktrace.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h
index f0cfd12cb45e..83bd8cb475d7 100644
--- a/include/linux/stacktrace.h
+++ b/include/linux/stacktrace.h
@@ -9,9 +9,9 @@ struct task_struct;
9struct pt_regs; 9struct pt_regs;
10 10
11#ifdef CONFIG_STACKTRACE 11#ifdef CONFIG_STACKTRACE
12void stack_trace_print(unsigned long *trace, unsigned int nr_entries, 12void stack_trace_print(const unsigned long *trace, unsigned int nr_entries,
13 int spaces); 13 int spaces);
14int stack_trace_snprint(char *buf, size_t size, unsigned long *entries, 14int stack_trace_snprint(char *buf, size_t size, const unsigned long *entries,
15 unsigned int nr_entries, int spaces); 15 unsigned int nr_entries, int spaces);
16unsigned int stack_trace_save(unsigned long *store, unsigned int size, 16unsigned int stack_trace_save(unsigned long *store, unsigned int size,
17 unsigned int skipnr); 17 unsigned int skipnr);
diff --git a/kernel/stacktrace.c b/kernel/stacktrace.c
index f5440abb7532..6d1f68b7e528 100644
--- a/kernel/stacktrace.c
+++ b/kernel/stacktrace.c
@@ -20,7 +20,7 @@
20 * @nr_entries: Number of entries in the storage array 20 * @nr_entries: Number of entries in the storage array
21 * @spaces: Number of leading spaces to print 21 * @spaces: Number of leading spaces to print
22 */ 22 */
23void stack_trace_print(unsigned long *entries, unsigned int nr_entries, 23void stack_trace_print(const unsigned long *entries, unsigned int nr_entries,
24 int spaces) 24 int spaces)
25{ 25{
26 unsigned int i; 26 unsigned int i;
@@ -43,7 +43,7 @@ EXPORT_SYMBOL_GPL(stack_trace_print);
43 * 43 *
44 * Return: Number of bytes printed. 44 * Return: Number of bytes printed.
45 */ 45 */
46int stack_trace_snprint(char *buf, size_t size, unsigned long *entries, 46int stack_trace_snprint(char *buf, size_t size, const unsigned long *entries,
47 unsigned int nr_entries, int spaces) 47 unsigned int nr_entries, int spaces)
48{ 48{
49 unsigned int generated, i, total = 0; 49 unsigned int generated, i, total = 0;