From: Andrew Scull <ascull@google.com>
To: kvmarm@lists.cs.columbia.edu
Cc: kernel-team@android.com, Peter Zijlstra <peterz@infradead.org>,
maz@kernel.org, "Steven Rostedt \(VMware\)" <rostedt@goodmis.org>,
catalin.marinas@arm.com, will@kernel.org
Subject: [PATCH v3 3/5] bug: Assign values once in bug_get_file_line()
Date: Thu, 18 Mar 2021 14:33:09 +0000 [thread overview]
Message-ID: <20210318143311.839894-4-ascull@google.com> (raw)
In-Reply-To: <20210318143311.839894-1-ascull@google.com>
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>
---
lib/bug.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/bug.c b/lib/bug.c
index e65398082cbc..45a0584f6541 100644
--- a/lib/bug.c
+++ b/lib/bug.c
@@ -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
}
--
2.31.0.rc2.261.g7f71774620-goog
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
next prev parent reply other threads:[~2021-03-18 14:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-18 14:33 [PATCH v3 0/5] Debug info for nVHE hyp panics Andrew Scull
2021-03-18 14:33 ` [PATCH v3 1/5] bug: Remove redundant condition check in report_bug Andrew Scull
2021-03-18 15:17 ` Will Deacon
2021-03-18 14:33 ` [PATCH v3 2/5] bug: Factor out a getter for a bug's file line Andrew Scull
2021-03-18 15:19 ` Will Deacon
2021-03-18 14:33 ` Andrew Scull [this message]
2021-03-18 15:22 ` [PATCH v3 3/5] bug: Assign values once in bug_get_file_line() Will Deacon
2021-03-18 14:33 ` [PATCH v3 4/5] KVM: arm64: Use BUG and BUG_ON in nVHE hyp Andrew Scull
2021-03-18 15:25 ` Will Deacon
2021-03-18 14:33 ` [PATCH v3 5/5] KVM: arm64: Log source when panicking from " Andrew Scull
2021-03-18 16:59 ` Will Deacon
2021-03-19 9:51 ` Marc Zyngier
2021-03-19 9:59 ` Andrew Scull
2021-03-19 10:38 ` Andrew Scull
2021-03-19 10:42 ` Marc Zyngier
2021-04-01 9:26 ` [PATCH v3 0/5] Debug info for nVHE hyp panics Marc Zyngier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210318143311.839894-4-ascull@google.com \
--to=ascull@google.com \
--cc=catalin.marinas@arm.com \
--cc=kernel-team@android.com \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=maz@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox