lkml.org 
[lkml]   [2014]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Fixed all coding style issues for drivers/staging/media/lirc/
From
Date
On Thu, 2014-10-02 at 10:29 -0300, Mauro Carvalho Chehab wrote:
> Em Wed, 01 Oct 2014 21:40:02 -0700 Amber Thrall <amber.rose.thrall@gmail.com> escreveu:
> > Fixed various coding style issues, including strings over 80 characters long and many
> > deprecated printk's have been replaced with proper methods.
[]
> > diff --git a/drivers/staging/media/lirc/lirc_imon.c b/drivers/staging/media/lirc/lirc_imon.c
[]
> > @@ -623,8 +623,8 @@ static void imon_incoming_packet(struct imon_context *context,
> > if (debug) {
> > dev_info(dev, "raw packet: ");
> > for (i = 0; i < len; ++i)
> > - printk("%02x ", buf[i]);
> > - printk("\n");
> > + dev_info(dev, "%02x ", buf[i]);
> > + dev_info(dev, "\n");
> > }
>
> This is wrong, as the second printk should be printk_cont.
>
> The best here would be to change all above to use %*ph.
> So, just:
>
> dev_debug(dev, "raw packet: %*ph\n", len, buf);

Not quite.

%*ph is length limited and only useful for lengths < 30 or so.
Even then, it's pretty ugly.

print_hex_dump_debug() is generally better.




\
 
 \ /
  Last update: 2014-10-02 19:21    [W:0.090 / U:0.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site