Skip to content

Commit

Permalink
parisc: use seq_hex_dump() to dump buffers
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Andy Shevchenko <[email protected]>
Acked-by: Helge Deller <[email protected]>
Cc: Alexander Viro <[email protected]>
Cc: Joe Perches <[email protected]>
Cc: Tadeusz Struk <[email protected]>
Cc: Ingo Tuchscherer <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Vladimir Kondratiev <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
andy-shev authored and torvalds committed Sep 10, 2015
1 parent d0cce06 commit b342a65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
13 changes: 3 additions & 10 deletions drivers/parisc/ccio-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
}
Expand Down
9 changes: 2 additions & 7 deletions drivers/parisc/sba_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b342a65

Please sign in to comment.