[{"id":3689371,"web_url":"http://patchwork.ozlabs.org/comment/3689371/","msgid":"<CAFLszTgC+dnTwCjzPg-Gt3J+SAP1ttZxCm3kHewrh9ZjKON99w@mail.gmail.com>","list_archive_url":null,"date":"2026-05-11T13:30:04","subject":"Re: [PATCH v1 3/3] boot/fit: use fdt_for_each_subnode() in\n image-fit.c","submitter":{"id":6170,"url":"http://patchwork.ozlabs.org/api/people/6170/","name":"Simon Glass","email":"sjg@chromium.org"},"content":"On 2026-05-08T21:31:58, Aristo Chen <aristo.chen@canonical.com> wrote:\n> boot/fit: use fdt_for_each_subnode() in image-fit.c\n>\n> Replace the verbose fdt_next_node() + ndepth pattern with the\n> fdt_for_each_subnode() macro at all seven sites in boot/image-fit.c\n> where the loop only ever processes direct children. The macro is\n> already defined in <linux/libfdt.h> and used in boot/image-fit-sig.c,\n> so this brings image-fit.c in line with the rest of the FIT code.\n>\n> The conversions are equivalence-preserving:\n>\n>   - fit_get_subimage_count(): the depth-1 filter and the macro are\n>     both restricted to direct children.\n>   - fit_conf_print(): the parameter is named noffset, so the loop\n>     now uses sub_noffset to keep the parent reference stable.\n>   - fit_print_contents(): the count reset that lived inside the for\n>     initialiser is moved out as an explicit assignment before each\n>     loop, so the second loop still starts from zero.\n>   - fit_image_print(): straightforward replacement.\n>   - fit_all_image_verify(): same shape as the print loops, with the\n>     count reset moved out as an explicit assignment before the loop.\n>   - fit_conf_find_compat(): the body's \"if (ndepth > 1) continue\"\n>     guard is redundant once the macro is in use, and is dropped.\n>\n> No behaviour changes outside of these mechanical reductions. Local\n> ndepth declarations that are no longer referenced are removed.\n>\n> Signed-off-by: Aristo Chen <aristo.chen@canonical.com>\n>\n> boot/image-fit.c | 107 ++++++++++++++-----------------------------------------\n>  1 file changed, 27 insertions(+), 80 deletions(-)\n\nReviewed-by: Simon Glass <sjg@chromium.org>","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256\n header.s=google header.b=accyIGr7;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org\n header.b=\"accyIGr7\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org","phobos.denx.de;\n spf=pass smtp.mailfrom=sjg@chromium.org"],"Received":["from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4gDgZt2v9qz1yHW\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 11 May 2026 23:30:30 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 769348460C;\n\tMon, 11 May 2026 15:30:22 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 92CE880398; Mon, 11 May 2026 15:30:21 +0200 (CEST)","from mail-ej1-x629.google.com (mail-ej1-x629.google.com\n [IPv6:2a00:1450:4864:20::629])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id AA2198460E\n for <u-boot@lists.denx.de>; Mon, 11 May 2026 15:30:18 +0200 (CEST)","by mail-ej1-x629.google.com with SMTP id\n a640c23a62f3a-bce386d5b85so204018166b.1\n for <u-boot@lists.denx.de>; Mon, 11 May 2026 06:30:18 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2","ARC-Seal":"i=1; a=rsa-sha256; t=1778506218; cv=none;\n d=google.com; s=arc-20240605;\n b=EdGLPFRQvRTW4G+nktlthMfm4LDZjwTt5qPN3ofxwT36VJ9oGAFeiRqbvhf8Tn9k/N\n JmtSwx4FOsaqUudH4IOvZ4TOutRzhwi2+4ybA5+T/MIkJIPiafxOFTtMgYGA+eo1W89m\n RVxuTRrVUpW/4dFE+lWQ5WKWywe9WpL7BcTW7sYe4mS91SYw0O953TzYpiJBH9MXef7V\n 57E7BWxCigxwyKnYVKB7BhLCVFykQw7CsPJsgAbhH2AghNhpDmvpLHcYMY31G80ExP5v\n V/cKNtdXRxFstewJPCF258sw0zpLMHrTOnyuFRUD+v6a1Mlr4O79Kv/QqlJz0BKfgZH+\n kojA==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:dkim-signature;\n bh=f8prlA/g4t0zB8R9xVqm7YfyOS5W34jKne4/iFliwLc=;\n fh=9mt7BL9T0ZGZOph0lp4xJiGBzgOSSvgEz5hYv+pLznE=;\n b=aPMNImTfDrQHfEsvyHNDW9MzIosqUlZWKNIWpoaDbd1hJ6mRalij+RMl3HnEC4dxYT\n ENQz2SekT+gWHb3mRXxIb+fw5DQxyPDOI+KW97Jag0JG3R2UwGo1i7butmpQyD+AGqdo\n zR8ukE5+jSWkUNUVooOwXUOt6AxMf/TsBDDUjAAYxt9JvXSKfYqmKccfTnZZ6hN3AvAC\n JbYcwKDJYbAwHKTDtERof5CnDK/r9hYhShN87wPv4STVBp2VEvyZEvhqfZQFmgAYs5ia\n 8CaKYLqZw0nM2U93RB9gFgcJzbYc/6V1po0ofDS6BpFxHj6WiqfO/TvESi4mRuHOX2m+\n WbUQ==; darn=lists.denx.de","ARC-Authentication-Results":"i=1; mx.google.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=chromium.org; s=google; t=1778506218; x=1779111018; darn=lists.denx.de;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:from:to:cc:subject:date:message-id:reply-to;\n bh=f8prlA/g4t0zB8R9xVqm7YfyOS5W34jKne4/iFliwLc=;\n b=accyIGr79ob8623vw36G295ioCtILpST2s9AMS+cvE+A4WeSNiiYWlfUlXE8+G4PxC\n Is3y8N1kNDOHGk51nK6Sv6PAWVjzXlzzwr/OgwNF2d30cvlimThVbPnFP3klVrzYs1ro\n 7ySOuWwSsLjLU5L1OxTHxVYfs7nvWRQdcBoIE=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1778506218; x=1779111018;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=f8prlA/g4t0zB8R9xVqm7YfyOS5W34jKne4/iFliwLc=;\n b=V318Y6vL8Iz4PWTPhQYNU0DBqgDlauOV9IiFWNmXydvZDHTML2j0iwS1ZOsAJFZV/r\n TYf3gCR9UpRJKbnRGO91o5f8Oa/J4PcfeS9otybgPo3zAllC3JfTjwIdLCbAShliSEMy\n DWp7Yso27twzZazZifW5dcQxy7jzxQDK0QsEJOq0MF8NW6pF7w9kew3nDKxaG1t1iInd\n WNXx05G6Xy0CGAHh6v7SbfoYE3Hq4Gs3Q8vZqim7f64BE0MFmCuxVCN5HJNsHtlnTeDq\n Nf9NKl0lc7JIFn0r7jySLD+rPtBhYlcIEbDINLCSCDteRJzkThXNsz5HnOucBdluy0TA\n 4ABw==","X-Gm-Message-State":"AOJu0YzKgcyCg7LsTM8RDQomq9HN2Cv4quIu1JuCVmmPyt+aT/HklQ4b\n LY2MCzkXIjdlCSEw4TRm9f0iWJtnTpPbse0ykYUbwTXf6zwr6VV6LbNSLYpaFbHxr65A/FImSDq\n /UdgN3fj/G8kc58f4Qqb9j/AK9jv6/IxfpRptGgcl","X-Gm-Gg":"Acq92OHjqXkCupMyjehIIBK/+Kz4iL/Hit7TSHtqw3Wv9hXMQI8SS3jMEGSK77DNBjU\n f66YX94fzhfjQ5MwHLp34isH0/vfvrA8WccCpluYaVkdLg9+Sj3FZP9Wwh04As+kxa3GMdrkn44\n LJqWc34/Q54MsU5q/Am4+E6aDT5Q8vxZTVdZP8UOcgobt1Y9ofbOR8Ah46GBjofNDyzSONHTEL2\n QNSV2uUO6Pon6w4Lx6r8GzqnzkeAztmWdDQ0cMD6mIHpdAnffk9jNknOtQaswb6wAisdLk4vKX3\n +q+qSQ==","X-Received":"by 2002:a17:907:806:b0:b9d:6d06:b78a with SMTP id\n a640c23a62f3a-bc56b835456mr1381692066b.17.1778506217847; Mon, 11 May 2026\n 06:30:17 -0700 (PDT)","MIME-Version":"1.0","References":"<20260508213217.3807786-1-aristo.chen@canonical.com>\n <20260508213217.3807786-4-aristo.chen@canonical.com>","In-Reply-To":"<20260508213217.3807786-4-aristo.chen@canonical.com>","From":"Simon Glass <sjg@chromium.org>","Date":"Mon, 11 May 2026 07:30:04 -0600","X-Gm-Features":"AVHnY4LFvLJYyVxA0F7yIFvbjxfUpYQb0Q6Xhst2MeDb-Z7SywMSUNDoO4H7r2I","Message-ID":"\n <CAFLszTgC+dnTwCjzPg-Gt3J+SAP1ttZxCm3kHewrh9ZjKON99w@mail.gmail.com>","Subject":"Re: [PATCH v1 3/3] boot/fit: use fdt_for_each_subnode() in\n image-fit.c","To":"aristo.chen@canonical.com","Cc":"u-boot@lists.denx.de, Tom Rini <trini@konsulko.com>,\n Quentin Schulz <quentin.schulz@cherry.de>,\n Marek Vasut <marek.vasut+renesas@mailbox.org>,\n James Hilliard <james.hilliard1@gmail.com>,\n Heinrich Schuchardt <xypron.glpk@gmx.de>,\n David Lechner <dlechner@baylibre.com>","Content-Type":"text/plain; charset=\"UTF-8\"","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <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>,\n <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.8 at phobos.denx.de","X-Virus-Status":"Clean"}}]