public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] s390/jump_label: Use %*ph to print small buffers
@ 2015-08-26 18:49 Alexander Kuleshov
  2015-08-26 19:03 ` Tillmann Heidsieck
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Kuleshov @ 2015-08-26 18:49 UTC (permalink / raw)
  To: Martin Schwidefsky, Heiko Carstens
  Cc: linux390, linux-s390, linux-kernel, Alexander Kuleshov

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 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/s390/kernel/jump_label.c b/arch/s390/kernel/jump_label.c
index a902996..cdf7c9e 100644
--- a/arch/s390/kernel/jump_label.c
+++ b/arch/s390/kernel/jump_label.c
@@ -44,11 +44,11 @@ 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",
+	pr_emerg("Found:    %6ph\n",
 		 ipc[0], ipc[1], ipc[2], ipc[3], ipc[4], ipc[5]);
-	pr_emerg("Expected: %02x %02x %02x %02x %02x %02x\n",
+	pr_emerg("Expected: %6ph\n",
 		 ipe[0], ipe[1], ipe[2], ipe[3], ipe[4], ipe[5]);
-	pr_emerg("New:      %02x %02x %02x %02x %02x %02x\n",
+	pr_emerg("New:      %6ph\n",
 		 ipn[0], ipn[1], ipn[2], ipn[3], ipn[4], ipn[5]);
 	panic("Corrupted kernel text");
 }
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] s390/jump_label: Use %*ph to print small buffers
  2015-08-26 18:49 [PATCH] s390/jump_label: Use %*ph to print small buffers Alexander Kuleshov
@ 2015-08-26 19:03 ` Tillmann Heidsieck
  2015-08-26 19:12   ` Alexander Kuleshov
  0 siblings, 1 reply; 3+ messages in thread
From: Tillmann Heidsieck @ 2015-08-26 19:03 UTC (permalink / raw)
  To: Alexander Kuleshov
  Cc: Martin Schwidefsky, Heiko Carstens, linux390, linux-s390,
	linux-kernel, linux-kernel-owner

Hi Alexander,

On 2015-08-26 20:49, Alexander Kuleshov wrote:
> printk() supports %*ph format specifier for printing a small buffers,
> let's use it intead of %02x %02x...

noble effort ...

>  	pr_emerg("Jump label code mismatch at %pS [%p]\n", ipc, ipc);
> -	pr_emerg("Found:    %02x %02x %02x %02x %02x %02x\n",
> +	pr_emerg("Found:    %6ph\n",
>  		 ipc[0], ipc[1], ipc[2], ipc[3], ipc[4], ipc[5]);
> -	pr_emerg("Expected: %02x %02x %02x %02x %02x %02x\n",
> +	pr_emerg("Expected: %6ph\n",
>  		 ipe[0], ipe[1], ipe[2], ipe[3], ipe[4], ipe[5]);
> -	pr_emerg("New:      %02x %02x %02x %02x %02x %02x\n",
> +	pr_emerg("New:      %6ph\n",
>  		 ipn[0], ipn[1], ipn[2], ipn[3], ipn[4], ipn[5]);
>  	panic("Corrupted kernel text");
>  }

... but you might want to check our code before submission (e.g. compile 
it!)

Cheers
Tillmann

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] s390/jump_label: Use %*ph to print small buffers
  2015-08-26 19:03 ` Tillmann Heidsieck
@ 2015-08-26 19:12   ` Alexander Kuleshov
  0 siblings, 0 replies; 3+ messages in thread
From: Alexander Kuleshov @ 2015-08-26 19:12 UTC (permalink / raw)
  To: Tillmann Heidsieck
  Cc: Martin Schwidefsky, Heiko Carstens, linux390, linux-s390, LKML,
	linux-kernel-owner

Hello Tillmann, sorry for noise, will resend.

2015-08-27 1:03 GMT+06:00 Tillmann Heidsieck <theidsieck@leenox.de>:
> Hi Alexander,
>
> On 2015-08-26 20:49, Alexander Kuleshov wrote:
>>
>> printk() supports %*ph format specifier for printing a small buffers,
>> let's use it intead of %02x %02x...
>
>
> noble effort ...
>
>>         pr_emerg("Jump label code mismatch at %pS [%p]\n", ipc, ipc);
>> -       pr_emerg("Found:    %02x %02x %02x %02x %02x %02x\n",
>> +       pr_emerg("Found:    %6ph\n",
>>                  ipc[0], ipc[1], ipc[2], ipc[3], ipc[4], ipc[5]);
>> -       pr_emerg("Expected: %02x %02x %02x %02x %02x %02x\n",
>> +       pr_emerg("Expected: %6ph\n",
>>                  ipe[0], ipe[1], ipe[2], ipe[3], ipe[4], ipe[5]);
>> -       pr_emerg("New:      %02x %02x %02x %02x %02x %02x\n",
>> +       pr_emerg("New:      %6ph\n",
>>                  ipn[0], ipn[1], ipn[2], ipn[3], ipn[4], ipn[5]);
>>         panic("Corrupted kernel text");
>>  }
>
>
> ... but you might want to check our code before submission (e.g. compile
> it!)
>
> Cheers
> Tillmann

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-26 19:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-26 18:49 [PATCH] s390/jump_label: Use %*ph to print small buffers Alexander Kuleshov
2015-08-26 19:03 ` Tillmann Heidsieck
2015-08-26 19:12   ` Alexander Kuleshov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox