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 077F0C433F5 for ; Sun, 17 Oct 2021 15:37:15 +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 2D06D60E74 for ; Sun, 17 Oct 2021 15:37:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2D06D60E74 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.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 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) 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 ; 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=20Beh=C3=BAn?= To: Simon Glass , Tom Rini Cc: U-Boot Mailing List , =?UTF-8?q?Marek=20Beh=C3=BAn?= 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 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 From: Marek BehĂșn 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(-) -- 2.32.0