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

bug: Assign values once in bug_get_file_line()

Set bug_get_file_line()'s output parameter values directly rather than
first nullifying them and then conditionally setting new values.

Signed-off-by: Andrew Scull <ascull@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210318143311.839894-4-ascull@google.com

authored by

Andrew Scull and committed by
Marc Zyngier
5b8be5d8 26dbc7e2

+3 -3
+3 -3
lib/bug.c
··· 130 130 void bug_get_file_line(struct bug_entry *bug, const char **file, 131 131 unsigned int *line) 132 132 { 133 - *file = NULL; 134 - *line = 0; 135 - 136 133 #ifdef CONFIG_DEBUG_BUGVERBOSE 137 134 #ifndef CONFIG_GENERIC_BUG_RELATIVE_POINTERS 138 135 *file = bug->file; ··· 137 140 *file = (const char *)bug + bug->file_disp; 138 141 #endif 139 142 *line = bug->line; 143 + #else 144 + *file = NULL; 145 + *line = 0; 140 146 #endif 141 147 } 142 148