The patch titled Subject: drivers/net/wireless/ath/wil6210: use seq_hex_dump() to dump buffers has been added to the -mm tree. Its filename is wil6210-use-seq_hex_dump-to-dump-buffers.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/wil6210-use-seq_hex_dump-to-dump-buffers.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/wil6210-use-seq_hex_dump-to-dump-buffers.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> Subject: drivers/net/wireless/ath/wil6210: use seq_hex_dump() to dump buffers Instead of custom approach let's use recently introduced seq_hex_dump() helper. Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> Cc: Alexander Viro <viro@xxxxxxxxxxxxxxxxxx> Cc: Joe Perches <joe@xxxxxxxxxxx> Cc: Tadeusz Struk <tadeusz.struk@xxxxxxxxx> Cc: Helge Deller <deller@xxxxxx> Cc: Ingo Tuchscherer <ingo.tuchscherer@xxxxxxxxxx> Cc: Catalin Marinas <catalin.marinas@xxxxxxx> Cc: Vladimir Kondratiev <qca_vkondrat@xxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/net/wireless/ath/wil6210/debugfs.c | 35 +++---------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff -puN drivers/net/wireless/ath/wil6210/debugfs.c~wil6210-use-seq_hex_dump-to-dump-buffers drivers/net/wireless/ath/wil6210/debugfs.c --- a/drivers/net/wireless/ath/wil6210/debugfs.c~wil6210-use-seq_hex_dump-to-dump-buffers +++ a/drivers/net/wireless/ath/wil6210/debugfs.c @@ -156,6 +156,12 @@ static const struct file_operations fops .llseek = seq_lseek, }; +static void wil_seq_hexdump(struct seq_file *s, void *p, int len, + const char *prefix) +{ + seq_hex_dump(s, prefix, DUMP_PREFIX_NONE, 16, 1, p, len, false); +} + static void wil_print_ring(struct seq_file *s, const char *prefix, void __iomem *off) { @@ -212,8 +218,6 @@ static void wil_print_ring(struct seq_fi le16_to_cpu(hdr.seq), len, le16_to_cpu(hdr.type), hdr.flags); if (len <= MAX_MBOXITEM_SIZE) { - int n = 0; - char printbuf[16 * 3 + 2]; unsigned char databuf[MAX_MBOXITEM_SIZE]; void __iomem *src = wmi_buffer(wil, d.addr) + sizeof(struct wil6210_mbox_hdr); @@ -223,16 +227,7 @@ static void wil_print_ring(struct seq_fi * reading header */ wil_memcpy_fromio_32(databuf, src, len); - while (n < len) { - int l = min(len - n, 16); - - hex_dump_to_buffer(databuf + n, l, - 16, 1, printbuf, - sizeof(printbuf), - false); - seq_printf(s, " : %s\n", printbuf); - n += l; - } + wil_seq_hexdump(s, databuf, len, " : "); } } else { seq_puts(s, "\n"); @@ -867,22 +862,6 @@ static const struct file_operations fops .open = simple_open, }; -static void wil_seq_hexdump(struct seq_file *s, void *p, int len, - const char *prefix) -{ - char printbuf[16 * 3 + 2]; - int i = 0; - - while (i < len) { - int l = min(len - i, 16); - - hex_dump_to_buffer(p + i, l, 16, 1, printbuf, - sizeof(printbuf), false); - seq_printf(s, "%s%s\n", prefix, printbuf); - i += l; - } -} - static void wil_seq_print_skb(struct seq_file *s, struct sk_buff *skb) { int i = 0; _ Patches currently in -mm which might be from andriy.shevchenko@xxxxxxxxxxxxxxx are seq_file-provide-an-analogue-of-print_hex_dump.patch crypto-qat-use-seq_hex_dump-to-dump-buffers.patch parisc-use-seq_hex_dump-to-dump-buffers.patch zcrypt-use-seq_hex_dump-to-dump-buffers.patch kmemleak-use-seq_hex_dump-to-dump-buffers.patch wil6210-use-seq_hex_dump-to-dump-buffers.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html