From 088e2b0f58e2b6f08da4a683083240765ae09bf4 Mon Sep 17 00:00:00 2001 From: Andrew Scull Date: Thu, 18 Mar 2021 14:33:09 +0000 Subject: [PATCH] UPSTREAM: 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 Cc: Peter Zijlstra Cc: "Steven Rostedt (VMware)" Acked-by: Will Deacon Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210318143311.839894-4-ascull@google.com (cherry picked from commit 5b8be5d875a996776708ba174fcd08c8bcd721a5) Signed-off-by: Will Deacon Bug: 190594147 Change-Id: I95a8b2c98645b647a96adf0e183def8599764b46 --- lib/bug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/bug.c b/lib/bug.c index df9f2ca1319e..e55c1d7e6f60 100644 --- a/lib/bug.c +++ b/lib/bug.c @@ -135,9 +135,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; @@ -145,6 +142,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 }