From patchwork Mon Oct 19 13:55:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1384318 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=lQJLJKlV; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CFJHK5yq0z9sPB for ; Tue, 20 Oct 2020 00:57:49 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4749D8243C; Mon, 19 Oct 2020 15:56:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="lQJLJKlV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3C45482427; Mon, 19 Oct 2020 15:56:25 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E207C82400 for ; Mon, 19 Oct 2020 15:56:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd41.google.com with SMTP id q25so13051472ioh.4 for ; Mon, 19 Oct 2020 06:56:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=knDg4LZUNRPQuSJgQjSDlW//kt2e5sP9+hTI5gmpel0=; b=lQJLJKlVAz73wmuZuJubQk0P88jH7r1oeDgzR8FqhKCOSORT+1JxDTpwqyIU4Gu/qF iGilcJ3Gwv2LEfoP7+Ch3byUsc3+Uy18houlsvA5OtZgukHoIFlNpsrvyFwdIQoMV/Ri +3WDknLtVsVzRxKahnEdn0kP4Q88OUomRhamo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=knDg4LZUNRPQuSJgQjSDlW//kt2e5sP9+hTI5gmpel0=; b=p/NuIjMBKJqvc1VR8F5s7/0vgURF5MGdr3J4C2ngATLqWEHbtklZ0syQzAX4MptJea 88o+n4BK+2rvkWhwWwCaRv5X/jnk7VcRtVUZWOXMky9g0ES64iG4vEwWH9x93aIj0d0G 0j3n8YrMmup8Prtrrzy6/lBMoH60IVU0nYg8uo1BzcAQWutsW6+yIxpfSKVePKyfZSRj m9dVQTduaiaOwYuKGmMZ2WNq9i4GWJzMh3/15cM1DCxr85fDIncGVrC2r52epyJBkiEp G0n/wCRkgeWiW2+oX3Kl14CLbQudc3m5PS52Tm4X5bGcIFBMsYPhdTDME/kXlRylyS62 qbgg== X-Gm-Message-State: AOAM533h/Zm1xnHpkxuNlTuDzO0q+uliIz4QUUvDQDAPq/kDSRVNCMWN rli1GUV4jcM8ePRGiX5iovkj3j3gFPm/YJAf X-Google-Smtp-Source: ABdhPJymHIPc1ToEpSysoEf961JuaFojEB4ocaX4Au/iYAamnrS2GB9nkyxvSBBhHw2TONHRpxZ42g== X-Received: by 2002:a02:cd9a:: with SMTP id l26mr16990jap.116.1603115774359; Mon, 19 Oct 2020 06:56:14 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id r17sm10164078iov.7.2020.10.19.06.56.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Oct 2020 06:56:13 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , Daniel Schwierzeck , Michael Walle , Tero Kristo Subject: [PATCH 04/11] bootm: Rename fixup_silent_linux() Date: Mon, 19 Oct 2020 07:55:55 -0600 Message-Id: <20201019135602.3943835-5-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog In-Reply-To: <20201019135602.3943835-1-sjg@chromium.org> References: <20201019135602.3943835-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean We want to add more processing to this function. Before doing so, rename it to bootm_process_cmdline_env(), which is more generic. Signed-off-by: Simon Glass --- common/bootm.c | 4 ++-- include/bootm.h | 4 ++-- test/bootm.c | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common/bootm.c b/common/bootm.c index 0ca66188c2b..ace5771d53f 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -466,7 +466,7 @@ ulong bootm_disable_interrupts(void) #define CONSOLE_ARG "console=" #define CONSOLE_ARG_LEN (sizeof(CONSOLE_ARG) - 1) -int fixup_silent_linux(void) +int bootm_process_cmdline_env(void) { char *buf; const char *env_val; @@ -630,7 +630,7 @@ int do_bootm_states(struct cmd_tbl *cmdtp, int flag, int argc, ret = boot_fn(BOOTM_STATE_OS_BD_T, argc, argv, images); if (!ret && (states & BOOTM_STATE_OS_PREP)) { if (images->os.os == IH_OS_LINUX) { - ret = fixup_silent_linux(); + ret = bootm_process_cmdline_env(); if (ret) { printf("Cmdline setup failed (err=%d)\n", ret); ret = CMD_RET_FAILURE; diff --git a/include/bootm.h b/include/bootm.h index 438829af0fe..35c27ab9609 100644 --- a/include/bootm.h +++ b/include/bootm.h @@ -86,13 +86,13 @@ void arch_preboot_os(void); void board_preboot_os(void); /* - * fixup_silent_linux() - Process fix-ups for the command line + * bootm_process_cmdline_env() - Process fix-ups for the command line * * Updates the 'bootargs' envvar as required. This handles making Linux boot * silently if requested ('silent_linux' envvar) * * @return 0 if OK, -ENOMEM if out of memory */ -int fixup_silent_linux(void); +int bootm_process_cmdline_env(void); #endif diff --git a/test/bootm.c b/test/bootm.c index ab1711609ba..b69bfad4f67 100644 --- a/test/bootm.c +++ b/test/bootm.c @@ -23,26 +23,26 @@ static int bootm_test_silent_var(struct unit_test_state *uts) /* 'silent_linux' not set should do nothing */ env_set("silent_linux", NULL); env_set("bootargs", CONSOLE_STR); - ut_assertok(fixup_silent_linux()); + ut_assertok(bootm_process_cmdline_env()); ut_asserteq_str(CONSOLE_STR, env_get("bootargs")); env_set("bootargs", NULL); - ut_assertok(fixup_silent_linux()); + ut_assertok(bootm_process_cmdline_env()); ut_assertnull(env_get("bootargs")); ut_assertok(env_set("silent_linux", "no")); env_set("bootargs", CONSOLE_STR); - ut_assertok(fixup_silent_linux()); + ut_assertok(bootm_process_cmdline_env()); ut_asserteq_str(CONSOLE_STR, env_get("bootargs")); ut_assertok(env_set("silent_linux", "yes")); env_set("bootargs", CONSOLE_STR); - ut_assertok(fixup_silent_linux()); + ut_assertok(bootm_process_cmdline_env()); ut_asserteq_str("console=", env_get("bootargs")); /* Empty buffer should still add the string */ env_set("bootargs", NULL); - ut_assertok(fixup_silent_linux()); + ut_assertok(bootm_process_cmdline_env()); ut_asserteq_str("console=", env_get("bootargs")); return 0;