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
This commit is contained in:
Andrew Scull 2021-03-18 14:33:09 +00:00 committed by Marc Zyngier
parent 26dbc7e299
commit 5b8be5d875
1 changed files with 3 additions and 3 deletions

View File

@ -130,9 +130,6 @@ static inline struct bug_entry *module_find_bug(unsigned long bugaddr)
void bug_get_file_line(struct bug_entry *bug, const char **file,
unsigned int *line)
{
*file = NULL;
*line = 0;
#ifdef CONFIG_DEBUG_BUGVERBOSE
#ifndef CONFIG_GENERIC_BUG_RELATIVE_POINTERS
*file = bug->file;
@ -140,6 +137,9 @@ void bug_get_file_line(struct bug_entry *bug, const char **file,
*file = (const char *)bug + bug->file_disp;
#endif
*line = bug->line;
#else
*file = NULL;
*line = 0;
#endif
}