[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <20130924100240.211dcaa3@samsung.com>
Date: Tue, 24 Sep 2013 10:02:40 -0300
From: Mauro Carvalho Chehab <m.chehab@...sung.com>
To: Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
Cc: Tomasz Stanislawski <t.stanislaws@...sung.com>,
Mateusz Krawczuk <m.krawczuk@...tner.samsung.com>,
t.figa@...sung.com, kyungmin.park@...sung.com,
s.nawrocki@...sung.com, linux-arm-kernel@...ts.infradead.org,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 1/4] media: s5p-tv: Replace mxr_ macro by default dev_
Em Tue, 24 Sep 2013 12:33:34 +0200
Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com> escreveu:
>
> Hi Tomasz,
>
> On Tuesday, September 24, 2013 11:43:53 AM Tomasz Stanislawski wrote:
> > Hi,
> >
> > On 09/23/2013 05:48 PM, Bartlomiej Zolnierkiewicz wrote:
> > >
> > > Hi Tomasz,
> > >
> > > On Monday, September 23, 2013 04:50:01 PM Tomasz Stanislawski wrote:
> > >> Hello,
> > >> May I ask what is the rationale for this patch?
> > >> To reduce a few lines of code?
> > >
> > > This patch makes source code more generic-like and easier to follow (mxd_r*
> >
> > more generic(-like?) - NOT. Using mxr_ macros is a more generic way to produce logs
>
> Using mxr_* macros is not more generic, don't be silly. :)
Let me give my 2 cents on it: it used to be common on media drivers to
define their own print macros. The rationale for that is because the
existing macros, on that time (kernel 2.2), weren't good enough[1].
Other drivers just followed it due to cut-and-paste.
However, nowadays, most developers are just sticking with the existing
common debug infrastructure (either dev_* or pr_* - being the last more
used). By using them, Kernel janitors can do a better job, as they may
have scripts already prepared to check issues there.
I prefer the usage of pr_* macros, as they allow debug messages to be
selectively enabled/disabled, if dynamic printk's are enabled. So,
a change like that actually improves the debug capability on a given
driver.
So, IMHO, the better would be to change the patch to use pr_* macros,
and follow Joe's suggestions to improve it.
Regards,
Mauro
[1] on other drivers that create their own macros, the usual prefix is the
name of the driver (so, on em28xx, it is em28xx_dbg, and so on). In this
case, the driver is s5p_tv. So, a macro following the old way should be
called as s5p_tv_dbg. Yet, it is takes just a fraction of time to identify
them as printk-alike macros, as all those macros are similar.
Cheers,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists