]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
parisc: use seq_hex_dump() to dump buffers
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 9 Sep 2015 22:38:39 +0000 (15:38 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 10 Sep 2015 20:29:01 +0000 (13:29 -0700)
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 <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>
drivers/parisc/ccio-dma.c
drivers/parisc/sba_iommu.c

index 02ff84fcfa61289f33d7a53f8f1eb16c6b871082..957b42198328f74809cf944ef33a023cb5745b41 100644 (file)
@@ -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 */
        }
index f1441e466c06cd12218d01f6f527c5485a78cdac..225049b492e535f7bf30ac8ef00f110d4647c0c2 100644 (file)
@@ -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;