Skip to content

Commit b342a65

Browse files
andy-shevtorvalds
authored andcommitted
parisc: use seq_hex_dump() to dump buffers
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 4444444 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. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Helge Deller <deller@gmx.de> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: Joe Perches <joe@perches.com> Cc: Tadeusz Struk <tadeusz.struk@intel.com> Cc: Ingo Tuchscherer <ingo.tuchscherer@de.ibm.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent d0cce06 commit b342a65

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

drivers/parisc/ccio-dma.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,16 +1103,9 @@ static int ccio_proc_bitmap_info(struct seq_file *m, void *p)
11031103
struct ioc *ioc = ioc_list;
11041104

11051105
while (ioc != NULL) {
1106-
u32 *res_ptr = (u32 *)ioc->res_map;
1107-
int j;
1108-
1109-
for (j = 0; j < (ioc->res_size / sizeof(u32)); j++) {
1110-
if ((j & 7) == 0)
1111-
seq_puts(m, "\n ");
1112-
seq_printf(m, "%08x", *res_ptr);
1113-
res_ptr++;
1114-
}
1115-
seq_puts(m, "\n\n");
1106+
seq_hex_dump(m, " ", DUMP_PREFIX_NONE, 32, 4, ioc->res_map,
1107+
ioc->res_size, false);
1108+
seq_putc(m, '\n');
11161109
ioc = ioc->next;
11171110
break; /* XXX - remove me */
11181111
}

drivers/parisc/sba_iommu.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,14 +1854,9 @@ sba_proc_bitmap_info(struct seq_file *m, void *p)
18541854
{
18551855
struct sba_device *sba_dev = sba_list;
18561856
struct ioc *ioc = &sba_dev->ioc[0]; /* FIXME: Multi-IOC support! */
1857-
unsigned int *res_ptr = (unsigned int *)ioc->res_map;
1858-
int i;
18591857

1860-
for (i = 0; i < (ioc->res_size/sizeof(unsigned int)); ++i, ++res_ptr) {
1861-
if ((i & 7) == 0)
1862-
seq_puts(m, "\n ");
1863-
seq_printf(m, " %08x", *res_ptr);
1864-
}
1858+
seq_hex_dump(m, " ", DUMP_PREFIX_NONE, 32, 4, ioc->res_map,
1859+
ioc->res_size, false);
18651860
seq_putc(m, '\n');
18661861

18671862
return 0;

0 commit comments

Comments
 (0)