From patchwork Mon Mar 15 05:00:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1452960 X-Patchwork-Delegate: sjg@chromium.org 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=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Jqpwju1d; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4DzPSv4pKKz9sVm for ; Mon, 15 Mar 2021 16:03:27 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A873A829A1; Mon, 15 Mar 2021 06:01:57 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Jqpwju1d"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D9EFF829C7; Mon, 15 Mar 2021 06:01:33 +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.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) (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 14B1D829C7 for ; Mon, 15 Mar 2021 06:01:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-pj1-x102b.google.com with SMTP id q2-20020a17090a2e02b02900bee668844dso13681882pjd.3 for ; Sun, 14 Mar 2021 22:01:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=U+5tH1rkp9v0Ok1SgKqILnkXLJoBrV/p5kpJ8OjwpfU=; b=Jqpwju1dLXpryQkQedeXdutEZXVOkg0HCqslwsuUtVaWFFvHyiZRywkzXBIZnaeD3K vJ5joHpUDKXdKF82SZoIJT20qq//WKFLmV6G0xwPZLijlcm+CLuUXubGYqa3ylw69nLn BPvJtR87vWIHeCeJB7EinoeFlTAwkeYtoarMc= 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=U+5tH1rkp9v0Ok1SgKqILnkXLJoBrV/p5kpJ8OjwpfU=; b=fq6I6TK7rc6fJkG0rLrrItJzfSA5PYRaZC6ewwWzfeRzVIXIoP/XIVfhEwiWXukfgn I14LXCNuP9uCHZ3Z7THnI1LruvMhhEIfeS0HjAV3eOYc1/zaZDfZi7Pm558Soxrvc8pj /4CMZ8H8W6H73Z+GhlAIb3d4wt9DrThMNOPavHzfZixjiDZfeuftKMxn/B0cP6H0S1qH uBovYsAMoCXKNZ6eHSh8hxuOl33EmSiJTyyiB6sesvApNZUBmtH+wUHTxS3TacZopK9w aiYSKFIsOB++dr9JMeFaUCLc1ViOjk+GhWeLTUik4MOfNRy1UiUEjoGW6SZdajOIyt+y Zc6g== X-Gm-Message-State: AOAM5338akFaPZZBklXZMg6DXvbEDmFn4lfxpjTQgO/ho+by7X0rAwoL duhJjpwlBr3PSmrBMwnRhWbnk6nMfgSdwwus X-Google-Smtp-Source: ABdhPJy37+7V31kABoNtrxQ7djWquT1/5WjIMOT7Q/lSnfOLDAwL9+XeFEqvsA972vIYHWY7OTKzYg== X-Received: by 2002:a17:90a:f28e:: with SMTP id fs14mr10755045pjb.100.1615784487454; Sun, 14 Mar 2021 22:01:27 -0700 (PDT) Received: from sjg1.roam.corp.google.com (85.72.69.111.dynamic.snap.net.nz. [111.69.72.85]) by smtp.gmail.com with ESMTPSA id n10sm1921467pjo.15.2021.03.14.22.01.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Mar 2021 22:01:27 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Stefan Reinauer Subject: [PATCH 10/34] cbfs: Rename new_node to node Date: Mon, 15 Mar 2021 18:00:10 +1300 Message-Id: <20210315173656.10.Ic4a8ea943434c3ccaf35c1471b2844da8b7a2e8b@changeid> X-Mailer: git-send-email 2.31.0.rc2.261.g7f71774620-goog In-Reply-To: <20210315050034.1934660-1-sjg@chromium.org> References: <20210315050034.1934660-1-sjg@chromium.org> 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.4 at phobos.denx.de X-Virus-Status: Clean Rename this variable since there is no need to distinguish it from an old node. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- fs/cbfs/cbfs.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/fs/cbfs/cbfs.c b/fs/cbfs/cbfs.c index abc43ad33f6..c9323a562c6 100644 --- a/fs/cbfs/cbfs.c +++ b/fs/cbfs/cbfs.c @@ -87,7 +87,7 @@ static void swap_file_header(struct cbfs_fileheader *dest, * @param start The location in memory to start from. * @param size The size of the memory region to search. * @param align The alignment boundaries to check on. - * @param new_node A pointer to the file structure to load. + * @param node A pointer to the file structure to load. * @param used A pointer to the count of of bytes scanned through, * including the file if one is found. * @@ -95,7 +95,7 @@ static void swap_file_header(struct cbfs_fileheader *dest, * is found. */ static int file_cbfs_next_file(struct cbfs_priv *priv, void *start, int size, - int align, struct cbfs_cachenode *new_node, + int align, struct cbfs_cachenode *node, int *used) { struct cbfs_fileheader header; @@ -121,15 +121,15 @@ static int file_cbfs_next_file(struct cbfs_priv *priv, void *start, int size, priv->result = CBFS_BAD_FILE; return -EBADF; } - new_node->next = NULL; - new_node->type = header.type; - new_node->data = start + header.offset; - new_node->data_length = header.len; + node->next = NULL; + node->type = header.type; + node->data = start + header.offset; + node->data_length = header.len; name_len = header.offset - sizeof(struct cbfs_fileheader); - new_node->name = (char *)file_header + + node->name = (char *)file_header + sizeof(struct cbfs_fileheader); - new_node->name_length = name_len; - new_node->attr_offset = header.attributes_offset; + node->name_length = name_len; + node->attr_offset = header.attributes_offset; step = header.len; if (step % align) @@ -146,7 +146,7 @@ static int file_cbfs_next_file(struct cbfs_priv *priv, void *start, int size, static int file_cbfs_fill_cache(struct cbfs_priv *priv, int size, int align) { struct cbfs_cachenode *cache_node; - struct cbfs_cachenode *new_node; + struct cbfs_cachenode *node; struct cbfs_cachenode **cache_tail = &priv->file_cache; void *start; @@ -164,21 +164,21 @@ static int file_cbfs_fill_cache(struct cbfs_priv *priv, int size, int align) int used; int ret; - new_node = (struct cbfs_cachenode *) + node = (struct cbfs_cachenode *) malloc(sizeof(struct cbfs_cachenode)); - if (!new_node) + if (!node) return -ENOMEM; - ret = file_cbfs_next_file(priv, start, size, align, new_node, + ret = file_cbfs_next_file(priv, start, size, align, node, &used); if (ret < 0) { - free(new_node); + free(node); if (ret == -ENOENT) break; return ret; } - *cache_tail = new_node; - cache_tail = &new_node->next; + *cache_tail = node; + cache_tail = &node->next; size -= used; start += used;