diff mbox series

[3/7] core/stack: Store PIR in ___backtrace()

Message ID 20190318042900.32558-3-andrew.donnellan@au1.ibm.com
State Accepted
Headers show
Series [1/7] core/stack: Remove r1 argument from ___backtrace() | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (2ba5ce84a197ee61423355f443a3ff3eea185ff1)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Andrew Donnellan March 18, 2019, 4:28 a.m. UTC
In ___backtrace(), store the current PIR in the metadata struct, rather
than relying on the caller to do it.

Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
---
 core/stack.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/core/stack.c b/core/stack.c
index 773d91e34eea..f7eca1ffb0ff 100644
--- a/core/stack.c
+++ b/core/stack.c
@@ -57,6 +57,8 @@  void __nomcount ___backtrace(struct bt_entry *entries, unsigned int max_ents,
 		metadata->token = eframe->gpr[0];
 	else
 		metadata->token = -1UL;
+
+	metadata->pir = mfspr(SPR_PIR);
 }
 
 void ___print_backtrace(struct bt_entry *entries, struct bt_metadata *metadata,
@@ -121,9 +123,7 @@  struct lock bt_lock = LOCK_UNLOCKED;
 
 void backtrace(void)
 {
-	struct bt_metadata metadata = {
-		.pir = mfspr(SPR_PIR),
-	};
+	struct bt_metadata metadata;
 
 	lock(&bt_lock);