[PATCH resend 2/2] imx: spl_imx_romapi.c: remove dead code

2023-10-16 Thread sbabic
> These IS_ENABLED(CONFIG_SPL_LOAD_FIT) cases can no longer be reached,
> and thus get_fit_image_size() is also redundant.
> Signed-off-by: Rasmus Villemoes 
> Reviewed-by: Fabio Estevam 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,Managing Director: Erika Unter  
HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


Re: [PATCH resend 2/2] imx: spl_imx_romapi.c: remove dead code

2023-09-20 Thread Fabio Estevam
On Tue, Sep 19, 2023 at 10:49 AM Rasmus Villemoes
 wrote:
>
> These IS_ENABLED(CONFIG_SPL_LOAD_FIT) cases can no longer be reached,
> and thus get_fit_image_size() is also redundant.
>
> Signed-off-by: Rasmus Villemoes 

Reviewed-by: Fabio Estevam 


[PATCH resend 2/2] imx: spl_imx_romapi.c: remove dead code

2023-09-19 Thread Rasmus Villemoes
These IS_ENABLED(CONFIG_SPL_LOAD_FIT) cases can no longer be reached,
and thus get_fit_image_size() is also redundant.

Signed-off-by: Rasmus Villemoes 
---
 arch/arm/mach-imx/spl_imx_romapi.c | 25 ++---
 1 file changed, 2 insertions(+), 23 deletions(-)

diff --git a/arch/arm/mach-imx/spl_imx_romapi.c 
b/arch/arm/mach-imx/spl_imx_romapi.c
index b9dfb3d41d..c4a4185eed 100644
--- a/arch/arm/mach-imx/spl_imx_romapi.c
+++ b/arch/arm/mach-imx/spl_imx_romapi.c
@@ -184,23 +184,6 @@ static ulong spl_ram_load_read(struct spl_load_info *load, 
ulong sector,
return count;
 }
 
-static ulong get_fit_image_size(void *fit)
-{
-   struct spl_image_info spl_image;
-   struct spl_load_info spl_load_info;
-   ulong last = (ulong)fit;
-
-   memset(_load_info, 0, sizeof(spl_load_info));
-   spl_load_info.bl_len = 1;
-   spl_load_info.read = spl_ram_load_read;
-   spl_load_info.priv = 
-
-   spl_load_simple_fit(_image, _load_info,
-   (uintptr_t)fit, fit);
-
-   return last - (ulong)fit;
-}
-
 static u8 *search_fit_header(u8 *p, int size)
 {
int i;
@@ -261,9 +244,7 @@ static int img_info_size(void *img_hdr)
 
 static int img_total_size(void *img_hdr)
 {
-   if (IS_ENABLED(CONFIG_SPL_LOAD_FIT)) {
-   return get_fit_image_size(img_hdr);
-   } else if (IS_ENABLED(CONFIG_SPL_LOAD_IMX_CONTAINER)) {
+   if (IS_ENABLED(CONFIG_SPL_LOAD_IMX_CONTAINER)) {
int total = get_container_size((ulong)img_hdr, NULL);
 
if (total < 0) {
@@ -386,9 +367,7 @@ static int spl_romapi_load_image_stream(struct 
spl_image_info *spl_image,
load.bl_len = 1;
load.read = spl_ram_load_read;
 
-   if (IS_ENABLED(CONFIG_SPL_LOAD_FIT))
-   return spl_load_simple_fit(spl_image, , (ulong)phdr, phdr);
-   else if (IS_ENABLED(CONFIG_SPL_LOAD_IMX_CONTAINER))
+   if (IS_ENABLED(CONFIG_SPL_LOAD_IMX_CONTAINER))
return spl_load_imx_container(spl_image, , (ulong)phdr);
 
return -1;
-- 
2.37.2