From patchwork Wed Jan 20 16:46:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Alex G." X-Patchwork-Id: 1429326 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=hWsEWsJx; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4DLWfS3w3hz9s24 for ; Thu, 21 Jan 2021 03:47:44 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 22A5E829AA; Wed, 20 Jan 2021 17:47:19 +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="hWsEWsJx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A11D082916; Wed, 20 Jan 2021 17:47:09 +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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) (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 D24CF827A4 for ; Wed, 20 Jan 2021 17:47:03 +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=mr.nuke.me@gmail.com Received: by mail-oi1-x229.google.com with SMTP id w8so3879357oie.2 for ; Wed, 20 Jan 2021 08:47:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vHWNklXjyuuA8+8IxbOJzdMCZ6sl0lT4qVi6nckSNsg=; b=hWsEWsJxLf2HzCIw2d9bqQhjHdsrhhN+I4v7MLhB4F6pzA+I/yha/u9Xyx2HrZVThl 3o96HZ2j/U6pE+FuGrpbbjdt0Ub60ozT4CiPeiQsWPG5opL4WlZKeYlb8/aFw/4SMzOw nrlGnNPVeJLmapLfqaVPC5lWNPHprz8EkmYqjY2EoJO+AjlBuQldj8p4YiuUvT5t9mlA jZRaH4Yvn2XzenJULgyzQyfiur7qg9x5b63XERYV7GPOAZ1I/b7i/mADHcAffkno9MNA CNtycMRJ3OA6IjfA0XCNefBNHTShLok/jzgGZnOjlhV4Sc+UO7czoaGwvHt+82hOBXF1 QRCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vHWNklXjyuuA8+8IxbOJzdMCZ6sl0lT4qVi6nckSNsg=; b=f/UsJWpnV0ha7yhsWQSrBZE2hkH1x/CzRi6QEU6JyRJ7bffB2R6PzjdClCDYL26NgF zG6H7cWRn5WGEba5Nq88cz1RA/3/WfN7U0N8bqtEFqhYhl1MWVzrm3kdgiMkS8xegPbH 1LjFJhm5s9mbrOPkDw3Ywwtu9WumD4WEbjIBmaL3g8bO4QTES+uZOmgMr3o0kRPGMA0c yBueNJY/UsfBNqhmldeag5b77GN7pj88qiD2QL1G481V604KsfY0XbZ6Nhd9b9iH37zu /nwv04kY+0qaY4DHqIvn7a4i4IucMhzIkAtrScxeKgQ3zqmlkEOt88s3FwmK/QL7HKGa SK/A== X-Gm-Message-State: AOAM532ZTMzTKkGvCMGaulqgpDAGOqJccVcfoQND9tg/pN+elDPAscaX I+H5dgxPzupScgcvpKb0Y0J/SistcvQ= X-Google-Smtp-Source: ABdhPJwGEKJBBImfoLxFjFTH2TzRR1voadmNIFr+yo+N+td5+db3Qpl9skU+poDrCA6R1cxoCtwNqw== X-Received: by 2002:aca:bf57:: with SMTP id p84mr3450994oif.130.1611161222352; Wed, 20 Jan 2021 08:47:02 -0800 (PST) Received: from nuclearis2-1.lan (c-98-195-139-126.hsd1.tx.comcast.net. [98.195.139.126]) by smtp.gmail.com with ESMTPSA id i9sm462972oii.34.2021.01.20.08.47.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jan 2021 08:47:01 -0800 (PST) From: Alexandru Gagniuc To: u-boot@lists.denx.de Cc: Alexandru Gagniuc , trini@konsulko.com, marex@denx.de, sjg@chromium.org Subject: [PATCH v4 4/8] spl: fit: Remove useless loop in spl_fit_get_image_name() Date: Wed, 20 Jan 2021 10:46:52 -0600 Message-Id: <20210120164656.1396639-5-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210120164656.1396639-1-mr.nuke.me@gmail.com> References: <20210120164656.1396639-1-mr.nuke.me@gmail.com> 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.102.3 at phobos.denx.de X-Virus-Status: Clean When a desired configuration is not found, conf_node will have a negative value. Thus the for loop will start at the root "/" node of the image, print the "/description" property, and stop. It appears the intent of the loop was to print the names of the subnodes under "/configurations". We would need the offset to the "/configurations" node, which is abstracted by fit_find_config_node(). This change agrees that abstracting the node offset is the correct design, and we shouldn't be parsing the configurations manually. Thus the loop in spl_fit_get_image_name() is useless. Remove it. Signed-off-by: Alexandru Gagniuc Reviewed-by: Simon Glass --- common/spl/spl_fit.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index 6b56aa919b..a0bb3f7ad6 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -88,18 +88,8 @@ static int spl_fit_get_image_name(const struct spl_fit_info *ctx, bool found = true; conf_node = fit_find_config_node(ctx->fit); - if (conf_node < 0) { -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT - printf("No matching DT out of these options:\n"); - for (node = fdt_first_subnode(ctx->fit, conf_node); - node >= 0; - node = fdt_next_subnode(ctx->fit, node)) { - name = fdt_getprop(ctx->fit, node, "description", &len); - printf(" %s\n", name); - } -#endif + if (conf_node < 0) return conf_node; - } name = fdt_getprop(ctx->fit, conf_node, type, &len); if (!name) {