From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752236AbcAFRsN (ORCPT ); Wed, 6 Jan 2016 12:48:13 -0500 Received: from mx2.suse.de ([195.135.220.15]:38783 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752157AbcAFRsK (ORCPT ); Wed, 6 Jan 2016 12:48:10 -0500 Date: Wed, 6 Jan 2016 18:48:04 +0100 From: Borislav Petkov To: Dave Hansen Cc: x86@kernel.org, linux-kernel@vger.kernel.org, dave.hansen@linux.intel.com, hpa@zytor.com, fenghua.yu@intel.com, yu-cheng.yu@intel.com Subject: Re: [PATCH 3/5] x86: simplify early command line parsing Message-ID: <20160106174804.GC20321@pd.tnic> References: <20151222225237.08CDE5F1@viggo.jf.intel.com> <20151222225241.15365E43@viggo.jf.intel.com> <20160106171044.GB20321@pd.tnic> <568D50E4.30102@sr71.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <568D50E4.30102@sr71.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) --