Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1214146 > unrolled thread

[PATCH v2] s390/jump_label: Use %*ph to print small buffers

Started byAlexander Kuleshov <kuleshovmail@gmail.com>
First post2015-08-26 21:20 +0200
Last post2015-08-27 09:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2] s390/jump_label: Use %*ph to print small buffers Alexander Kuleshov <kuleshovmail@gmail.com> - 2015-08-26 21:20 +0200
    Re: [PATCH v2] s390/jump_label: Use %*ph to print small buffers Martin Schwidefsky <schwidefsky@de.ibm.com> - 2015-08-27 09:40 +0200

#1214146 — [PATCH v2] s390/jump_label: Use %*ph to print small buffers

FromAlexander Kuleshov <kuleshovmail@gmail.com>
Date2015-08-26 21:20 +0200
Subject[PATCH v2] s390/jump_label: Use %*ph to print small buffers
Message-ID<q1OoP-6rk-39@gated-at.bofh.it>
printk() supports %*ph format specifier for printing a small buffers,
let's use it intead of %02x %02x...

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 arch/s390/kernel/jump_label.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/s390/kernel/jump_label.c b/arch/s390/kernel/jump_label.c
index a902996..1f615f3 100644
--- a/arch/s390/kernel/jump_label.c
+++ b/arch/s390/kernel/jump_label.c
@@ -44,12 +44,9 @@ static void jump_label_bug(struct jump_entry *entry, struct insn *expected,
 	unsigned char *ipn = (unsigned char *)new;
 
 	pr_emerg("Jump label code mismatch at %pS [%p]\n", ipc, ipc);
-	pr_emerg("Found:    %02x %02x %02x %02x %02x %02x\n",
-		 ipc[0], ipc[1], ipc[2], ipc[3], ipc[4], ipc[5]);
-	pr_emerg("Expected: %02x %02x %02x %02x %02x %02x\n",
-		 ipe[0], ipe[1], ipe[2], ipe[3], ipe[4], ipe[5]);
-	pr_emerg("New:      %02x %02x %02x %02x %02x %02x\n",
-		 ipn[0], ipn[1], ipn[2], ipn[3], ipn[4], ipn[5]);
+	pr_emerg("Found:    %6ph\n", ipc);
+	pr_emerg("Expected: %6ph\n", ipe);
+	pr_emerg("New:      %6ph\n", ipn);
 	panic("Corrupted kernel text");
 }
 
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1214366

FromMartin Schwidefsky <schwidefsky@de.ibm.com>
Date2015-08-27 09:40 +0200
Message-ID<q1ZWV-6e9-3@gated-at.bofh.it>
In reply to#1214146
On Thu, 27 Aug 2015 01:17:46 +0600
Alexander Kuleshov <kuleshovmail@gmail.com> wrote:

> printk() supports %*ph format specifier for printing a small buffers,
> let's use it intead of %02x %02x...
> 
> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
> ---
>  arch/s390/kernel/jump_label.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/s390/kernel/jump_label.c b/arch/s390/kernel/jump_label.c
> index a902996..1f615f3 100644
> --- a/arch/s390/kernel/jump_label.c
> +++ b/arch/s390/kernel/jump_label.c
> @@ -44,12 +44,9 @@ static void jump_label_bug(struct jump_entry *entry, struct insn *expected,
>  	unsigned char *ipn = (unsigned char *)new;
> 
>  	pr_emerg("Jump label code mismatch at %pS [%p]\n", ipc, ipc);
> -	pr_emerg("Found:    %02x %02x %02x %02x %02x %02x\n",
> -		 ipc[0], ipc[1], ipc[2], ipc[3], ipc[4], ipc[5]);
> -	pr_emerg("Expected: %02x %02x %02x %02x %02x %02x\n",
> -		 ipe[0], ipe[1], ipe[2], ipe[3], ipe[4], ipe[5]);
> -	pr_emerg("New:      %02x %02x %02x %02x %02x %02x\n",
> -		 ipn[0], ipn[1], ipn[2], ipn[3], ipn[4], ipn[5]);
> +	pr_emerg("Found:    %6ph\n", ipc);
> +	pr_emerg("Expected: %6ph\n", ipe);
> +	pr_emerg("New:      %6ph\n", ipn);
>  	panic("Corrupted kernel text");
>  }
 
Nice. Applied to the s390 features branch. Thanks.

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web