Re: [PATCH v5 04/11] vsprintf: Do not check address of well-known strings

From: Andy Shevchenko
Date: Wed Apr 25 2018 - 07:44:41 EST


On Wed, 2018-04-25 at 13:12 +0200, Petr Mladek wrote:
> We are going to check the address using probe_kernel_address(). It
> will
> be more expensive and it does not make sense for well known address.
>
> This patch splits the string() function. The variant without the check
> is then used on locations that handle string constants or strings
> defined
> as local variables.
>
> This patch does not change the existing behavior.

> - buf = string(buf, end, ",",
> str_spec);

> + buf = valid_string(buf, end,
> ",",
> + str_spec);

> - return string(buf, end, "(invalid
> address)", spec);
> + return valid_string(buf, end,
> + "(invalid
> address)", spec);
>

I wouldn't give a crap about over 80 in above two cases.

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