From patchwork Tue Oct 12 11:04:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1539732 Return-Path: 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=Ht9AYxR0; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HTCWL3nvpz9sX3 for ; Tue, 12 Oct 2021 22:05:34 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BE90883719; Tue, 12 Oct 2021 13:05:25 +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="Ht9AYxR0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 443CF8372C; Tue, 12 Oct 2021 13:05:16 +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 4D887832E6 for ; Tue, 12 Oct 2021 13:05:07 +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 E2F6A60F3A; Tue, 12 Oct 2021 11:05:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634036705; bh=zqS3qJk210BW4oIPpKzgpnu4hCegh7jbRYWdFF5ThUg=; h=From:To:Cc:Subject:Date:From; b=Ht9AYxR03edY0fVp4/bo25P9sR7HUDaYSAyUI2RoTCPPs/AaUt674FVjpiCEqNCTT hpmEjKsCMNJYhrBVlIHQD2rH2R4gpBpfA4hIQbeLUHJod/Uq/6bhPyQThUeCmLeRHN ADtxsPz8sN9Q3x8pey3NRl4KP8XMf0zDtmSmv2CNBJ+OvOGStndNn/aoTYQ15Gr8cI 6FRuU/oPwysZIrzk4LR2/d7wCGjYlHEHzgxCNDq4A0CT3mlcrAEgN51aiu13yaLfsX 9BCs8mKnVQRVNNuew92Qtcn14PzDVTvwqkGjTqdPNMrYbZIMMAcxhKDhs/dD4NTxPa 3/Y/n11rqNOHw== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Simon Glass , Tom Rini Cc: U-Boot Mailing List , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH 00/10] env_get_char() removal and env_get_f() refactor Date: Tue, 12 Oct 2021 13:04:51 +0200 Message-Id: <20211012110501.6118-1-kabel@kernel.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 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(). Marek Marek BehĂșn (10): 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: Don't match empty variable name in env_match() env: Check for terminating null-byte in env_match() env: Inline env_get_char() into it's only user env: Early return from env_get_f() on NULL name env: Use strncpy() instead of ad-hoc code to copy variable value env: Use string pointer instead of indexes in env_get_f() env: Move non-cmd specific 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 | 21 ----- 8 files changed, 182 insertions(+), 262 deletions(-)