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

From: Borislav Petkov
Date: Wed Jan 06 2016 - 12:48:20 EST


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)
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/