Re: [PATCH 3/5] x86: simplify early command line parsing

Borislav Petkov
2016-01-06T17:48:13Z

On Wed, Jan 06, 2016 at 09:37:40AM -0800, Dave Hansen wrote:
> On 01/06/2016 09:10 AM, Borislav Petkov wrote:
> >> > - if (!strlen(cmdline))
> >> > - return 0;
> >> > -
> > Patch 1 adds the strlen(), this patch removes it. Please merge both patches.
>
> As I mentioned, it doesn't strictly add it.
>
> Plus, if I go add this back to that patch, I'll end up having to paste
> most of the changelog in to that one. I think it's much more clear to
> have this hunk live on its own.

So why not leave the min_t:

maxlen = min_t(int, strlen(cmdline), COMMAND_LINE_SIZE);

and then do:

while (pos < maxlen)

?

This way it is absolutely clear what's going on.

--
Regards/Gruss,
Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
--