lkml.org 
[lkml]   [2021]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 1/3] lib/vsprintf: Add support for printing V4L2 and DRM fourccs
On Mon, Feb 08, 2021 at 10:58:55PM +0200, Andy Shevchenko wrote:
> On Mon, Feb 08, 2021 at 10:43:30PM +0200, Andy Shevchenko wrote:
> > On Mon, Feb 8, 2021 at 10:11 PM Sakari Ailus
> > <sakari.ailus@linux.intel.com> wrote:

...

> __le32 val;
>
> val = cpu_to_le32(*fourcc & ~BIT(31));
>
> p += string_escape_mem(&val, sizeof(*fourcc), output, sizeof(output), ESCAPE_NP | ESCAPE_HEX, NULL);

sizeof(val) and as we are discussing in parallel emails something like
skip_trailing_spaces() to be applied after above.

The rationale of the above, that we reuse existing code and existing standard
for the escaping non-printable characters.

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2021-02-09 11:20    [W:0.121 / U:3.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site