From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Samuel Ortiz <samuel@sortiz.org>,
netdev@vger.kernel.org
Subject: Re: [PATCH] irda: vlsi_ir: use %*ph specifier
Date: Fri, 05 Sep 2014 21:21:08 +0400 [thread overview]
Message-ID: <5409F104.5040705@cogentembedded.com> (raw)
In-Reply-To: <1409927840-28791-1-git-send-email-andriy.shevchenko@linux.intel.com>
Hello.
On 09/05/2014 06:37 PM, Andy Shevchenko wrote:
> 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 | 11 +++--------
> 1 file changed, 3 insertions(+), 8 deletions(-)
> diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c
> index a04af9d..0319eba 100644
> --- a/drivers/net/irda/vlsi_ir.c
> +++ b/drivers/net/irda/vlsi_ir.c
> @@ -323,14 +323,9 @@ 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", j > 20 ? 20 : j,
Why not min(j, 20)?
> + rd->buf);
> }
WBR, Sergei
next prev parent reply other threads:[~2014-09-05 17:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-05 14:37 [PATCH] irda: vlsi_ir: use %*ph specifier Andy Shevchenko
2014-09-05 17:21 ` Sergei Shtylyov [this message]
2014-09-07 23:09 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5409F104.5040705@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=samuel@sortiz.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).