Re: [PATCH v5 07/11] vsprintf: Factor out %pV handler as va_format()

From: Andy Shevchenko
Date: Wed Apr 25 2018 - 10:57:00 EST


On Wed, 2018-04-25 at 13:12 +0200, Petr Mladek wrote:
> Move the code from the long pointer() function. We are going to add a
> check
> for the access to the address that will make it even more complicated.
>
> This patch does not change the existing behavior.

> +static char *va_format(char *buf, char *end, struct va_format
> *va_fmt)
> +{
> + va_list va;
> +
> + va_copy(va, *va_fmt->va);

> + buf += vsnprintf(buf, end > buf ? end - buf : 0,
> + va_fmt->fmt, va);

One line?

> + va_end(va);
> +
> + return buf;
> +}

--
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy