Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1630666pxb; Thu, 4 Mar 2021 16:58:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJxA7zXFuFdzkmevos7+KnlMB4YMbkphFKSE3jNwDzqTTki5YaCOGnJ0OCxp9CQu04kHE0J8 X-Received: by 2002:a02:1702:: with SMTP id 2mr6936800jah.43.1614905922136; Thu, 04 Mar 2021 16:58:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614905922; cv=none; d=google.com; s=arc-20160816; b=L9y03YaxLAYieV8TgfO+UWy/+i6uscr2SvOg7dOC+iFCzlbo1Jqio4eiR12SqQkw7F X3cyT64J78H/lAfUm0H/nPSNYCC91M8ALnJdQcTKI8qUvYAq1Vr1AbjPWsBhyXVSlLtP mLTIQZB1mSMIvWDXpD9Y/5q1aYqPrU11dE5XGrsDF/vzOY6dx2mACCdUKC9YMtvj22T7 pnHQVTYpc1VFaClXIPdChGlbGwEr25mh4xv1z9tVT7wSshNE5CKpMycAfADO+LKYoRVC 6inkL2wfxfA0vQZv59HtdC5dgtH5UccXAunRuEJPNhqj5+D2w+xha9Ob5dLVAWba6Lgb 2byw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=UejgCppx7eZPIWKzyfsWiNhDe5pBRBCy8UXElNZWVcQ=; b=nAzx8I7DbPgCFo/NNO8cEFKK51Zc6ukIXk5J4ldLSo3VFO7iZySL7AjbQzynz/0teg 1OAWK0YcHCMfY2iqrRSZlR1GN4w2J49+ZJn6riGSWdA93gfaAggBl7BvLtBkxl/O15ed zgECuQz3RrA8yLA7/UGKvfxUe8gk+9sRHS6hveJ820YAc7ecRYrd8mvDCM2k3MB1SYra Vc6MY2YWjCiJkbrMR4D9Mk4wH0UkCNicMxinjnfPVt1OysbkwR/LFXtxOM/1wsF8cH4k xRJ8LXSJ3BcVCf2MWb/JQBz7m8TZ/nWMbHpRxEHbq0WX+SgsQG0CAszoDaKOE+mHMyi4 vi0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=e19UXcGj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cisco.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g22si942342iob.26.2021.03.04.16.58.29; Thu, 04 Mar 2021 16:58:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=e19UXcGj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cisco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235801AbhCDVZe (ORCPT + 99 others); Thu, 4 Mar 2021 16:25:34 -0500 Received: from alln-iport-1.cisco.com ([173.37.142.88]:41048 "EHLO alln-iport-1.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235844AbhCDVZc (ORCPT ); Thu, 4 Mar 2021 16:25:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1694; q=dns/txt; s=iport; t=1614893132; x=1616102732; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=9ULi3lxtKwy2ziPDY/q6Yuz9DuWL9aXRDve/CHdZaFA=; b=e19UXcGjJVQu042aXTxMV7vl9VkV3haxSt623jhDJkjtwzjLlncKbMUt w+wWoVOaDz0fHCffRN6b55OEdjdn4+YOkl/RMh83ru0HduCxIQKKVoOEq QO/RZU1mS+dZ57imr/ycJN4BeE854cUGhpbscJHmzbS0x1wu2ZCrqnq4r A=; X-IPAS-Result: =?us-ascii?q?A0AVAABfTkFgmIcNJK1iHAEBAQEBAQcBARIBAQQEAQFAg?= =?us-ascii?q?TwGAQELAYN2ATkxlh6PehaKP4F8CwEBAQ0BATQEAQGBFIM0AwICgXoCJTUID?= =?us-ascii?q?gIDAQEBAwIDAQEBAQUBAQECAQYEFAEBAQEBAQEBhkOGRQEFMgFGEAsYLjwbB?= =?us-ascii?q?hOCcIMIrhJ0gTSJH4FEFA6BFgGNQiYcgUlCgRGDGj6KMwSCQAeBDoIoEpN7i?= =?us-ascii?q?i6be4MGgR+acjEQo0a2cgIEBgUCFoFWATWBWTMaCBsVgyRQGQ2OOI5QIAMvO?= =?us-ascii?q?AIGAQkBAQMJjBMBAQ?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-AV: E=Sophos;i="5.81,223,1610409600"; d="scan'208";a="656967522" Received: from alln-core-2.cisco.com ([173.36.13.135]) by alln-iport-1.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 04 Mar 2021 21:24:51 +0000 Received: from zorba ([10.24.1.42]) by alln-core-2.cisco.com (8.15.2/8.15.2) with ESMTPS id 124LOnLb005860 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 4 Mar 2021 21:24:50 GMT Date: Thu, 4 Mar 2021 13:24:48 -0800 From: Daniel Walker To: Christophe Leroy Cc: Will Deacon , ob Herring , Daniel Gimpelevich , Andrew Morton , x86@kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Rob Herring , Frank Rowand , xe-linux-external@cisco.com, Ruslan Ruslichenko , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/5] CMDLINE: drivers: of: ifdef out cmdline section Message-ID: <20210304212448.GK109100@zorba> References: <20210304044803.812204-2-danielwa@cisco.com> <2b0081aa-52af-a4ab-7481-6e125bd103d6@csgroup.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2b0081aa-52af-a4ab-7481-6e125bd103d6@csgroup.eu> X-Auto-Response-Suppress: DR, OOF, AutoReply X-Outbound-SMTP-Client: 10.24.1.42, [10.24.1.42] X-Outbound-Node: alln-core-2.cisco.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 04, 2021 at 08:09:52AM +0100, Christophe Leroy wrote: > > > Le 04/03/2021 ? 05:47, Daniel Walker a ?crit?: > > It looks like there's some seepage of cmdline stuff into > > the generic device tree code. This conflicts with the > > generic cmdline implementation so I remove it in the case > > when that's enabled. > > > > Cc: xe-linux-external@cisco.com > > Signed-off-by: Ruslan Ruslichenko > > Signed-off-by: Daniel Walker > > --- > > drivers/of/fdt.c | 12 ++++++++++++ > > 1 file changed, 12 insertions(+) > > > > diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c > > index feb0f2d67fc5..cfe4f8d3c9f5 100644 > > --- a/drivers/of/fdt.c > > +++ b/drivers/of/fdt.c > > @@ -25,6 +25,7 @@ > > #include > > #include > > #include > > +#include > > #include /* for COMMAND_LINE_SIZE */ > > #include > > @@ -1048,8 +1049,18 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, > > early_init_dt_check_for_initrd(node); > > +#ifdef CONFIG_GENERIC_CMDLINE > > /* Retrieve command line */ > > p = of_get_flat_dt_prop(node, "bootargs", &l); > > + > > + /* > > + * The builtin command line will be added here, or it can override > > + * with the DT bootargs. > > + */ > > + cmdline_add_builtin(data, > > + ((p != NULL && l > 0) ? p : NULL), /* This is sanity checking */ > > Can we do more simple ? If p is NULL, p is already NULL, so (l > 0 ? p : NULL) should be enough. I believe Rob gave me this line. Maybe he can comment on it. Daniel