diff mbox series

[v4,14/27] lmb: bootm: remove superfluous lmb stub functions

Message ID 20240826115940.3233167-15-sughosh.ganu@linaro.org
State Accepted
Commit c2c50d52d9474ed8d6796d3def2083d5ad549dcc
Headers show
Series Make LMB memory map global and persistent | expand

Commit Message

Sughosh Ganu Aug. 26, 2024, 11:59 a.m. UTC
Remove a couple of superfluous LMB stub functions, and instead put a
check for calling the lmb_reserve() function.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
Changes since V3: None

 boot/bootm.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Comments

Ilias Apalodimas Aug. 27, 2024, 6:27 a.m. UTC | #1
On Mon, 26 Aug 2024 at 15:01, Sughosh Ganu <sughosh.ganu@linaro.org> wrote:
>
> Remove a couple of superfluous LMB stub functions, and instead put a
> check for calling the lmb_reserve() function.
>
> Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> ---
> Changes since V3: None
>
>  boot/bootm.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/boot/bootm.c b/boot/bootm.c
> index ddede08979..a61bbcfb45 100644
> --- a/boot/bootm.c
> +++ b/boot/bootm.c
> @@ -239,11 +239,6 @@ static int boot_get_kernel(const char *addr_fit, struct bootm_headers *images,
>         return 0;
>  }
>
> -#if !CONFIG_IS_ENABLED(LMB)
> -#define lmb_reserve(base, size)
> -static inline void boot_start_lmb(void) { }
> -#endif
> -
>  static int bootm_start(void)
>  {
>         memset((void *)&images, 0, sizeof(images));
> @@ -700,7 +695,9 @@ static int bootm_load_os(struct bootm_headers *images, int boot_progress)
>                 images->os.end = relocated_addr + image_size;
>         }
>
> -       lmb_reserve(images->os.load, (load_end - images->os.load));
> +       if (CONFIG_IS_ENABLED(LMB))
> +               lmb_reserve(images->os.load, (load_end - images->os.load));
> +
>         return 0;
>  }
>
> --
> 2.34.1
>

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
diff mbox series

Patch

diff --git a/boot/bootm.c b/boot/bootm.c
index ddede08979..a61bbcfb45 100644
--- a/boot/bootm.c
+++ b/boot/bootm.c
@@ -239,11 +239,6 @@  static int boot_get_kernel(const char *addr_fit, struct bootm_headers *images,
 	return 0;
 }
 
-#if !CONFIG_IS_ENABLED(LMB)
-#define lmb_reserve(base, size)
-static inline void boot_start_lmb(void) { }
-#endif
-
 static int bootm_start(void)
 {
 	memset((void *)&images, 0, sizeof(images));
@@ -700,7 +695,9 @@  static int bootm_load_os(struct bootm_headers *images, int boot_progress)
 		images->os.end = relocated_addr + image_size;
 	}
 
-	lmb_reserve(images->os.load, (load_end - images->os.load));
+	if (CONFIG_IS_ENABLED(LMB))
+		lmb_reserve(images->os.load, (load_end - images->os.load));
+
 	return 0;
 }