From patchwork Wed Jan 12 11:39:28 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: 1579012 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=XJGMCLZX; 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 4JYlwM5lX6z9t25 for ; Wed, 12 Jan 2022 22:39:47 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 26F368313E; Wed, 12 Jan 2022 12:39:42 +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="XJGMCLZX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3389883146; Wed, 12 Jan 2022 12:39:40 +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-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) (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 7142C83103 for ; Wed, 12 Jan 2022 12:39:37 +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-x12b.google.com with SMTP id x7so7029887lfu.8 for ; Wed, 12 Jan 2022 03:39:37 -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=XJGMCLZXuSKWMKPfgwT2dGrHPlX+M4klKB1b9fgCfMHhXWIyUuaMK0iepfQVq8D6/O B29Ttyf53o0TEav4mK0j5xhO+8udsttkdzWMBdQwCdT9FERufmlXL0liZf9IQ6piXHOo yl9bPTAkDJokF6iIMV520adNNbS95dUzwD0375J7cLIw9IHSP+mbpWi+aCh6jRiujuV9 6N+Xz9l5wfp+cJQ7wuR0TBDGocKU+Dei2/uTIlT+DklJaJJMs4x1/rNtYwWRS1K/ZJXh jJubvcAB2iTOK3WiVG234JiT8y47KpEJIvWz8CRlR3Rh4bYnHkmhxJJcks/f7AE3kX1b W2yw== 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=a3tSCqH8NgxsAqLB7LVEMHhSTcuO+OdugOv+gg9yTrm+3If+F++n8TGNUYTZksn7hQ f48PYd3p9cZaKaopgvuXn4CzprJfihTtgnwbaiD0TRjmWB2Hx00a0Jg/avpjJTuMo6f1 j7Q/X+lEBSXSDgHpYy9t8D3GUebeTP9c8AnOx12MJ+eUOhz9in/T9wDUbKLJ0YNVr9m3 91yb7APVEjzHhI0wpapB5cRTAIJDJEZWBuEzqoJi01aWcXHHVOWeCyuLgXR2QVrAxmDX UW5pQ5fHUl2eI0As6cdUX0bXx0yw1gEwJ5Hz2Nk+qU7/YAAk91V7/yqAXA8jszl1EOZN 18yw== X-Gm-Message-State: AOAM531iD5hGcIJ6Y12ZxKQajBoWWWY3RSlWIf3y/i2iPHbl6YhHQymS DZH3VCoOetsJz6y6KDpgmIMmQZqJdow= X-Google-Smtp-Source: ABdhPJxIikqc03bfWF0GmC4OxVbtKgUcSQpc1ofh12RcR0nWJs2Tc+pGoY8Esx0vSrNXgB4Sd6nllw== X-Received: by 2002:a05:6512:3689:: with SMTP id d9mr6413602lfs.195.1641987576766; Wed, 12 Jan 2022 03:39:36 -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 p14sm1578851ljj.12.2022.01.12.03.39.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 03:39:36 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: u-boot@lists.denx.de Cc: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH V2 0/2] fw_env: two minor code cleanups Date: Wed, 12 Jan 2022 12:39:28 +0100 Message-Id: <20220112113930.7660-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(-)