* [PATCH v2] irda: vlsi_ir: use %*ph specifier
@ 2014-09-08 7:38 Andy Shevchenko
2014-09-08 21:10 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2014-09-08 7:38 UTC (permalink / raw)
To: Samuel Ortiz, netdev, Sergei Shtylyov, David Miller; +Cc: Andy Shevchenko
Instead of looping in the code let's use kernel extension to dump small
buffers.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/net/irda/vlsi_ir.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c
index a04af9d..78e00ad 100644
--- a/drivers/net/irda/vlsi_ir.c
+++ b/drivers/net/irda/vlsi_ir.c
@@ -323,14 +323,8 @@ static void vlsi_proc_ring(struct seq_file *seq, struct vlsi_ring *r)
j = (unsigned) rd_get_count(rd);
seq_printf(seq, "current: rd = %d / status = %02x / len = %u\n",
h, (unsigned)rd_get_status(rd), j);
- if (j > 0) {
- seq_printf(seq, " data:");
- if (j > 20)
- j = 20;
- for (i = 0; i < j; i++)
- seq_printf(seq, " %02x", (unsigned)((unsigned char *)rd->buf)[i]);
- seq_printf(seq, "\n");
- }
+ if (j > 0)
+ seq_printf(seq, " data: %*ph\n", min(j, 20), rd->buf);
}
for (i = 0; i < r->size; i++) {
rd = &r->rd[i];
--
2.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v2] irda: vlsi_ir: use %*ph specifier
2014-09-08 7:38 [PATCH v2] irda: vlsi_ir: use %*ph specifier Andy Shevchenko
@ 2014-09-08 21:10 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-09-08 21:10 UTC (permalink / raw)
To: andriy.shevchenko; +Cc: samuel, netdev, sergei.shtylyov
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: Mon, 8 Sep 2014 10:38:43 +0300
> Instead of looping in the code let's use kernel extension to dump small
> buffers.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Try again:
drivers/net/irda/vlsi_ir.c: In function ‘vlsi_proc_ring’:
drivers/net/irda/vlsi_ir.c:327:39: warning: comparison of distinct pointer types lacks a cast [enabled by default]
The types on each side of the min() expression are different, so the
compiler warns. You probably need to use min_t() or similar, and
carefuly examine the possible effects of signed overflow etc.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-08 21:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-08 7:38 [PATCH v2] irda: vlsi_ir: use %*ph specifier Andy Shevchenko
2014-09-08 21:10 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).