From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexandru Gagniuc Date: Tue, 22 Dec 2020 17:54:46 -0600 Subject: [PATCH v2 5/8] spl: fit: Only look up FIT configuration node once In-Reply-To: <20201216000944.2832585-1-mr.nuke.me@gmail.com> References: <20201216000944.2832585-1-mr.nuke.me@gmail.com> Message-ID: <20201222235449.460100-6-mr.nuke.me@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de The configuration node a sub node under "/configurations", which describes the components to load from "/images". We only need to locate this node once. However, for each component, spl_fit_get_image_name() would parse the FIT image, looking for the correct node. Such work duplication is not necessary. Instead, once the node is found, cache it, and re-use it. Signed-off-by: Alexandru Gagniuc Reviewed-by: Simon Glass --- common/spl/spl_fit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index adcd6e3fcd..c3da5b1443 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -30,6 +30,7 @@ struct spl_fit_info { const void *fit; /* Pointer to a valid FIT blob */ size_t ext_data_offset; /* Offset to FIT external data (end of FIT) */ int images_node; /* FDT offset to "/images" node */ + int conf_node; /* FDT offset to selected configuration node */ }; __weak void board_spl_fit_post_load(const void *fit) -- 2.26.2