Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1357163pxf; Fri, 2 Apr 2021 08:20:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxddyLYE55IPUaXUmPeg9Ez8OBpQN26adfjR4ZMBQ1Wdd+drNE7J3mAFm3ePSqvflmgQaIO X-Received: by 2002:a17:907:d10:: with SMTP id gn16mr14350126ejc.304.1617376816836; Fri, 02 Apr 2021 08:20:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617376816; cv=none; d=google.com; s=arc-20160816; b=oZN/g04LrTKzqb/kKq0CcbaWwrTQascAVFc2GtO6bpeeGwhoqwXPxS/MRp/o5aBcNV SAYLA2kjGwCjvQIuOPG051/EFd2Y8c608uAWq12XzxS0Rd/6yQ33yK5Aqk+5RYVOHNb/ xRh9SGXt48qg7rpSw/4dIxidtMg49cwBENICuHGskqRJUrcDSAJGEB/Af/Sdty30E8kG GGoldx+YTEruAvdRyz++BpgH8dsDua97o/fdfBb1+eGwayQyokzTi9nXnZrDuFGZChA4 FwiCasqcYepUMiprGhrpJr9tz6oVuFjqjwB4MeSsz4Vkzbhze3U7lhpvFRlRVJAhZeYn 8H3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:cc:to:subject:from:references:in-reply-to :message-id; bh=KnGukWq8qxs2BMX/yN1UHRo2D8l/N6dQMLhN6azmX0c=; b=NFJYUqbXEn4V02n3gw72HFiAxmZ+Tg7tR+KPJtynHY8Mog/p5sEc2u1tXt+bhQwPpi SHn7M/+ZuXX/jmPSrIo5IdBs1TohdiVRAObP9waRoxxOyJqk1SrgyvsUZZDlX+D6to8j e3dzKbC9wokmg1nerAomReKC3Rih+P5YuvFBmRTdI77jstLAVpuElkK/HgW9G1Ma4ak1 L3zjc9v223GQGWiVbTYq/uWKlg5ZLOZobxKevFP18ZJ990D1Ah45Ez1+U3Hq0suQ8+a+ oul0Xk5/q7dkZcYI3d8UrKkoRVWpz/RIMyRuMeekhmkjVW5N0HcrgtA9AK4Hp8Vosddy j1ZQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j9si6822300edw.509.2021.04.02.08.19.53; Fri, 02 Apr 2021 08:20:16 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236199AbhDBPSh (ORCPT + 99 others); Fri, 2 Apr 2021 11:18:37 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:18530 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235695AbhDBPSS (ORCPT ); Fri, 2 Apr 2021 11:18:18 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FBkFx03zqz9v2m3; Fri, 2 Apr 2021 17:18:13 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id A8kam4b7TJbi; Fri, 2 Apr 2021 17:18:12 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4FBkFw53rLz9v2ls; Fri, 2 Apr 2021 17:18:12 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 7C7E18BB7F; Fri, 2 Apr 2021 17:18:14 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id H5LeedaB8gob; Fri, 2 Apr 2021 17:18:14 +0200 (CEST) Received: from po16121vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 25D4A8BB79; Fri, 2 Apr 2021 17:18:14 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 0385767989; Fri, 2 Apr 2021 15:18:13 +0000 (UTC) Message-Id: <9b4899b0abc156eb207b19fe0b24dd5bf0355b99.1617375802.git.christophe.leroy@csgroup.eu> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 12/20] nios2: Convert to GENERIC_CMDLINE To: will@kernel.org, danielwa@cisco.com, robh@kernel.org, daniel@gimpelevich.san-francisco.ca.us, arnd@kernel.org, akpm@linux-foundation.org Cc: linux-arch@vger.kernel.org, devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.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, linux-mm@kvack.org Date: Fri, 2 Apr 2021 15:18:13 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This converts the architecture to GENERIC_CMDLINE. Signed-off-by: Christophe Leroy --- v4: Added missing selection of CONFIG_GENERIC_CMDLINE in Kconfig --- arch/nios2/Kconfig | 25 ++----------------------- arch/nios2/kernel/setup.c | 13 ++++--------- 2 files changed, 6 insertions(+), 32 deletions(-) diff --git a/arch/nios2/Kconfig b/arch/nios2/Kconfig index c24955c81c92..6018f3d626f8 100644 --- a/arch/nios2/Kconfig +++ b/arch/nios2/Kconfig @@ -10,6 +10,7 @@ config NIOS2 select COMMON_CLK select TIMER_OF select GENERIC_ATOMIC64 + select GENERIC_CMDLINE select GENERIC_CPU_DEVICES select GENERIC_IRQ_PROBE select GENERIC_IRQ_SHOW @@ -90,31 +91,9 @@ config NIOS2_ALIGNMENT_TRAP comment "Boot options" -config CMDLINE_BOOL - bool "Default bootloader kernel arguments" - default y - -config CMDLINE - string "Default kernel command string" - default "" - depends on CMDLINE_BOOL - help - On some platforms, there is currently no way for the boot loader to - pass arguments to the kernel. For these platforms, you can supply - some command-line options at build time by entering them here. In - other cases you can specify kernel args so that you don't have - to set them up in board prom initialization routines. - -config CMDLINE_FORCE - bool "Force default kernel command string" - depends on CMDLINE_BOOL - help - Set this to have arguments from the default kernel command string - override those passed by the boot loader. - config NIOS2_CMDLINE_IGNORE_DTB bool "Ignore kernel command string from DTB" - depends on CMDLINE_BOOL + depends on CMDLINE != "" depends on !CMDLINE_FORCE default y help diff --git a/arch/nios2/kernel/setup.c b/arch/nios2/kernel/setup.c index d2f21957e99c..5b38d3d0ad64 100644 --- a/arch/nios2/kernel/setup.c +++ b/arch/nios2/kernel/setup.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -108,7 +109,7 @@ asmlinkage void __init nios2_boot_init(unsigned r4, unsigned r5, unsigned r6, unsigned r7) { unsigned dtb_passed = 0; - char cmdline_passed[COMMAND_LINE_SIZE] __maybe_unused = { 0, }; + char cmdline_passed[COMMAND_LINE_SIZE] = { 0, }; #if defined(CONFIG_NIOS2_PASS_CMDLINE) if (r4 == 0x534f494e) { /* r4 is magic NIOS */ @@ -127,14 +128,8 @@ asmlinkage void __init nios2_boot_init(unsigned r4, unsigned r5, unsigned r6, early_init_devtree((void *)dtb_passed); -#ifndef CONFIG_CMDLINE_FORCE - if (cmdline_passed[0]) - strlcpy(boot_command_line, cmdline_passed, COMMAND_LINE_SIZE); -#ifdef CONFIG_NIOS2_CMDLINE_IGNORE_DTB - else - strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE); -#endif -#endif + if (cmdline_passed[0] || IS_ENABLED(CONFIG_NIOS2_CMDLINE_IGNORE_DTB)) + cmdline_build(boot_command_line, cmdline_passed); parse_early_param(); } -- 2.25.0