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 85815C433EF for ; Fri, 17 Jun 2022 14:48:33 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A110B843CC; Fri, 17 Jun 2022 16:48:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.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=konsulko.com header.i=@konsulko.com header.b="HLUyHkU5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B9B74840B6; Fri, 17 Jun 2022 16:48:30 +0200 (CEST) Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com [IPv6:2607:f8b0:4864:20::f2f]) (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 DD5D9843CC for ; Fri, 17 Jun 2022 16:48:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf2f.google.com with SMTP id q104so6710645qvq.8 for ; Fri, 17 Jun 2022 07:48:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=KfCjvPEJCaHhWeYzZZLtxuBg8hwjXf5qsNtcUd5mBmY=; b=HLUyHkU52k82PQow5quEwYrVvSxnXLQMA3L6R6Bh+EM3wETXDOIQXLHU3m49qyqVn9 3O+7k8QqME1x5f+gwo41D7qB1FcPcKbU1fqqRrxH8g4ruaKYh/bmY+3iZ4oPe3d6HZdL AKRR+1fdCPvllrWpqRQCyhtWHdIwQ9A5WG5f4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=KfCjvPEJCaHhWeYzZZLtxuBg8hwjXf5qsNtcUd5mBmY=; b=KIjes0fWaoq/Zzjyz+e/DKqdL9tgmcQgd1pOTrr3OTB7q1IlrgjJl4RCbQsHgaMNwj KNIfnEH99XTvf3JNn8Kn0aRmYW+R0YDFIihX3koJwKVYkbbt1wNWyo5LaTw1vxrU4SAG LnOtIBiYyVFu5y6CdOnmUZ0POLn8RxLO2Faqf/h5NHSid5eOH+rRsgVgxFUQFY5CN9xx SG/rDyDw3A24c43a6kgSQeWrtw3l2Xh/MzfJ8OFSFv7w1l6Qtj2d2ZgNFLbZueqYQ/jm D02CgKIef7Ot/zdygho8gWUKMl0aCfqZzCB6SBblFMNe2LTBp3vRwDSBV3AetouSgvg7 UrkA== X-Gm-Message-State: AJIora/rwl2/zc30l7tr6U+apm+R7C1vGedIW+AhK/zyXIRl8YxI3aHo SlOY3sItInmHc5f/PnP0yJrGPA== X-Google-Smtp-Source: AGRyM1ulM+Khq1EXd54a/b9EmLoXHTH4xs5o4iIKMyTHHbzADyekhSgXuNnzJWgul4MJq7tfuPIRxQ== X-Received: by 2002:a05:6214:2b07:b0:432:f7e6:e443 with SMTP id jx7-20020a0562142b0700b00432f7e6e443mr8604561qvb.125.1655477304514; Fri, 17 Jun 2022 07:48:24 -0700 (PDT) Received: from bill-the-cat (cpe-65-184-195-139.ec.res.rr.com. [65.184.195.139]) by smtp.gmail.com with ESMTPSA id h3-20020a05622a170300b002f905347586sm5114402qtk.14.2022.06.17.07.48.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jun 2022 07:48:23 -0700 (PDT) Date: Fri, 17 Jun 2022 10:48:21 -0400 From: Tom Rini To: Francis Laniel , Aleksandar Gerasimovski Cc: u-boot@lists.denx.de, Marek Behun , Michael Nazzareno Trimarchi , Simon Glass , Wolfgang Denk , Harald Seiler Subject: Re: [RFC PATCH v4 28/28] board: keymile: common: Use environment to store IVM_* variables. Message-ID: <20220617144821.GY2484912@bill-the-cat> References: <20220616223158.9225-1-francis.laniel@amarulasolutions.com> <20220616223158.9225-29-francis.laniel@amarulasolutions.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="l6tbG+CHF5pXX68u" Content-Disposition: inline In-Reply-To: <20220616223158.9225-29-francis.laniel@amarulasolutions.com> X-Clacks-Overhead: GNU Terry Pratchett 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 --l6tbG+CHF5pXX68u Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 17, 2022 at 12:31:58AM +0200, Francis Laniel wrote: > These boards used set_local_var() to store some variables as local shell. > They then used get_local_var() to retrieve the variables values. >=20 > 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. >=20 > Signed-off-by: Francis Laniel > --- > board/keymile/common/common.c | 8 ++++---- > board/keymile/common/ivm.c | 9 +-------- > 2 files changed, 5 insertions(+), 12 deletions(-) >=20 > 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 f= lag, int argc, > unsigned char buf[32]; > char *p; > =20 > - p =3D get_local_var("IVM_BoardId"); > + p =3D 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 f= lag, int argc, > env_set("boardid", (char *)buf); > printf("set boardid=3D%s\n", buf); > =20 > - p =3D get_local_var("IVM_HWKey"); > + p =3D 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 =3D get_local_var("IVM_BoardId"); > + p =3D env_get("IVM_BoardId"); > if (!p) { > printf("can't get the IVM_Boardid\n"); > return 1; > } > rc =3D strict_strtoul(p, 16, &ivmbid); > =20 > - p =3D get_local_var("IVM_HWKey"); > + p =3D 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) > =20 > static int ivm_set_value(char *name, char *value) > { > - char tempbuf[256]; > - > - if (value) { > - sprintf(tempbuf, "%s=3D%s", name, value); > - return set_local_var(tempbuf, 0); > - } > - unset_local_var(name); > - return 0; > + return env_set(name, value); > } > =20 > static int ivm_get_value(unsigned char *buf, int len, char *name, int of= f, Adding in the maintainer, but seems reasonable to me. Reviewed-by: Tom Rini --=20 Tom --l6tbG+CHF5pXX68u Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmKslDIACgkQFHw5/5Y0 tyzUxwv/SAmNk+f6qSDdjKtMbUxl0eoP2nNsgE3NZi5SDO0BbJFRSsdZpw6zBpNI WfbmPmw2cnObSc4azn+KVDCbuG2+MjeXBamcV6odkWtG5yj2J9mRCkNIpd/KUoAn iLIC4IZ4PkZFsb05t7nrSB7niN8anhJkpv95PV8N1mlrtAzcXpJmzlluj8ThuX2y YwCqceyutQIepotE7P2ElpQrj5Kbdg7taK1yXP82PmUQ2mXct4LVlE90vfaMM+JF uOup/k46K3i2v+5+4tGzS8sTKbelI8SM3aSRf4vzHau7076Fy1qb7AMn1BFsftRl QiyPk+nCKbNkjp3DJ9TfZygvhmb/bSD93zpEFSNxy79nnPC5jkH9AnJK2ir5nOgc iLju2utKbFusRBlmd044hpJYYpNwIhhDCsxWtG0uU4v4QS+ovnx2ItUmHqTlgRaQ Mz6VwEuccVBUcd0dIY4yu+V44hssYMIdp0LhNo7LVFYYWgIaElknjz7F3tPJUtzA vEenHebP =2dVJ -----END PGP SIGNATURE----- --l6tbG+CHF5pXX68u--