Message ID | 20211017153638.29870-1-kabel@kernel.org |
---|---|
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=igpY+mki; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HXPJZ44Zkz9sP7 for <incoming@patchwork.ozlabs.org>; Mon, 18 Oct 2021 02:37:18 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 06E5A8345A; Sun, 17 Oct 2021 17:36:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="igpY+mki"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0FBE383173; Sun, 17 Oct 2021 17:36:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D75AE802A1 for <u-boot@lists.denx.de>; Sun, 17 Oct 2021 17:36:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id E6DB460FE3; Sun, 17 Oct 2021 15:36:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634485002; bh=p73kOE+QU5fw2gPSOvgIuDLdT7tM6RKksoxH5ZDjH9A=; h=From:To:Cc:Subject:Date:From; b=igpY+mkieHRU7POEcz2bRMMdmzT+7y1Nu6gcq6ISEJ5d6ozcKOmLm5Vy4JR/QsXFH yb5xjSEw36yRp/PB3ixitA8SbJDimcXEhggCAmzO7a3iGtY7qAPTreIthq2SbRnPCT dXJJsmajiGmLKw8a5WegskWDA9VVro+gwtkg5LtsDTt7RvM8auuQEXiVum+Irt7C22 e8+mAkwn4xpuetgg1pl+7bjvBVqXpAsKppfkCiFhaNhLguGcuG4ILCurf2y0dalty+ VEzmcJ6gjMBmyhukIbkNKprQLfrhBJ8BQHBFb+JEJ6DlsskS13REkm8ZEhgD0LKNue Y6MrpIgbDrA9A== From: =?utf-8?q?Marek_Beh=C3=BAn?= <kabel@kernel.org> To: Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com> Cc: U-Boot Mailing List <u-boot@lists.denx.de>, =?utf-8?q?Marek_Beh=C3=BAn?= <marek.behun@nic.cz> Subject: [PATCH v3 00/13] env_get_char() removal and env_get_f() refactor Date: Sun, 17 Oct 2021 17:36:25 +0200 Message-Id: <20211017153638.29870-1-kabel@kernel.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean |
Series |
env_get_char() removal and env_get_f() refactor
|
expand
|
From: Marek Behún <marek.behun@nic.cz> Hi Simon, Tom, env_get_char() is a relic from the past when env was read char-by-char from underlying device. Currently it only accesses in-memory arrays. We can remove it and access the arrays directly. This simplifies the old code of env_get_f(). Changes since v2: - added patch env: Simplify env_match() and inline into env_get_f() - remove patch env: Check for terminating null-byte in env_match() (not needed with the above patch added) - changed order of patches a little - rebased to accomodate the order change and the added and removed patch Changes since v1: - use memcpy() instead of strncpy() when copying value to buffer - fixed a bug in patch adding check to terminating NULL-byte - added patch fixing documentation for env_get_f() - added patch changing behaviour of return value of env_get_f() - some other cosmetic changes Marek Marek Behún (13): env: Fix documentation for env_get_f() env: Drop env_get_char_spec() and old, unused .get_char() implementations examples: api: glue: Remove comment that does not apply anymore env: Change env_match() to static and remove from header env: Inline env_get_char() into its only user env: Use string pointer instead of indexes in env_get_f() env: Use better name for variable in env_get_f() env: Don't match empty variable name in env_match() env: Early return from env_get_f() on NULL name env: Make return value of env_get_f() behave like sprintf() on success env: Use memcpy() instead of ad-hoc code to copy variable value env: Simplify env_match() and inline into env_get_f() env: Move non-cli env functions to env/common.c cmd/nvedit.c | 188 -------------------------------------------- env/common.c | 180 ++++++++++++++++++++++++++++++++++++++++++ env/eeprom.c | 18 ----- env/env.c | 13 --- env/nowhere.c | 5 +- env/nvram.c | 14 ---- examples/api/glue.c | 5 -- include/env.h | 24 +----- 8 files changed, 184 insertions(+), 263 deletions(-)