From patchwork Wed Jan 12 11:47:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 1579021 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=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=K+MP5Hyw; 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=) 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)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JYm572lgJz9t25 for ; Wed, 12 Jan 2022 22:47:20 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 929B083146; Wed, 12 Jan 2022 12:47:15 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="K+MP5Hyw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3B05D8313E; Wed, 12 Jan 2022 12:47:14 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) (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 CE16A82F89 for ; Wed, 12 Jan 2022 12:47:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=zajec5@gmail.com Received: by mail-lf1-x12e.google.com with SMTP id o15so7046270lfo.11 for ; Wed, 12 Jan 2022 03:47:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jQnb/mvfGf0m8+99ZedKKMpm9H6X0OKMl/LVTYlWYR4=; b=K+MP5HywPv0hHd1x8uYpB6xQGV1JmlBe721YMAER+qN2h6x5n0/AwNVMXUuAfaHPfP 9GP/LyrFEG9BPuP3Frc/eqTyeCfwTlH9QMWmenVLRDkKqAerZk1k8xMhG0NGfvTJMqOo e0fiLE5NbuHbmK8D4UCVA0e1MbXTzEnplvV1TEB7e+hFkQD320JjwyiOQ2RjjmeA0AFQ NsBlhUG1/bVdLDv2uc4uuix4AzA7MP169I/saGSGcBaFFPXj3EK6UolLi00KrdA8+ihx /yaodUPQvAFanBIpywb1Xy208LymenafAJ8GrsiLTJhM7H47JyvN5zcUTeH5oWUL+RF7 /wHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jQnb/mvfGf0m8+99ZedKKMpm9H6X0OKMl/LVTYlWYR4=; b=ngZ8iibH70O68bXS/3N48OLbU882ridT2h6EcG39nsdX5UbaZCkKfRdBlztP+gUOhr jDxaYdAGjee1aAYNxGRGywBKcduqwGIvxmmoTlPfdFy+7NIkqsAOljjmJoRaqe4mO4yH KTNCTzWhwVFlqEydFR/UDg0N4owNwc6C2UXMvJ+uoqVgUvdB+UhSvAyJYV31hvhDLjtc j1AKXQpewTltrbXR8LzmMNBw/yqZs4wQm/dviZo8H18/Ldv8GIXW9hyRFgw+xJA9mw5D bZzSEgZH0LEWrdVts0VRtDO7yjT1PkTwhTeOIJUXdGsKuoCKgMgowN7pu+ZF9bJzYAi+ zWjA== X-Gm-Message-State: AOAM530OxCEBBuhwRnkkvFvubAE4jDBRcj12wf6MbxScm1cZrVBU1hli 7QQtpWNExTH/o23DDXgjQq2Z0pAnfdk= X-Google-Smtp-Source: ABdhPJzKqWsPMDD1z30iceaVKOoztE4kEshLsSEIwuWHEzoTzw6R/WAiWQBXCqVqD1BshocF49dzMg== X-Received: by 2002:ac2:5bc9:: with SMTP id u9mr6390925lfn.371.1641988031191; Wed, 12 Jan 2022 03:47:11 -0800 (PST) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id m13sm1613072lfg.139.2022.01.12.03.47.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 03:47:10 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: u-boot@lists.denx.de Cc: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH V3 0/2] fw_env: two minor code cleanups Date: Wed, 12 Jan 2022 12:47:04 +0100 Message-Id: <20220112114706.12269-1-zajec5@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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: Rafał Miłecki Hi, I'm a long time OpenWrt developer and just recently I started working with some devices using U-Boot. I was trying to understand how environment variables are read in user space and I had some problems understanding fw_env_open() logic. I eventually got it but I thought I may help further developers by simpliifying its code a bit. I hope you may find those patches useful and review / apply them. Rafał Miłecki (2): fw_env: make flash_io() take buffer as an argument fw_env: simplify logic & code paths in the fw_env_open() tools/env/fw_env.c | 105 +++++++++++++++++++-------------------------- 1 file changed, 45 insertions(+), 60 deletions(-)