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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1B06C433EF for ; Thu, 14 Oct 2021 15:15:05 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 585B1610F8 for ; Thu, 14 Oct 2021 15:15:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 585B1610F8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0304A837FA; Thu, 14 Oct 2021 17:13:04 +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="eYK/8aFL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2021583786; Thu, 14 Oct 2021 17:11:29 +0200 (CEST) Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) (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 35D52837AC for ; Thu, 14 Oct 2021 17:11:23 +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@google.com Received: by mail-ot1-x32d.google.com with SMTP id l16-20020a9d6a90000000b0054e7ab56f27so8598384otq.12 for ; Thu, 14 Oct 2021 08:11:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=O3Q7ks/ZYVwlyYkGa8Ila2sy6iPyomMd3orrgC8c3Ho=; b=eYK/8aFL1Rpu8lTAObdq8wHCYQJWX+OlbPPf4bjyYXYjJn2cdu3UI5p3gn/CiCQ41b QqehUcIpC2kgvj8ozS3GG9shABj5IVkMYQevZXmtAAZznC7wxylaez6h3LQxAcN1SEFv 5cCpL44q5TU7/yY84Ifurt4dEYJFu/vrx5tFw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=O3Q7ks/ZYVwlyYkGa8Ila2sy6iPyomMd3orrgC8c3Ho=; b=OYXl/hTKoAyQ6+cpdxn3ZizgEViqgVc7fQro4ChOdQofsL9ncOySi/JVhG/Iw2YYG2 zxyru9k8iFKNvCUiNedipeF/GNmKUrT0pd5Anj8BAeOHZFRaUHwA+OAsmIQt517tujJ+ B6aJjFrzo34S9Nj/KzfVL1Fa8qSWimCv6FuetpCbjDYLPJor1PQFDuq/e65HkGDBWJHJ ClEWbaMZ42WAqfmNXudvinqwxNSTreNn1lURtIvbck4peziLK92wGKqqq+bUAPZgYE3w yS0zt+3BhsnmvbYS3TZlYwmNSlGJNPJMx6kU3F1GsH/Xmy2m3/7lyIshaZaFVI4V9Azs Pyyw== X-Gm-Message-State: AOAM532MjeNfTNCFDQDS06+3KKNMXeKbO7CpiYUtB47tHdv1uJ1xY6sA TE9hZOuC7iFtG77rBplchH418TBNMmav2IrsmMNnuMw8pf8= X-Google-Smtp-Source: ABdhPJxQBlb353d63gA0z6P7+qusCVM+Z4Om1jvupgCAiQS4hHorywmtvBOfI3UdWDt/6XeWZrtLt16x/l2S9VKtvi8= X-Received: by 2002:a05:6830:3093:: with SMTP id f19mr3055714ots.97.1634224281624; Thu, 14 Oct 2021 08:11:21 -0700 (PDT) MIME-Version: 1.0 References: <20211013154557.28479-1-kabel@kernel.org> <20211013154557.28479-5-kabel@kernel.org> In-Reply-To: <20211013154557.28479-5-kabel@kernel.org> From: Simon Glass Date: Thu, 14 Oct 2021 09:11:08 -0600 Message-ID: Subject: Re: [PATCH v2 04/13] env: Change env_match() to static and remove from header To: =?UTF-8?B?TWFyZWsgQmVow7pu?= Cc: Tom Rini , U-Boot Mailing List , =?UTF-8?B?TWFyZWsgQmVow7pu?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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.103.2 at phobos.denx.de X-Virus-Status: Clean Hi Marek, On Wed, 13 Oct 2021 at 09:46, Marek Beh=C3=BAn wrote: > > From: Marek Beh=C3=BAn > > This function was used by other parts of U-Boot in the past when > environment was read from underlying device one character at a time. > > This is not the case anymore. > > Signed-off-by: Marek Beh=C3=BAn > --- > cmd/nvedit.c | 30 +++++++++++++++--------------- > include/env.h | 11 ----------- > 2 files changed, 15 insertions(+), 26 deletions(-) > > diff --git a/cmd/nvedit.c b/cmd/nvedit.c > index ddc715b4f9..742e0924af 100644 > --- a/cmd/nvedit.c > +++ b/cmd/nvedit.c > @@ -706,6 +706,21 @@ char *from_env(const char *envvar) > return ret; > } > Please can you add the function comment here? We don't want to lose it. > +static int env_match(uchar *s1, int i2) > +{ > + if (s1 =3D=3D NULL) > + return -1; > + > + while (*s1 =3D=3D env_get_char(i2++)) > + if (*s1++ =3D=3D '=3D') > + return i2; > + > + if (*s1 =3D=3D '\0' && env_get_char(i2-1) =3D=3D '=3D') > + return i2; > + > + return -1; > +} > + > /* > * Look up variable from environment for restricted C runtime env. > */ > @@ -816,21 +831,6 @@ static int do_env_select(struct cmd_tbl *cmdtp, int = flag, int argc, > > #endif /* CONFIG_SPL_BUILD */ > > -int env_match(uchar *s1, int i2) > -{ > - if (s1 =3D=3D NULL) > - return -1; > - > - while (*s1 =3D=3D env_get_char(i2++)) > - if (*s1++ =3D=3D '=3D') > - return i2; > - > - if (*s1 =3D=3D '\0' && env_get_char(i2-1) =3D=3D '=3D') > - return i2; > - > - return -1; > -} > - > #ifndef CONFIG_SPL_BUILD > static int do_env_default(struct cmd_tbl *cmdtp, int flag, > int argc, char *const argv[]) > diff --git a/include/env.h b/include/env.h > index b1a4003681..a9b2a4c8b2 100644 > --- a/include/env.h > +++ b/include/env.h > @@ -90,17 +90,6 @@ int env_init(void); > */ > void env_relocate(void); > > -/** > - * env_match() - Match a name / name=3Dvalue pair > - * > - * This is used prior to relocation for finding envrionment variables > - * > - * @name: A simple 'name', or a 'name=3Dvalue' pair. > - * @index: The environment index for a 'name2=3Dvalue2' pair. > - * @return index for the value if the names match, else -1. > - */ > -int env_match(unsigned char *name, int index); > - > /** > * env_get() - Look up the value of an environment variable > * > -- > 2.32.0 > Regards, Simon