Commit a2970421 authored by Bart Van Assche's avatar Bart Van Assche Committed by Ingo Molnar

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: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarPeter 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.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 364f6afc
...@@ -9,9 +9,9 @@ struct task_struct; ...@@ -9,9 +9,9 @@ struct task_struct;
struct pt_regs; struct pt_regs;
#ifdef CONFIG_STACKTRACE #ifdef CONFIG_STACKTRACE
void stack_trace_print(unsigned long *trace, unsigned int nr_entries, void stack_trace_print(const unsigned long *trace, unsigned int nr_entries,
int spaces); int spaces);
int stack_trace_snprint(char *buf, size_t size, unsigned long *entries, int stack_trace_snprint(char *buf, size_t size, const unsigned long *entries,
unsigned int nr_entries, int spaces); unsigned int nr_entries, int spaces);
unsigned int stack_trace_save(unsigned long *store, unsigned int size, unsigned int stack_trace_save(unsigned long *store, unsigned int size,
unsigned int skipnr); unsigned int skipnr);
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* @nr_entries: Number of entries in the storage array * @nr_entries: Number of entries in the storage array
* @spaces: Number of leading spaces to print * @spaces: Number of leading spaces to print
*/ */
void stack_trace_print(unsigned long *entries, unsigned int nr_entries, void stack_trace_print(const unsigned long *entries, unsigned int nr_entries,
int spaces) int spaces)
{ {
unsigned int i; unsigned int i;
...@@ -43,7 +43,7 @@ EXPORT_SYMBOL_GPL(stack_trace_print); ...@@ -43,7 +43,7 @@ EXPORT_SYMBOL_GPL(stack_trace_print);
* *
* Return: Number of bytes printed. * Return: Number of bytes printed.
*/ */
int stack_trace_snprint(char *buf, size_t size, unsigned long *entries, int stack_trace_snprint(char *buf, size_t size, const unsigned long *entries,
unsigned int nr_entries, int spaces) unsigned int nr_entries, int spaces)
{ {
unsigned int generated, i, total = 0; unsigned int generated, i, total = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment