History

stacktrace: Constify 'entries' arguments

Make it clear to humans and to the compiler that the stack trace ('entries') arguments are not modified.

Bart Van Assche committed 7 years ago

Commit a2970421 parent 364f6af2 files · +4 −4Browse files

Showing the changes to kernel/stacktrace.c (1 of 2 files). Show all

Unified · Split

kernel/stacktrace.c+2−2
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 * @nr_entries: Number of entries in the storage array
2121 * @spaces: Number of leading spaces to print
2222 */
23−void stack_trace_print(unsigned long *entries, unsigned int nr_entries,
23+void stack_trace_print(const unsigned long *entries, unsigned int nr_entries,
2424 int spaces)
2525 {
2626 unsigned int i;
@@ -43,7 +43,7 @@ EXPORT_SYMBOL_GPL(stack_trace_print); · 16 unmodified lines
4343 *
4444 * Return: Number of bytes printed.
4545 */
46−int stack_trace_snprint(char *buf, size_t size, unsigned long *entries,
46+int stack_trace_snprint(char *buf, size_t size, const unsigned long *entries,
4747 unsigned int nr_entries, int spaces)
4848 {
4949 unsigned int generated, i, total = 0;