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 Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 904E3C43334 for ; Thu, 16 Jun 2022 22:40:59 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 115AA8440F; Fri, 17 Jun 2022 00:40:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com 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=amarulasolutions.com header.i=@amarulasolutions.com header.b="rQe31bNl"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1A0A28440F; Fri, 17 Jun 2022 00:40:55 +0200 (CEST) Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (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 B33C8844AB for ; Fri, 17 Jun 2022 00:33:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=francis.laniel@amarulasolutions.com Received: by mail-wm1-x329.google.com with SMTP id l2-20020a05600c4f0200b0039c55c50482so3514816wmq.0 for ; Thu, 16 Jun 2022 15:33:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wRJs+50zk54JA9e0DVaMy5GnWFAIk1lXDQt/rwQSgAc=; b=rQe31bNlI5k715SPiDoSU0nPWf/pK11vZw4YXEsCS4Ec2Qpe2/RvokqW6KIkmPWBRh +jx8EXrw6u0cnAIJ3Kh5LiJNgdjvuoEXv2tNtD4hNvyIye8QweYpIammTauWaDvjyZvg sM5b1ka7k5I2i/di4m93nWXV/JCVfe8YPaGRM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wRJs+50zk54JA9e0DVaMy5GnWFAIk1lXDQt/rwQSgAc=; b=vyvyI5LGVxMHztDNBXRmBBJRmWI+ckoc31Nd1O7rKcVzhBEL0isvgFuU6p10hCdlC+ pVGLxBveog9XV4FoS0997oxBRKiFnRoWJE9ITKf9DfGbyrJg6Dli/hlgEWT1VAT4xCE9 pLAYeXLyMgLHr4Rp0ud1IB5zTddmMeAcqtOqbpQjjQzth8PGbrHVya8XAer/nXJT89No qf8Rxmi8MKBLIoY3vbxxE3XuXnErBY+I554+L/JHQlg7mTqP7DmUgYyK2shptxHcFGC6 D6J4IAVnTZOCMfFbccSoEuFGeWnBDMqfd0F6WBl0RsqmSSeIFH3DXNaswQH0xb1rIuq6 QXNQ== X-Gm-Message-State: AJIora+AxI9uJ9aaMLuUUfQDdOgmbf+KUihw4Ju5ukKxRMJ67Fb+9cRK rsuove53TrwZUxAPbJvlT3emXH1eBLaWgQ== X-Google-Smtp-Source: AGRyM1vNfVVVVQfoQH08Yaae5YUaxDzbjPXKtuUkLViwpHc88he+rxA6DkSygShNHI0ZAQ9PcHYC2A== X-Received: by 2002:a05:600c:3b02:b0:397:5cfb:b849 with SMTP id m2-20020a05600c3b0200b003975cfbb849mr7021260wms.183.1655418808836; Thu, 16 Jun 2022 15:33:28 -0700 (PDT) Received: from pwmachine.home (17.pool80-103-97.dynamic.orange.es. [80.103.97.17]) by smtp.gmail.com with ESMTPSA id n4-20020a05600c4f8400b003971fc23185sm7912044wmq.20.2022.06.16.15.33.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jun 2022 15:33:28 -0700 (PDT) From: Francis Laniel To: u-boot@lists.denx.de Cc: Marek Behun , Michael Nazzareno Trimarchi , Simon Glass , Wolfgang Denk , Harald Seiler , Tom Rini , Francis Laniel Subject: [RFC PATCH v4 28/28] board: keymile: common: Use environment to store IVM_* variables. Date: Fri, 17 Jun 2022 00:31:58 +0200 Message-Id: <20220616223158.9225-29-francis.laniel@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220616223158.9225-1-francis.laniel@amarulasolutions.com> References: <20220616223158.9225-1-francis.laniel@amarulasolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.5 at phobos.denx.de X-Virus-Status: Clean These boards used set_local_var() to store some variables as local shell. They then used get_local_var() to retrieve the variables values. Instead of using local shell variables, they should use environment ones (like a majority of board). So, this patch converts using local variables to environment ones. Signed-off-by: Francis Laniel --- board/keymile/common/common.c | 8 ++++---- board/keymile/common/ivm.c | 9 +-------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c index 3999f48719..72939af36e 100644 --- a/board/keymile/common/common.c +++ b/board/keymile/common/common.c @@ -219,7 +219,7 @@ static int do_setboardid(struct cmd_tbl *cmdtp, int flag, int argc, unsigned char buf[32]; char *p; - p = get_local_var("IVM_BoardId"); + p = env_get("IVM_BoardId"); if (!p) { printf("can't get the IVM_Boardid\n"); return 1; @@ -228,7 +228,7 @@ static int do_setboardid(struct cmd_tbl *cmdtp, int flag, int argc, env_set("boardid", (char *)buf); printf("set boardid=%s\n", buf); - p = get_local_var("IVM_HWKey"); + p = env_get("IVM_HWKey"); if (!p) { printf("can't get the IVM_HWKey\n"); return 1; @@ -272,14 +272,14 @@ static int do_checkboardidhwk(struct cmd_tbl *cmdtp, int flag, int argc, * first read out the real inventory values, these values are * already stored in the local hush variables */ - p = get_local_var("IVM_BoardId"); + p = env_get("IVM_BoardId"); if (!p) { printf("can't get the IVM_Boardid\n"); return 1; } rc = strict_strtoul(p, 16, &ivmbid); - p = get_local_var("IVM_HWKey"); + p = env_get("IVM_HWKey"); if (!p) { printf("can't get the IVM_HWKey\n"); return 1; diff --git a/board/keymile/common/ivm.c b/board/keymile/common/ivm.c index 67db0c50f4..e266d7ce81 100644 --- a/board/keymile/common/ivm.c +++ b/board/keymile/common/ivm.c @@ -44,14 +44,7 @@ static int ivm_calc_crc(unsigned char *buf, int len) static int ivm_set_value(char *name, char *value) { - char tempbuf[256]; - - if (value) { - sprintf(tempbuf, "%s=%s", name, value); - return set_local_var(tempbuf, 0); - } - unset_local_var(name); - return 0; + return env_set(name, value); } static int ivm_get_value(unsigned char *buf, int len, char *name, int off, -- 2.25.1