Linux s390 Architecture development
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Jiri Kosina <trivial@kernel.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	linux390@de.ibm.com, linux-s390@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [TRIVIAL PATCH V2 12/26] s390: Convert print_symbol to %pSR
Date: Wed, 12 Dec 2012 17:43:49 -0800	[thread overview]
Message-ID: <1355363029.2164.14.camel@joe-AO722> (raw)
In-Reply-To: <cover.1355335227.git.joe@perches.com>

Use the new vsprintf extension to avoid any possible
message interleaving.

Signed-off-by: Joe Perches <joe@perches.com>
---

V2: Add missing parentheses, remove comma

 arch/s390/kernel/traps.c |   28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index 70ecfc5..f718e12 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -91,8 +91,9 @@ __show_trace(unsigned long sp, unsigned long low, unsigned long high)
 		if (sp < low || sp > high - sizeof(*sf))
 			return sp;
 		sf = (struct stack_frame *) sp;
-		printk("([<%016lx>] ", sf->gprs[8] & PSW_ADDR_INSN);
-		print_symbol("%s)\n", sf->gprs[8] & PSW_ADDR_INSN);
+		printk("([<%016lx>] %pSR)\n",
+		       sf->gprs[8] & PSW_ADDR_INSN,
+		       (void *)(sf->gprs[8] & PSW_ADDR_INSN));
 		/* Follow the backchain. */
 		while (1) {
 			low = sp;
@@ -102,16 +103,18 @@ __show_trace(unsigned long sp, unsigned long low, unsigned long high)
 			if (sp <= low || sp > high - sizeof(*sf))
 				return sp;
 			sf = (struct stack_frame *) sp;
-			printk(" [<%016lx>] ", sf->gprs[8] & PSW_ADDR_INSN);
-			print_symbol("%s\n", sf->gprs[8] & PSW_ADDR_INSN);
+			printk(" [<%016lx>] %pSR\n",
+			       sf->gprs[8] & PSW_ADDR_INSN,
+			       (void *)(sf->gprs[8] & PSW_ADDR_INSN));
 		}
 		/* Zero backchain detected, check for interrupt frame. */
 		sp = (unsigned long) (sf + 1);
 		if (sp <= low || sp > high - sizeof(*regs))
 			return sp;
 		regs = (struct pt_regs *) sp;
-		printk(" [<%016lx>] ", regs->psw.addr & PSW_ADDR_INSN);
-		print_symbol("%s\n", regs->psw.addr & PSW_ADDR_INSN);
+		printk(" [<%016lx>] %pSR\n",
+		       regs->psw.addr & PSW_ADDR_INSN,
+		       (void *)(regs->psw.addr & PSW_ADDR_INSN));
 		low = sp;
 		sp = regs->gprs[15];
 	}
@@ -169,8 +172,9 @@ static void show_last_breaking_event(struct pt_regs *regs)
 {
 #ifdef CONFIG_64BIT
 	printk("Last Breaking-Event-Address:\n");
-	printk(" [<%016lx>] ", regs->args[0] & PSW_ADDR_INSN);
-	print_symbol("%s\n", regs->args[0] & PSW_ADDR_INSN);
+	printk(" [<%016lx>] %pSR\n",
+	       regs->args[0] & PSW_ADDR_INSN,
+	       (void *)(regs->args[0] & PSW_ADDR_INSN));
 #endif
 }
 
@@ -201,10 +205,10 @@ void show_registers(struct pt_regs *regs)
 	char *mode;
 
 	mode = user_mode(regs) ? "User" : "Krnl";
-	printk("%s PSW : %p %p",
-	       mode, (void *) regs->psw.mask,
-	       (void *) regs->psw.addr);
-	print_symbol(" (%s)\n", regs->psw.addr & PSW_ADDR_INSN);
+	printk("%s PSW : %p %p (%pSR)\n",
+	       mode, (void *)regs->psw.mask,
+	       (void *)regs->psw.addr,
+	       (void *)(regs->psw.addr & PSW_ADDR_INSN));
 	printk("           R:%x T:%x IO:%x EX:%x Key:%x M:%x W:%x "
 	       "P:%x AS:%x CC:%x PM:%x", mask_bits(regs, PSW_MASK_PER),
 	       mask_bits(regs, PSW_MASK_DAT), mask_bits(regs, PSW_MASK_IO),
-- 
1.7.8.112.g3fd21

      parent reply	other threads:[~2012-12-13  1:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-12 18:18 [TRIVIAL PATCH 00/26] treewide: Add and use vsprintf extension %pSR Joe Perches
2012-12-12 18:19 ` [TRIVIAL PATCH 12/26] s390: Convert print_symbol to %pSR Joe Perches
2012-12-13  1:22   ` Joe Perches
2012-12-13  1:43 ` Joe Perches [this message]

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=1355363029.2164.14.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux390@de.ibm.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=trivial@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