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


Groups > linux.kernel > #1178751

[PATCH v5 4/6] [S390] zcrypt: use seq_hex_dump() to dump buffers

From Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Newsgroups linux.kernel
Subject [PATCH v5 4/6] [S390] zcrypt: use seq_hex_dump() to dump buffers
Date 2015-07-07 19:10 +0200
Message-ID <pJExC-8or-41@gated-at.bofh.it> (permalink)
References <pJExz-8or-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Instead of custom approach let's use recently introduced seq_hex_dump() helper.

Acked-by: Ingo Tuchscherer <ingo.tuchscherer@de.ibm.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/s390/crypto/zcrypt_api.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c
index 01bf1f5..4eb4554 100644
--- a/drivers/s390/crypto/zcrypt_api.c
+++ b/drivers/s390/crypto/zcrypt_api.c
@@ -1206,16 +1206,8 @@ static void sprinthx(unsigned char *title, struct seq_file *m,
 static void sprinthx4(unsigned char *title, struct seq_file *m,
 		      unsigned int *array, unsigned int len)
 {
-	int r;
-
 	seq_printf(m, "\n%s\n", title);
-	for (r = 0; r < len; r++) {
-		if ((r % 8) == 0)
-			seq_printf(m, "    ");
-		seq_printf(m, "%08X ", array[r]);
-		if ((r % 8) == 7)
-			seq_putc(m, '\n');
-	}
+	seq_hex_dump(m, "    ", DUMP_PREFIX_NONE, 32, 4, array, len, false);
 	seq_putc(m, '\n');
 }
 
-- 
2.1.4

--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5 0/6] fs/seq_file: introduce seq_hex_dump() helper Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2015-07-07 19:10 +0200
  [PATCH v5 4/6] [S390] zcrypt: use seq_hex_dump() to dump buffers Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2015-07-07 19:10 +0200
  [PATCH v5 2/6] crypto: qat - use seq_hex_dump() to dump buffers Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2015-07-07 19:10 +0200

csiph-web