Re: [PATCH v2 3/7] x86/boot: Split out parse_serial_port() helper for earlyprintk

From: Andy Shevchenko
Date: Thu Mar 28 2019 - 09:50:21 EST


On Thu, Mar 28, 2019 at 02:39:07PM +0100, Borislav Petkov wrote:
> On Thu, Mar 28, 2019 at 03:15:57PM +0200, Andy Shevchenko wrote:
> > kstrtox() simple can't cover _all_ simple_strtox() cases.
>
> I see only one case here. Are you saying kstrtoull() cannot work
> here?

Can, but with code uglifying to workaround kstrtox() restrictions.
simple_strtox() _just works_ as expected.

> > I don't feel like uglifying code to satisfy a tool producing a silly
> warning.
>
> Uglifying how?

Requires buffer copying, finding digits there, making a proper termination. And
basically dropping the error check, because we don't care at this stage about
wrong input.

And we didn't start to talk about possible user expectation breakage and
basically breakage weird user cases.

--
With Best Regards,
Andy Shevchenko