[PATCH v3 12/13] env: Simplify env_match() and inline into env_get_f()

Simon Glass sjg at chromium.org
Mon Oct 18 20:12:12 CEST 2021


On Sun, 17 Oct 2021 at 09:37, Marek Behún <kabel at kernel.org> wrote:
>
> From: Marek Behún <marek.behun at nic.cz>
>
> In the past the env_match() function was used to match envs with
> - name, i.e. string "name"
> - variable assignment, i.e. string "name=other_value"
>
> The latter is not the case anymore, since the env_match() function is
> now used only in env_get_f(), and so we can simplify the function into
> a simple strncmp() with an additional comparison to '='.
>
> Let's do this, and since the resulting function is quite simple, let's
> also inline its code into env_get_f().
>
> Signed-off-by: Marek Behún <marek.behun at nic.cz>
> ---
>  cmd/nvedit.c | 19 +++++--------------
>  1 file changed, 5 insertions(+), 14 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list