From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
linux-kernel@vger.kernel.org, Joe Perches <joe@perches.com>,
Andrew Morton <akpm@linux-foundation.org>,
Tadeusz Struk <tadeusz.struk@intel.com>,
Helge Deller <deller@gmx.de>,
Ingo Tuchscherer <ingo.tuchscherer@de.ibm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v5 3/6] parisc: use seq_hex_dump() to dump buffers
Date: Tue, 7 Jul 2015 20:04:49 +0300 [thread overview]
Message-ID: <1436288692-18445-4-git-send-email-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <1436288692-18445-1-git-send-email-andriy.shevchenko@linux.intel.com>
Instead of custom approach let's use recently introduced seq_hex_dump() helper.
In one case it changes the output from
1111111122222222333333334444444455555555666666667777777788888888
to
11111111 22222222 33333333 44444444 55555555 66666666 77777777 88888888
though it seems it prints same data (by meaning) in both cases. I decide to
choose to use the space divided one.
Acked-by: Helge Deller <deller@gmx.de>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/parisc/ccio-dma.c | 13 +++----------
drivers/parisc/sba_iommu.c | 9 ++-------
2 files changed, 5 insertions(+), 17 deletions(-)
diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c
index 02ff84f..957b421 100644
--- a/drivers/parisc/ccio-dma.c
+++ b/drivers/parisc/ccio-dma.c
@@ -1103,16 +1103,9 @@ static int ccio_proc_bitmap_info(struct seq_file *m, void *p)
struct ioc *ioc = ioc_list;
while (ioc != NULL) {
- u32 *res_ptr = (u32 *)ioc->res_map;
- int j;
-
- for (j = 0; j < (ioc->res_size / sizeof(u32)); j++) {
- if ((j & 7) == 0)
- seq_puts(m, "\n ");
- seq_printf(m, "%08x", *res_ptr);
- res_ptr++;
- }
- seq_puts(m, "\n\n");
+ seq_hex_dump(m, " ", DUMP_PREFIX_NONE, 32, 4, ioc->res_map,
+ ioc->res_size, false);
+ seq_putc(m, '\n');
ioc = ioc->next;
break; /* XXX - remove me */
}
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index f1441e4..225049b 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -1854,14 +1854,9 @@ sba_proc_bitmap_info(struct seq_file *m, void *p)
{
struct sba_device *sba_dev = sba_list;
struct ioc *ioc = &sba_dev->ioc[0]; /* FIXME: Multi-IOC support! */
- unsigned int *res_ptr = (unsigned int *)ioc->res_map;
- int i;
- for (i = 0; i < (ioc->res_size/sizeof(unsigned int)); ++i, ++res_ptr) {
- if ((i & 7) == 0)
- seq_puts(m, "\n ");
- seq_printf(m, " %08x", *res_ptr);
- }
+ seq_hex_dump(m, " ", DUMP_PREFIX_NONE, 32, 4, ioc->res_map,
+ ioc->res_size, false);
seq_putc(m, '\n');
return 0;
--
2.1.4
next prev parent reply other threads:[~2015-07-07 17:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-07 17:04 [PATCH v5 0/6] fs/seq_file: introduce seq_hex_dump() helper Andy Shevchenko
2015-07-07 17:04 ` [PATCH v5 1/6] seq_file: provide an analogue of print_hex_dump() Andy Shevchenko
2015-07-07 17:04 ` [PATCH v5 2/6] crypto: qat - use seq_hex_dump() to dump buffers Andy Shevchenko
2015-07-07 17:04 ` Andy Shevchenko [this message]
2015-07-07 17:04 ` [PATCH v5 4/6] [S390] zcrypt: " Andy Shevchenko
2015-07-07 17:04 ` [PATCH v5 5/6] kmemleak: " Andy Shevchenko
2015-07-08 9:20 ` Catalin Marinas
2015-07-07 17:04 ` [PATCH v5 6/6] wil6210: " Andy Shevchenko
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=1436288692-18445-4-git-send-email-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=catalin.marinas@arm.com \
--cc=deller@gmx.de \
--cc=ingo.tuchscherer@de.ibm.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=qca_vkondrat@qca.qualcomm.com \
--cc=tadeusz.struk@intel.com \
--cc=viro@zeniv.linux.org.uk \
/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