From: Joe Perches <joe@perches.com>
To: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: Malcolm Priestley <tvboxspy@gmail.com>,
linux-media@vger.kernel.org,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] [media] lmedm04: Neaten logging
Date: Tue, 09 Jun 2015 16:30:39 -0700 [thread overview]
Message-ID: <1433892639.2730.81.camel@perches.com> (raw)
In-Reply-To: <20150609190749.56a1c6dd@recife.lan>
On Tue, 2015-06-09 at 19:07 -0300, Mauro Carvalho Chehab wrote:
> Hi Joe,
Marhaba Mauro.
> Em Mon, 25 May 2015 01:29:07 -0700
> Joe Perches <joe@perches.com> escreveu:
>
> > Use a more current logging style.
> >
> > o Use pr_fmt
> > o Add missing newlines to formats
> > o Remove used-once lme_debug macro incorporating it into dbg_info
> > o Remove unnecessary allocation error messages
> > o Remove unnecessary semicolons from #defines
> > o Remove info macro and convert uses to pr_info
> > o Fix spelling of snippet
> > o Use %phN extension
>
> There are a few checkpatch warnings:
I hardly use checkpatch tbh
The long lines I don't care about, I presume all the others are
existing, but I'll run --fix on it and resubmit if you want.
> > diff --git a/drivers/media/usb/dvb-usb-v2/lmedm04.c b/drivers/media/usb/dvb-usb-v2/lmedm04.c
[]
> > /* debug */
> > static int dvb_usb_lme2510_debug;
> > -#define lme_debug(var, level, args...) do { \
> > - if ((var >= level)) \
> > - pr_debug(DVB_USB_LOG_PREFIX": " args); \
> > +#define deb_info(level, fmt, ...) \
> > +do { \
> > + if (dvb_usb_lme2510_debug >= level) \
> > + pr_debug(fmt, ##__VA_ARGS__); \
> > } while (0)
>
>
> The usage of both a debug level and pr_debug() is not nice, as,
> if CONFIG_DYNAMIC_DEBUG is enabled (with is the case on most distros),
> one needing to debug would need to both pass a debug level AND to enable
> the debug line via sysfs, with is not nice.
> We might of course remove debug levels as a hole and just use
> pr_debug(), but the end result is generally worse (didn't chec
> the specifics on this file).
>
> So, the better here would be to use printk like:
>
> #define deb_info(level, fmt, ...)\
> do { if (dvb_usb_lme2510_debug >= level)\
> printk(KERN_DEBUG pr_fmt(fmt), ## arg);\
> } while (0)
>
> Ok, this issue were already present on the old code, but IMHO the
> best is to either use the above definition of deb_info() or to just
> call pr_debug() and get rid of dvb_usb_lme2510_debug.
Alternately, you could #define DEBUG and these would be enabled
by default for CONFIG_DYNAMIC_DEBUG and act the same otherwise.
prev parent reply other threads:[~2015-06-09 23:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-25 8:29 [PATCH] [media] lmedm04: Neaten logging Joe Perches
2015-06-09 22:07 ` Mauro Carvalho Chehab
2015-06-09 23:30 ` Joe Perches [this message]
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=1433892639.2730.81.camel@perches.com \
--to=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@osg.samsung.com \
--cc=tvboxspy@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox