From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Tadeusz Struk <tadeusz.struk@intel.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
Mauro Carvalho Chehab <m.chehab@samsung.com>,
Helge Deller <deller@gmx.de>,
Ingo Tuchscherer <ingo.tuchscherer@de.ibm.com>,
linux390@de.ibm.com, Alexander Viro <viro@zeniv.linux.org.uk>,
qat-linux@intel.com, linux-crypto@vger.kernel.org,
linux-media@vger.kernel.org, linux-s390@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 4/5] parisc: use seq_hex_dump() to dump buffers
Date: Wed, 9 Jul 2014 18:24:29 +0300 [thread overview]
Message-ID: <1404919470-26668-5-git-send-email-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <1404919470-26668-1-git-send-email-andriy.shevchenko@linux.intel.com>
Instead of custom approach let's use recently introduced seq_hex_dump() helper.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/parisc/ccio-dma.c | 14 +++-----------
drivers/parisc/sba_iommu.c | 11 +++--------
2 files changed, 6 insertions(+), 19 deletions(-)
diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c
index 8b490d7..9d353d2 100644
--- a/drivers/parisc/ccio-dma.c
+++ b/drivers/parisc/ccio-dma.c
@@ -1101,20 +1101,12 @@ static const struct file_operations ccio_proc_info_fops = {
static int ccio_proc_bitmap_info(struct seq_file *m, void *p)
{
- int len = 0;
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)
- len += seq_puts(m, "\n ");
- len += seq_printf(m, "%08x", *res_ptr);
- res_ptr++;
- }
- len += 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 1ff1b67..fbc4db9 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -1857,15 +1857,10 @@ 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, len = 0;
- for (i = 0; i < (ioc->res_size/sizeof(unsigned int)); ++i, ++res_ptr) {
- if ((i & 7) == 0)
- len += seq_printf(m, "\n ");
- len += seq_printf(m, " %08x", *res_ptr);
- }
- len += seq_printf(m, "\n");
+ seq_hex_dump(m, " ", DUMP_PREFIX_NONE, 32, 4, ioc->res_map,
+ ioc->res_size, false);
+ seq_printf(m, "\n");
return 0;
}
--
2.0.1
next prev parent reply other threads:[~2014-07-09 15:24 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-09 15:24 [PATCH v1 0/5] fs/seq_file: introduce seq_hex_dump() helper Andy Shevchenko
2014-07-09 15:24 ` [PATCH v1 1/5] seq_file: provide an analogue of print_hex_dump() Andy Shevchenko
2014-07-09 20:39 ` Marek Vasut
2014-07-09 21:21 ` Joe Perches
2014-07-10 7:58 ` Marek Vasut
2014-07-10 9:50 ` Andy Shevchenko
2014-07-10 10:01 ` Joe Perches
2014-07-09 15:24 ` [PATCH v1 2/5] saa7164: convert to seq_hex_dump() Andy Shevchenko
2014-07-09 18:24 ` Steven Toth
2014-07-26 18:12 ` Mauro Carvalho Chehab
2014-07-09 15:24 ` [PATCH v1 3/5] crypto: qat - use seq_hex_dump() to dump buffers Andy Shevchenko
[not found] ` <53BD8A9F.4030409@intel.com>
2014-07-10 11:20 ` Andy Shevchenko
2014-07-09 15:24 ` Andy Shevchenko [this message]
2014-07-09 18:26 ` [PATCH v1 4/5] parisc: " Joe Perches
2014-07-09 20:40 ` Andy Shevchenko
2014-07-09 15:24 ` [PATCH v1 5/5] [S390] zcrypt: " Andy Shevchenko
2014-07-10 9:56 ` Andy Shevchenko
2014-07-09 18:26 ` [PATCH v1 0/5] fs/seq_file: introduce seq_hex_dump() helper Joe Perches
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=1404919470-26668-5-git-send-email-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=deller@gmx.de \
--cc=herbert@gondor.apana.org.au \
--cc=ingo.tuchscherer@de.ibm.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux390@de.ibm.com \
--cc=m.chehab@samsung.com \
--cc=qat-linux@intel.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;
as well as URLs for NNTP newsgroup(s).