lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Fri, 3 Apr 2020 19:32:42 +0200 From: Mauro Carvalho Chehab <mchehab+huawei@...nel.org> To: Joe Perches <joe@...ches.com> Cc: Rasmus Villemoes <linux@...musvillemoes.dk>, Sakari Ailus <sakari.ailus@...ux.intel.com>, Petr Mladek <pmladek@...e.com>, Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, linux-media@...r.kernel.org, Dave Stevenson <dave.stevenson@...pberrypi.com>, dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org, hverkuil@...all.nl, laurent.pinchart@...asonboard.com, Sergey Senozhatsky <sergey.senozhatsky@...il.com>, Steven Rostedt <rostedt@...dmis.org>, Jani Nikula <jani.nikula@...ux.intel.com> Subject: Re: [PATCH v2 1/1] lib/vsprintf: Add support for printing V4L2 and DRM fourccs Em Fri, 03 Apr 2020 09:56:42 -0700 Joe Perches <joe@...ches.com> escreveu: > On Fri, 2020-04-03 at 14:10 +0200, Rasmus Villemoes wrote: > > On 03/04/2020 11.11, Sakari Ailus 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. > > > > This seems quite niche to me, I'm not sure that belongs in vsprintf.c. > > What's wrong with having a > > > > char *fourcc_string(char *buf, u32 x) > > > > that formats x into buf and returns buf, so it can be used in a > > > > char buf[8]; > > pr_debug("bla: %s\n", fourcc_string(buf, x)) > > Nothing really, it's a number of uses question. > > For networking code, print_mac was used before %pM. > > After Linus floated the idea of %p<foo>, %pM was > introduced and all the DECLARE_MAC_BUF/print_mac > calls were converted. > > %pM did reduce overall object size a fair amount. > > How many instances of %p4cc could there be? That's hard to know... there are several places printing it with different ways: $ git grep -i -E "(dev|pr)_(warn|dbg|info)" drivers/media|grep pixf|wc -l 6 $ git grep -i -E "print" drivers/media|grep pixf|wc -l 1 $ git grep print_fourcc|wc -l 7 $ git grep -i -E "(dev|pr)_(warn|dbg|info)" drivers/media|grep pixelf|wc -l 10 $ git grep -i -E "(dev|pr|v4l)_(warn|dbg|info)" drivers/media|grep format|wc -l 60 I bet there are other places besides the above ones, but the thing is, as we currently lack a standard way, drivers still have their own ideas about how to handle it. Each one does it differently. Thanks, Mauro
Powered by blists - more mailing lists