From patchwork Sun Jul 28 14:03:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1138011 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="V8Yb19sR"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45xQ8t2r1Xz9s4Y for ; Mon, 29 Jul 2019 00:25:50 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id F0AC6C21E18; Sun, 28 Jul 2019 14:14:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 726E5C21C2F; Sun, 28 Jul 2019 14:08:51 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A8ECDC21E18; Sun, 28 Jul 2019 14:06:39 +0000 (UTC) Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) by lists.denx.de (Postfix) with ESMTPS id 55D7BC21E2F for ; Sun, 28 Jul 2019 14:06:36 +0000 (UTC) Received: by mail-io1-f66.google.com with SMTP id j5so110363269ioj.8 for ; Sun, 28 Jul 2019 07:06:36 -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=CinBlh2+VbnV6KFoz+u8ALe+3jcIWRqBHKIk7HzjesA=; b=V8Yb19sRswF/IVtOmC0bJ8VFZUVYrG/ZNeeMDl+0VcRYWQ3H27SN/oBRyAhfdcZ8mX WlSF5cY240oFdus6seDWa3E8Us9Sh+F7DM+MBJNWnDCGSy1ugEKf2INtwUJ0BGTppMj1 Sfng0t7OveQLwsifQ4+LD+X4cIMl2OpfTFcgE= 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=CinBlh2+VbnV6KFoz+u8ALe+3jcIWRqBHKIk7HzjesA=; b=n6xaj2EYjyTjKoDs5a/Qh2qpYYQvrv63NFvCxMtzjo3qdizHq9TTV3x7fyU87DFknF aTvouVltMyihWAfRkaz+IdH2aEuatasJwu+SRiQ/8AH/D+jcOSmX56Zg2MuTy2MlwczF 2jtJqel2qPFHXYJuonkcDn3Jju8Bi+CNjoUfXiXmiPmKY9KlhSU6iaXd736OjIi4SYJE S0e11SXWzknvZEfWpC5+cUaT00tQW54OacwuUuByLX68iEBcfgHIcWRMPrFgTACZWDGp WkNOyOajj5QZMwYT6Y+My2x/+fBPtKJGPf5gufO7tBSKXLrXqBKDZh55Lq3TpR7tjhpM oz3A== X-Gm-Message-State: APjAAAVwEyUf+ghbBRK6hRq0UddZvoFxidgPEFErEj1CbLfWI6MeEZsp Tf1fsSm/si6YtHy7+MFxqxk/EZPnaOI= X-Google-Smtp-Source: APXvYqzLAM1ote0KRscjhfhpxXwt9+0aBWetZWUfispRAc1lHowTrmpds6ZkMyvckhbo8/+9PvG1ag== X-Received: by 2002:a6b:1ca:: with SMTP id 193mr100548738iob.264.1564322795172; Sun, 28 Jul 2019 07:06:35 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id t5sm46782450iol.55.2019.07.28.07.06.34 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 28 Jul 2019 07:06:34 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sun, 28 Jul 2019 08:03:37 -0600 Message-Id: <20190728140357.137295-21-sjg@chromium.org> X-Mailer: git-send-email 2.22.0.709.g102302147b-goog In-Reply-To: <20190728140357.137295-1-sjg@chromium.org> References: <20190728140357.137295-1-sjg@chromium.org> MIME-Version: 1.0 Cc: Joe Hershberger , Tom Rini Subject: [U-Boot] [PATCH 20/39] env: Move set_default_vars to env.h X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" Move this function to the new header file and rename it so it has an env_ prefix. Signed-off-by: Simon Glass Acked-by: Joe Hershberger --- cmd/nvedit.c | 2 +- env/common.c | 2 +- include/env.h | 11 +++++++++++ include/environment.h | 3 --- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/cmd/nvedit.c b/cmd/nvedit.c index 751b77d0e9..390d040de3 100644 --- a/cmd/nvedit.c +++ b/cmd/nvedit.c @@ -832,7 +832,7 @@ static int do_env_default(cmd_tbl_t *cmdtp, int flag, } if (!all && (argc > 0)) { /* Reset individual variables */ - set_default_vars(argc, argv, env_flag); + env_set_default_vars(argc, argv, env_flag); return 0; } diff --git a/env/common.c b/env/common.c index 1fbc4a874d..db2a033f68 100644 --- a/env/common.c +++ b/env/common.c @@ -92,7 +92,7 @@ void set_default_env(const char *s, int flags) /* [re]set individual variables to their value in the default environment */ -int set_default_vars(int nvars, char * const vars[], int flags) +int env_set_default_vars(int nvars, char * const vars[], int flags) { /* * Special use-case: import from default environment diff --git a/include/env.h b/include/env.h index 924b327c44..5c01cd3d6d 100644 --- a/include/env.h +++ b/include/env.h @@ -198,4 +198,15 @@ void eth_parse_enetaddr(const char *addr, uint8_t *enetaddr); */ void env_fix_drivers(void); +/** + * env_set_default_vars() - reset variables to their default value + * + * This resets individual variables to their value in the default environment + * + * @nvars: Number of variables to set/reset + * @vars: List of variables to set/reset + * @flags: Flags controlling matching (H_... - see search.h) + */ +int env_set_default_vars(int nvars, char *const vars[], int flags); + #endif diff --git a/include/environment.h b/include/environment.h index 7be1ef98ad..97d4886599 100644 --- a/include/environment.h +++ b/include/environment.h @@ -274,9 +274,6 @@ char *env_get_default(const char *name); /* [re]set to the default environment */ void set_default_env(const char *s, int flags); -/* [re]set individual variables to their value in the default environment */ -int set_default_vars(int nvars, char * const vars[], int flags); - /* Import from binary representation into hash table */ int env_import(const char *buf, int check);