From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0757C433E3 for ; Tue, 30 Mar 2021 17:35:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A937960235 for ; Tue, 30 Mar 2021 17:35:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232410AbhC3Rel (ORCPT ); Tue, 30 Mar 2021 13:34:41 -0400 Received: from rcdn-iport-6.cisco.com ([173.37.86.77]:56199 "EHLO rcdn-iport-6.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232319AbhC3Re2 (ORCPT ); Tue, 30 Mar 2021 13:34:28 -0400 X-Greylist: delayed 428 seconds by postgrey-1.27 at vger.kernel.org; Tue, 30 Mar 2021 13:34:27 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1640; q=dns/txt; s=iport; t=1617125668; x=1618335268; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=DLlq6Eg2HUUvE9Fdg0Ebob6Tw5pX5R4uRXQoNV4sDwc=; b=YD6hOFjT4nT7yKyRURbYH2p7ZA+EIkn7ViGFqE0grJphcRE1Cx+J1b7b jgi+o620uozhL/ijEjQBF09qlmSZWnK2EtPCOPJ3EI1TUuWA0C6K177BI m/B0bK/1XmrW7K9hltVCpq00DNSmXarIk9USeAvhDr1JRyjr9zwX26TP4 k=; IronPort-HdrOrdr: =?us-ascii?q?A9a23=3AoTmckqE8NgKcaaN3pLqEVceALOonbusQ8z?= =?us-ascii?q?AX/mp6ICY7TuWzkceykPMHkTL1ki8WQnE8mdaGUZPwJE/035hz/IUXIPOeTB?= =?us-ascii?q?Dr0VHYTr1KwIP+z1TbcRHW2fVa0c5bHpRWKNq1NlRiiNa/3Q/QKadF/PCi0I?= =?us-ascii?q?SFwdjT1G1sSwYCUdAC0y5cBhyAGkN7AClqbKBZKLOm6sBKpyWtdB0sB6zROl?= =?us-ascii?q?A/U+fOvNHNnp79CCRnOzcc9AKMgTm0gYSVLzGk2H4lPw9n8PMF7XXPlRD/6+?= =?us-ascii?q?GFtfy2oyWssVP73tBxhMbrzMdFCYi3rvUtbh/oigquee1aKtq/gAw=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0BhAABKXmNg/4UNJK1aHAEBAQEBAQc?= =?us-ascii?q?BARIBAQQEAQFAgTwHAQELAYIqgUwBOTGMZYkukAgWikWBfAsBAQENAQE0BAE?= =?us-ascii?q?BhFACgXoCJTQJDgIDAQEMAQEFAQEBAgEGBHGFboZFAQU6PxALGC48GwYThXi?= =?us-ascii?q?rInWBNIkLgUQigRcBjUkmHIFJQoESgm4uPoo2BIJHgQ6CMCyeTZwigxGBI5s?= =?us-ascii?q?2MRCkQrgSAgQGBQIWgVQ6gVkzGggbFYMkUBkNnQchAy84AgYKAQEDCYkfAQE?= X-IronPort-AV: E=Sophos;i="5.81,291,1610409600"; d="scan'208";a="880406225" Received: from alln-core-11.cisco.com ([173.36.13.133]) by rcdn-iport-6.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 30 Mar 2021 17:27:19 +0000 Received: from zorba ([10.24.8.123]) by alln-core-11.cisco.com (8.15.2/8.15.2) with ESMTPS id 12UHREPN013894 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 30 Mar 2021 17:27:16 GMT Date: Tue, 30 Mar 2021 10:27:14 -0700 From: Daniel Walker To: Christophe Leroy Cc: will@kernel.org, robh@kernel.org, daniel@gimpelevich.san-francisco.ca.us, linux-arch@vger.kernel.org, devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, microblaze , linux-mips@vger.kernel.org, nios2 , openrisc@lists.librecores.org, linux-hexagon@vger.kernel.org, linux-riscv@lists.infradead.org, x86@kernel.org, linux-xtensa@linux-xtensa.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org Subject: Re: [PATCH v3 01/17] cmdline: Add generic function to build command line. Message-ID: <20210330172714.GR109100@zorba> References: <878228ad88df38f8914c7aa25dede3ed05c50f48.1616765869.git.christophe.leroy@csgroup.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <878228ad88df38f8914c7aa25dede3ed05c50f48.1616765869.git.christophe.leroy@csgroup.eu> X-Outbound-SMTP-Client: 10.24.8.123, [10.24.8.123] X-Outbound-Node: alln-core-11.cisco.com Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org On Fri, Mar 26, 2021 at 01:44:48PM +0000, Christophe Leroy wrote: > This code provides architectures with a way to build command line > based on what is built in the kernel and what is handed over by the > bootloader, based on selected compile-time options. > > Signed-off-by: Christophe Leroy > --- > v3: > - Addressed comments from Will > - Added capability to have src == dst > --- > include/linux/cmdline.h | 57 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 57 insertions(+) > create mode 100644 include/linux/cmdline.h > > diff --git a/include/linux/cmdline.h b/include/linux/cmdline.h > new file mode 100644 > index 000000000000..dea87edd41be > --- /dev/null > +++ b/include/linux/cmdline.h > @@ -0,0 +1,57 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +#ifndef _LINUX_CMDLINE_H > +#define _LINUX_CMDLINE_H > + > +#include > + > +/* Allow architectures to override strlcat, powerpc can't use strings so early */ > +#ifndef cmdline_strlcat > +#define cmdline_strlcat strlcat > +#endif > + > +/* > + * This function will append or prepend a builtin command line to the command > + * line provided by the bootloader. Kconfig options can be used to alter > + * the behavior of this builtin command line. > + * @dst: The destination of the final appended/prepended string. > + * @src: The starting string or NULL if there isn't one. > + * @len: the length of dest buffer. > + */ Append or prepend ? Cisco requires both at the same time. This is why my implementation provides both. I can't use this with both at once. Daniel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A32D6C433DB for ; Tue, 30 Mar 2021 17:27:49 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2D0596196C for ; Tue, 30 Mar 2021 17:27:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2D0596196C Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=cisco.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+zABfrcNuAWIP8fvhsLVUWOiJIkq+bCCPg5FFnz6UOc=; b=ASDILX69SaGIrHpJM2qQl+ZrL l0O65dgiqm2vrb8wqhmh9CUqNvnPVdS6G/UBGTHZG7okCBHezI2oGeCBUNI8vDqsTYudWOxkfzR+V kHeKrmbRr0m1lrBv185jy+VLDskNBAWqi7bgD+1y9R65fNciPSqk9m+8MPSME470Sf0MeLKRKtbiu YAzP0HPTNYz6fnlWERyIjTCPnVRKI8CyLDx+7YkI8HDQogdxv1H6UY15hR2dthAf3gEt99TlD+b2s WGCqo9ceG4dm091pkwZ1d7TW/zQRUSYt5LOe96mrULqYspQseLEDx0WFaAtrWsr38F7Xv0LMAJs9d +7XWm239w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lRI9M-004Rg0-OK; Tue, 30 Mar 2021 17:27:32 +0000 Received: from rcdn-iport-6.cisco.com ([173.37.86.77]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lRI9D-004ReN-U3; Tue, 30 Mar 2021 17:27:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1640; q=dns/txt; s=iport; t=1617125244; x=1618334844; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=DLlq6Eg2HUUvE9Fdg0Ebob6Tw5pX5R4uRXQoNV4sDwc=; b=AZ/drV3Wsv41owZ2NuZOdxoA8nTddNyk+eV/sp/13WYgrgFBYjT5oEwC 6eczwoU1uQdLWtDyPcr6e5wKY1DN0A2EGJMXo3TxAQizmdTfZXj0ZKCT7 SvAywcgfgOQ+rtfU/zG6BUD9omFdFLEu+Nf54mvwZ5eDCzABulq2MT1W3 8=; IronPort-HdrOrdr: =?us-ascii?q?A9a23=3AoTmckqE8NgKcaaN3pLqEVceALOonbusQ8z?= =?us-ascii?q?AX/mp6ICY7TuWzkceykPMHkTL1ki8WQnE8mdaGUZPwJE/035hz/IUXIPOeTB?= =?us-ascii?q?Dr0VHYTr1KwIP+z1TbcRHW2fVa0c5bHpRWKNq1NlRiiNa/3Q/QKadF/PCi0I?= =?us-ascii?q?SFwdjT1G1sSwYCUdAC0y5cBhyAGkN7AClqbKBZKLOm6sBKpyWtdB0sB6zROl?= =?us-ascii?q?A/U+fOvNHNnp79CCRnOzcc9AKMgTm0gYSVLzGk2H4lPw9n8PMF7XXPlRD/6+?= =?us-ascii?q?GFtfy2oyWssVP73tBxhMbrzMdFCYi3rvUtbh/oigquee1aKtq/gAw=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0BhAABKXmNg/4UNJK1aHAEBAQEBAQc?= =?us-ascii?q?BARIBAQQEAQFAgTwHAQELAYIqgUwBOTGMZYkukAgWikWBfAsBAQENAQE0BAE?= =?us-ascii?q?BhFACgXoCJTQJDgIDAQEMAQEFAQEBAgEGBHGFboZFAQU6PxALGC48GwYThXi?= =?us-ascii?q?rInWBNIkLgUQigRcBjUkmHIFJQoESgm4uPoo2BIJHgQ6CMCyeTZwigxGBI5s?= =?us-ascii?q?2MRCkQrgSAgQGBQIWgVQ6gVkzGggbFYMkUBkNnQchAy84AgYKAQEDCYkfAQE?= X-IronPort-AV: E=Sophos;i="5.81,291,1610409600"; d="scan'208";a="880406225" Received: from alln-core-11.cisco.com ([173.36.13.133]) by rcdn-iport-6.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 30 Mar 2021 17:27:19 +0000 Received: from zorba ([10.24.8.123]) by alln-core-11.cisco.com (8.15.2/8.15.2) with ESMTPS id 12UHREPN013894 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 30 Mar 2021 17:27:16 GMT Date: Tue, 30 Mar 2021 10:27:14 -0700 From: Daniel Walker To: Christophe Leroy Cc: will@kernel.org, robh@kernel.org, daniel@gimpelevich.san-francisco.ca.us, linux-arch@vger.kernel.org, devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, microblaze , linux-mips@vger.kernel.org, nios2 , openrisc@lists.librecores.org, linux-hexagon@vger.kernel.org, linux-riscv@lists.infradead.org, x86@kernel.org, linux-xtensa@linux-xtensa.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org Subject: Re: [PATCH v3 01/17] cmdline: Add generic function to build command line. Message-ID: <20210330172714.GR109100@zorba> References: <878228ad88df38f8914c7aa25dede3ed05c50f48.1616765869.git.christophe.leroy@csgroup.eu> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <878228ad88df38f8914c7aa25dede3ed05c50f48.1616765869.git.christophe.leroy@csgroup.eu> X-Outbound-SMTP-Client: 10.24.8.123, [10.24.8.123] X-Outbound-Node: alln-core-11.cisco.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210330_182724_401204_E39CB165 X-CRM114-Status: GOOD ( 21.15 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Fri, Mar 26, 2021 at 01:44:48PM +0000, Christophe Leroy wrote: > This code provides architectures with a way to build command line > based on what is built in the kernel and what is handed over by the > bootloader, based on selected compile-time options. > > Signed-off-by: Christophe Leroy > --- > v3: > - Addressed comments from Will > - Added capability to have src == dst > --- > include/linux/cmdline.h | 57 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 57 insertions(+) > create mode 100644 include/linux/cmdline.h > > diff --git a/include/linux/cmdline.h b/include/linux/cmdline.h > new file mode 100644 > index 000000000000..dea87edd41be > --- /dev/null > +++ b/include/linux/cmdline.h > @@ -0,0 +1,57 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +#ifndef _LINUX_CMDLINE_H > +#define _LINUX_CMDLINE_H > + > +#include > + > +/* Allow architectures to override strlcat, powerpc can't use strings so early */ > +#ifndef cmdline_strlcat > +#define cmdline_strlcat strlcat > +#endif > + > +/* > + * This function will append or prepend a builtin command line to the command > + * line provided by the bootloader. Kconfig options can be used to alter > + * the behavior of this builtin command line. > + * @dst: The destination of the final appended/prepended string. > + * @src: The starting string or NULL if there isn't one. > + * @len: the length of dest buffer. > + */ Append or prepend ? Cisco requires both at the same time. This is why my implementation provides both. I can't use this with both at once. Daniel _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7173AC433DB for ; Tue, 30 Mar 2021 17:27:53 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D2E466196C for ; Tue, 30 Mar 2021 17:27:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D2E466196C Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=cisco.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4F8xGv22n0z3bxJ for ; Wed, 31 Mar 2021 04:27:51 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=cisco.com header.i=@cisco.com header.a=rsa-sha256 header.s=iport header.b=II5NU/e0; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=cisco.com (client-ip=173.37.86.77; helo=rcdn-iport-6.cisco.com; envelope-from=danielwa@cisco.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=cisco.com header.i=@cisco.com header.a=rsa-sha256 header.s=iport header.b=II5NU/e0; dkim-atps=neutral Received: from rcdn-iport-6.cisco.com (rcdn-iport-6.cisco.com [173.37.86.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4F8xGN4bYxz3bcq for ; Wed, 31 Mar 2021 04:27:23 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1640; q=dns/txt; s=iport; t=1617125245; x=1618334845; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=DLlq6Eg2HUUvE9Fdg0Ebob6Tw5pX5R4uRXQoNV4sDwc=; b=II5NU/e0omr/fcsPCXcBYrO3Foi1Ywy5VY9dCEAGHfqavRMhFuXE2rkh mWTvCx+ny3zuihpnczcoN8hmD24SfD9GDXSupCirwN45nRVxVP+Q+XKn7 QDB0uJkyOfw6MBfmWbZ+TiZzis+VO1r8FOHMh8/P59dU/VYByduXcYzA4 g=; IronPort-HdrOrdr: =?us-ascii?q?A9a23=3AoTmckqE8NgKcaaN3pLqEVceALOonbusQ8z?= =?us-ascii?q?AX/mp6ICY7TuWzkceykPMHkTL1ki8WQnE8mdaGUZPwJE/035hz/IUXIPOeTB?= =?us-ascii?q?Dr0VHYTr1KwIP+z1TbcRHW2fVa0c5bHpRWKNq1NlRiiNa/3Q/QKadF/PCi0I?= =?us-ascii?q?SFwdjT1G1sSwYCUdAC0y5cBhyAGkN7AClqbKBZKLOm6sBKpyWtdB0sB6zROl?= =?us-ascii?q?A/U+fOvNHNnp79CCRnOzcc9AKMgTm0gYSVLzGk2H4lPw9n8PMF7XXPlRD/6+?= =?us-ascii?q?GFtfy2oyWssVP73tBxhMbrzMdFCYi3rvUtbh/oigquee1aKtq/gAw=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0BhAABKXmNg/4UNJK1aHAEBAQEBAQc?= =?us-ascii?q?BARIBAQQEAQFAgTwHAQELAYIqgUwBOTGMZYkukAgWikWBfAsBAQENAQE0BAE?= =?us-ascii?q?BhFACgXoCJTQJDgIDAQEMAQEFAQEBAgEGBHGFboZFAQU6PxALGC48GwYThXi?= =?us-ascii?q?rInWBNIkLgUQigRcBjUkmHIFJQoESgm4uPoo2BIJHgQ6CMCyeTZwigxGBI5s?= =?us-ascii?q?2MRCkQrgSAgQGBQIWgVQ6gVkzGggbFYMkUBkNnQchAy84AgYKAQEDCYkfAQE?= X-IronPort-AV: E=Sophos;i="5.81,291,1610409600"; d="scan'208";a="880406225" Received: from alln-core-11.cisco.com ([173.36.13.133]) by rcdn-iport-6.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 30 Mar 2021 17:27:19 +0000 Received: from zorba ([10.24.8.123]) by alln-core-11.cisco.com (8.15.2/8.15.2) with ESMTPS id 12UHREPN013894 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 30 Mar 2021 17:27:16 GMT Date: Tue, 30 Mar 2021 10:27:14 -0700 From: Daniel Walker To: Christophe Leroy Subject: Re: [PATCH v3 01/17] cmdline: Add generic function to build command line. Message-ID: <20210330172714.GR109100@zorba> References: <878228ad88df38f8914c7aa25dede3ed05c50f48.1616765869.git.christophe.leroy@csgroup.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <878228ad88df38f8914c7aa25dede3ed05c50f48.1616765869.git.christophe.leroy@csgroup.eu> X-Outbound-SMTP-Client: 10.24.8.123, [10.24.8.123] X-Outbound-Node: alln-core-11.cisco.com X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, robh@kernel.org, microblaze , daniel@gimpelevich.san-francisco.ca.us, devicetree@vger.kernel.org, linux-sh@vger.kernel.org, will@kernel.org, linux-xtensa@linux-xtensa.org, x86@kernel.org, linux-kernel@vger.kernel.org, nios2 , linux-mips@vger.kernel.org, openrisc@lists.librecores.org, linux-hexagon@vger.kernel.org, sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, Mar 26, 2021 at 01:44:48PM +0000, Christophe Leroy wrote: > This code provides architectures with a way to build command line > based on what is built in the kernel and what is handed over by the > bootloader, based on selected compile-time options. > > Signed-off-by: Christophe Leroy > --- > v3: > - Addressed comments from Will > - Added capability to have src == dst > --- > include/linux/cmdline.h | 57 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 57 insertions(+) > create mode 100644 include/linux/cmdline.h > > diff --git a/include/linux/cmdline.h b/include/linux/cmdline.h > new file mode 100644 > index 000000000000..dea87edd41be > --- /dev/null > +++ b/include/linux/cmdline.h > @@ -0,0 +1,57 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +#ifndef _LINUX_CMDLINE_H > +#define _LINUX_CMDLINE_H > + > +#include > + > +/* Allow architectures to override strlcat, powerpc can't use strings so early */ > +#ifndef cmdline_strlcat > +#define cmdline_strlcat strlcat > +#endif > + > +/* > + * This function will append or prepend a builtin command line to the command > + * line provided by the bootloader. Kconfig options can be used to alter > + * the behavior of this builtin command line. > + * @dst: The destination of the final appended/prepended string. > + * @src: The starting string or NULL if there isn't one. > + * @len: the length of dest buffer. > + */ Append or prepend ? Cisco requires both at the same time. This is why my implementation provides both. I can't use this with both at once. Daniel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A334C433DB for ; Tue, 30 Mar 2021 17:29:21 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C88F3619CD for ; Tue, 30 Mar 2021 17:29:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C88F3619CD Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=cisco.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=38lxEc++SWruZYwdlm1AYOR0ZFK3K3V2HvMfj1d4zJA=; b=j061VfcdAEOKBvF63TxjNt7zH pVE6fyjyuA5XdKuU5TMZgCXM/y05VULPmBLAhhVrmH1a2D2DXQdwisAUgZpmlcwiE0iOxpR1/jXYw af9FX3K+CVmnugB9zuSZY/PL89z3L9gubDkSyBdUNl9SZ/ULdXdNS6/ZZhHO+XjO4b7RunCPnmBPF +aPDyioTWMgMeFidrbE0Wd1K6f89Jcuwtlh/zWKJZiAFKqTyEp7IT03t/lxCKwG8/p/CuaaZ/9HQ4 u8RPi3gUr9KdvllXEjlDP+06EWMuWimwwqUTabzHs3seWQhvKoqxfWC4tihWcOj/6rVQn0hH8zczp hCdN05sCQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lRI9S-004RgW-WB; Tue, 30 Mar 2021 17:27:39 +0000 Received: from rcdn-iport-6.cisco.com ([173.37.86.77]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lRI9D-004ReN-U3; Tue, 30 Mar 2021 17:27:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1640; q=dns/txt; s=iport; t=1617125244; x=1618334844; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=DLlq6Eg2HUUvE9Fdg0Ebob6Tw5pX5R4uRXQoNV4sDwc=; b=AZ/drV3Wsv41owZ2NuZOdxoA8nTddNyk+eV/sp/13WYgrgFBYjT5oEwC 6eczwoU1uQdLWtDyPcr6e5wKY1DN0A2EGJMXo3TxAQizmdTfZXj0ZKCT7 SvAywcgfgOQ+rtfU/zG6BUD9omFdFLEu+Nf54mvwZ5eDCzABulq2MT1W3 8=; IronPort-HdrOrdr: =?us-ascii?q?A9a23=3AoTmckqE8NgKcaaN3pLqEVceALOonbusQ8z?= =?us-ascii?q?AX/mp6ICY7TuWzkceykPMHkTL1ki8WQnE8mdaGUZPwJE/035hz/IUXIPOeTB?= =?us-ascii?q?Dr0VHYTr1KwIP+z1TbcRHW2fVa0c5bHpRWKNq1NlRiiNa/3Q/QKadF/PCi0I?= =?us-ascii?q?SFwdjT1G1sSwYCUdAC0y5cBhyAGkN7AClqbKBZKLOm6sBKpyWtdB0sB6zROl?= =?us-ascii?q?A/U+fOvNHNnp79CCRnOzcc9AKMgTm0gYSVLzGk2H4lPw9n8PMF7XXPlRD/6+?= =?us-ascii?q?GFtfy2oyWssVP73tBxhMbrzMdFCYi3rvUtbh/oigquee1aKtq/gAw=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0BhAABKXmNg/4UNJK1aHAEBAQEBAQc?= =?us-ascii?q?BARIBAQQEAQFAgTwHAQELAYIqgUwBOTGMZYkukAgWikWBfAsBAQENAQE0BAE?= =?us-ascii?q?BhFACgXoCJTQJDgIDAQEMAQEFAQEBAgEGBHGFboZFAQU6PxALGC48GwYThXi?= =?us-ascii?q?rInWBNIkLgUQigRcBjUkmHIFJQoESgm4uPoo2BIJHgQ6CMCyeTZwigxGBI5s?= =?us-ascii?q?2MRCkQrgSAgQGBQIWgVQ6gVkzGggbFYMkUBkNnQchAy84AgYKAQEDCYkfAQE?= X-IronPort-AV: E=Sophos;i="5.81,291,1610409600"; d="scan'208";a="880406225" Received: from alln-core-11.cisco.com ([173.36.13.133]) by rcdn-iport-6.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 30 Mar 2021 17:27:19 +0000 Received: from zorba ([10.24.8.123]) by alln-core-11.cisco.com (8.15.2/8.15.2) with ESMTPS id 12UHREPN013894 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 30 Mar 2021 17:27:16 GMT Date: Tue, 30 Mar 2021 10:27:14 -0700 From: Daniel Walker To: Christophe Leroy Cc: will@kernel.org, robh@kernel.org, daniel@gimpelevich.san-francisco.ca.us, linux-arch@vger.kernel.org, devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, microblaze , linux-mips@vger.kernel.org, nios2 , openrisc@lists.librecores.org, linux-hexagon@vger.kernel.org, linux-riscv@lists.infradead.org, x86@kernel.org, linux-xtensa@linux-xtensa.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org Subject: Re: [PATCH v3 01/17] cmdline: Add generic function to build command line. Message-ID: <20210330172714.GR109100@zorba> References: <878228ad88df38f8914c7aa25dede3ed05c50f48.1616765869.git.christophe.leroy@csgroup.eu> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <878228ad88df38f8914c7aa25dede3ed05c50f48.1616765869.git.christophe.leroy@csgroup.eu> X-Outbound-SMTP-Client: 10.24.8.123, [10.24.8.123] X-Outbound-Node: alln-core-11.cisco.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210330_182724_401204_E39CB165 X-CRM114-Status: GOOD ( 21.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Mar 26, 2021 at 01:44:48PM +0000, Christophe Leroy wrote: > This code provides architectures with a way to build command line > based on what is built in the kernel and what is handed over by the > bootloader, based on selected compile-time options. > > Signed-off-by: Christophe Leroy > --- > v3: > - Addressed comments from Will > - Added capability to have src == dst > --- > include/linux/cmdline.h | 57 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 57 insertions(+) > create mode 100644 include/linux/cmdline.h > > diff --git a/include/linux/cmdline.h b/include/linux/cmdline.h > new file mode 100644 > index 000000000000..dea87edd41be > --- /dev/null > +++ b/include/linux/cmdline.h > @@ -0,0 +1,57 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +#ifndef _LINUX_CMDLINE_H > +#define _LINUX_CMDLINE_H > + > +#include > + > +/* Allow architectures to override strlcat, powerpc can't use strings so early */ > +#ifndef cmdline_strlcat > +#define cmdline_strlcat strlcat > +#endif > + > +/* > + * This function will append or prepend a builtin command line to the command > + * line provided by the bootloader. Kconfig options can be used to alter > + * the behavior of this builtin command line. > + * @dst: The destination of the final appended/prepended string. > + * @src: The starting string or NULL if there isn't one. > + * @len: the length of dest buffer. > + */ Append or prepend ? Cisco requires both at the same time. This is why my implementation provides both. I can't use this with both at once. Daniel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Walker Date: Tue, 30 Mar 2021 10:27:14 -0700 Subject: [OpenRISC] [PATCH v3 01/17] cmdline: Add generic function to build command line. In-Reply-To: <878228ad88df38f8914c7aa25dede3ed05c50f48.1616765869.git.christophe.leroy@csgroup.eu> References: <878228ad88df38f8914c7aa25dede3ed05c50f48.1616765869.git.christophe.leroy@csgroup.eu> Message-ID: <20210330172714.GR109100@zorba> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: openrisc@lists.librecores.org On Fri, Mar 26, 2021 at 01:44:48PM +0000, Christophe Leroy wrote: > This code provides architectures with a way to build command line > based on what is built in the kernel and what is handed over by the > bootloader, based on selected compile-time options. > > Signed-off-by: Christophe Leroy > --- > v3: > - Addressed comments from Will > - Added capability to have src == dst > --- > include/linux/cmdline.h | 57 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 57 insertions(+) > create mode 100644 include/linux/cmdline.h > > diff --git a/include/linux/cmdline.h b/include/linux/cmdline.h > new file mode 100644 > index 000000000000..dea87edd41be > --- /dev/null > +++ b/include/linux/cmdline.h > @@ -0,0 +1,57 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +#ifndef _LINUX_CMDLINE_H > +#define _LINUX_CMDLINE_H > + > +#include > + > +/* Allow architectures to override strlcat, powerpc can't use strings so early */ > +#ifndef cmdline_strlcat > +#define cmdline_strlcat strlcat > +#endif > + > +/* > + * This function will append or prepend a builtin command line to the command > + * line provided by the bootloader. Kconfig options can be used to alter > + * the behavior of this builtin command line. > + * @dst: The destination of the final appended/prepended string. > + * @src: The starting string or NULL if there isn't one. > + * @len: the length of dest buffer. > + */ Append or prepend ? Cisco requires both at the same time. This is why my implementation provides both. I can't use this with both at once. Daniel