From: Antti Palosaari <crope@iki.fi>
To: Joe Perches <joe@perches.com>,
Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: Amber Thrall <amber.rose.thrall@gmail.com>,
jarod@wilsonet.com, linux-media@vger.kernel.org,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fixed all coding style issues for drivers/staging/media/lirc/
Date: Fri, 03 Oct 2014 02:58:45 +0300 [thread overview]
Message-ID: <542DE6B5.1060906@iki.fi> (raw)
In-Reply-To: <1412268351.3247.68.camel@joe-AO725>
On 10/02/2014 07:45 PM, Joe Perches wrote:
> 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.
That is place where you print 8 debug bytes, which are received remote
controller code. IMHO %*ph format is just what you like in that case.
Why print_hex_dump_debug() is better? IIRC it could not be even
controlled like those dynamic debug printings.
regards
Antti
--
http://palosaari.fi/
next prev parent reply other threads:[~2014-10-02 23:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-02 4:40 [PATCH] Fixed all coding style issues for drivers/staging/media/lirc/ Amber Thrall
2014-10-02 4:49 ` Ilia Mirkin
2014-10-02 6:20 ` Jeremiah Mahler
2014-10-02 12:45 ` Greg KH
2014-10-02 13:29 ` Mauro Carvalho Chehab
2014-10-02 16:45 ` Joe Perches
2014-10-02 23:58 ` Antti Palosaari [this message]
2014-10-03 1:41 ` Joe Perches
-- strict thread matches above, loose matches on Subject: below --
2014-10-02 2:35 Amber Thrall
2014-10-02 2:46 ` Greg KH
2014-10-02 8:13 ` Dan Carpenter
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=542DE6B5.1060906@iki.fi \
--to=crope@iki.fi \
--cc=amber.rose.thrall@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=jarod@wilsonet.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@osg.samsung.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.