From patchwork Thu Nov 10 13:09:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evgeniy Baskov X-Patchwork-Id: 18126 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp147527wru; Thu, 10 Nov 2022 05:29:35 -0800 (PST) X-Google-Smtp-Source: AMsMyM4cJvcPmR3/3iAfl0OT6paudhl3SRpKsX2gZVfhxOXcIwWjhpu6Lf9U5dS4pH2XfOmdJGcm X-Received: by 2002:a65:458a:0:b0:46f:33df:46b0 with SMTP id o10-20020a65458a000000b0046f33df46b0mr54667486pgq.564.1668086975356; Thu, 10 Nov 2022 05:29:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668086975; cv=none; d=google.com; s=arc-20160816; b=xCJDUUkh9pQ27KE5ac7vBRh/9Fcyl81/9OYWPgW5ufaEo2ANDBtwDkSY56dWTlgBHL esCrz0FIBilaXjdYEUsDOzBkLDB7Z8F3igecVCdCYU3cPSRisbAOl4rT/n3oa5Der1fM mAeIEAAPjK+UmFqFUv+RBIg3/zxkkeSK7oDrkJWtE8FwcNr/cp1IMjKlIq83L1dLuuMe Jc3Alwq2s0zIv4Ox9op9snuIgWZh6+IxDeH9t7UXnd7gkjJmf+nl0UFNPiTLkhuQZ/Sf 6USMX5sTX0yGqDuW6gPECFMllzCyB4Dx0kXUa28vzAM9wUDK8kaolSZhfSsyfKKX+tNw b+JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=IMZzqDsGqe80LCdtrLJ2hWF1Y/2kWqXMkN9RKfL+9hU=; b=hb39VHi2iSk1PBT2XoEWRS1SgJb9GFRYSqr16pgE8wuWPUX4fhftrAH8fTNOx+cR96 cC326q6mT+6DxH6iUrKMfHtw/ldMlDQmpLZZwrMPIIB5M/BbhSoc3i8EMs5S5HM7c+aX l47kyhm8ai7Nq7PUzpfR2h4OJ6SSI7qmKNfmtSlpeut/ngU90wJaGNqmHOYSPaCdJeDo BvbeDh7yXb5/7Jy5+olWuiqkCLOEUWcQXqVqdwQmyt3NyLuySRVBfvF8ifJalF2mje+W KV094NEOos68LOPiXdgIXvRfCiKoR8oQVF29jTrWCVG93fObx4jpR5945JXjtBN0XysQ QiCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=AtC3FqEa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z196-20020a6333cd000000b004227041e9d2si21473172pgz.405.2022.11.10.05.29.20; Thu, 10 Nov 2022 05:29:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=AtC3FqEa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230376AbiKJNJx (ORCPT + 99 others); Thu, 10 Nov 2022 08:09:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230224AbiKJNJj (ORCPT ); Thu, 10 Nov 2022 08:09:39 -0500 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 024A710FCE for ; Thu, 10 Nov 2022 05:09:37 -0800 (PST) Received: from localhost.localdomain (unknown [83.149.199.65]) by mail.ispras.ru (Postfix) with ESMTPSA id EC73E40737B7; Thu, 10 Nov 2022 13:09:35 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru EC73E40737B7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1668085776; bh=IMZzqDsGqe80LCdtrLJ2hWF1Y/2kWqXMkN9RKfL+9hU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AtC3FqEayeP++jRNm0DOfsflkG9yKFxgY7kxZXP5Vsfa04ihWpLyzL3oarSwkGdCm SSCH8fxSb9/D+yVyySJIxiiB7Rh+znkLG3fa/lY/epl6gaDnJ8pAqpU7Qd5Tcgy8Op +q7rcqoCc5cyOo0bwOCIOQGkzQoKO7Q7jnTpNWfY= From: Evgeniy Baskov To: Borislav Petkov Cc: Evgeniy Baskov , Dave Hansen , Ingo Molnar , Thomas Gleixner , linux-kernel@vger.kernel.org, x86@kernel.org, Alexey Khoroshilov Subject: [PATCH v8 3/5] x86/setup: Use cmdline_prepare() in setup.c Date: Thu, 10 Nov 2022 16:09:31 +0300 Message-Id: X-Mailer: git-send-email 2.37.4 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749115968382632167?= X-GMAIL-MSGID: =?utf-8?q?1749115968382632167?= Use a common helper function for command line resolving in arch/x86/kernel/setup.c for code unification. Signed-off-by: Evgeniy Baskov --- arch/x86/kernel/setup.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index aacaa96f0195..f23a49f62b71 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -168,9 +169,6 @@ unsigned long saved_video_mode; #define RAMDISK_LOAD_FLAG 0x4000 static char __initdata command_line[COMMAND_LINE_SIZE]; -#ifdef CONFIG_CMDLINE_BOOL -static char __initdata builtin_cmdline[COMMAND_LINE_SIZE] = CONFIG_CMDLINE; -#endif #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE) struct edd edd; @@ -970,20 +968,8 @@ void __init setup_arch(char **cmdline_p) bss_resource.start = __pa_symbol(__bss_start); bss_resource.end = __pa_symbol(__bss_stop)-1; -#ifdef CONFIG_CMDLINE_BOOL -#ifdef CONFIG_CMDLINE_OVERRIDE - strscpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); -#else - if (builtin_cmdline[0]) { - /* append boot loader cmdline to builtin */ - strlcat(builtin_cmdline, " ", COMMAND_LINE_SIZE); - strlcat(builtin_cmdline, boot_command_line, COMMAND_LINE_SIZE); - strscpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); - } -#endif -#endif - - strscpy(command_line, boot_command_line, COMMAND_LINE_SIZE); + cmdline_prepare(command_line, boot_command_line); + strscpy(boot_command_line, command_line, COMMAND_LINE_SIZE); *cmdline_p = command_line; /*