Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1178743
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Andy Shevchenko <andriy.shevchenko@linux.intel.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH v5 3/6] parisc: use seq_hex_dump() to dump buffers |
| Date | Tue, 07 Jul 2015 19:10:02 +0200 |
| Message-ID | <pJExA-8or-17@gated-at.bofh.it> (permalink) |
| References | <pJExz-8or-9@gated-at.bofh.it> |
| X-Original-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> |
| X-Extloop1 | 1 |
| X-Ironport-Av | E=Sophos;i="5.15,424,1432623600"; d="scan'208";a="759976523" |
| X-Mailer | git-send-email 2.1.4 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 70 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Andy Shevchenko <andriy.shevchenko@linux.intel.com> |
| X-Original-Date | Tue, 7 Jul 2015 20:04:49 +0300 |
| X-Original-Message-ID | <1436288692-18445-4-git-send-email-andriy.shevchenko@linux.intel.com> |
| X-Original-References | <1436288692-18445-1-git-send-email-andriy.shevchenko@linux.intel.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | aioe.org linux.kernel:1178743 |
Show key headers only | View raw
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
--
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 | Next | Find similar | Unroll thread
[PATCH v5 3/6] parisc: use seq_hex_dump() to dump buffers Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2015-07-07 19:10 +0200
csiph-web