[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <04bb934e551f43540d1daacd2759beacc0b3116a.camel@perches.com>
Date: Thu, 02 Apr 2020 16:26:11 -0700
From: Joe Perches <joe@...ches.com>
To: Jani Nikula <jani.nikula@...ux.intel.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Petr Mladek <pmladek@...e.com>
Cc: mchehab@...nel.org,
Dave Stevenson <dave.stevenson@...pberrypi.com>,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
hverkuil@...all.nl,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
laurent.pinchart@...asonboard.com,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
linux-media@...r.kernel.org,
Ville Syrjälä
<ville.syrjala@...ux.intel.com>
Subject: Re: [PATCH 1/1] lib/vsprintf: Add support for printing V4L2 and DRM
fourccs
On Thu, 2020-04-02 at 11:34 +0300, Jani Nikula wrote:
> On Wed, 01 Apr 2020, Sakari Ailus <sakari.ailus@...ux.intel.com> wrote:
> > Add a printk modifier %ppf (for pixel format) for printing V4L2 and DRM
> > pixel formats denoted by 4ccs. The 4cc encoding is the same for both so
> > the same implementation can be used.
>
> I'm not going to take a strong stand in one way or the other regarding
> the patch at hand, but I do think at some point we have to draw a line
> what should be included in printk formats. Arguably they should be
> reserved to things that are generally useful across large parts of the
> kernel, right?
Definitely yes.
> I think the more specialized you get, the more you should think about
> just using the plain old %s, and your own helpers. Because frankly, the
> kernel printk specifiers also start getting more than a little obscure.
>
> Or could we conceive of a way to make this locally extensible yet safe,
> letting callers use something like %{foo}, as well as providing a
> locally relevant function to do the conversion?
No. printf validation would be broken.
Powered by blists - more mailing lists