u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH] lmb: Fix LMB_MEMORY_REGIONS flag usage
@ 2022-08-02  8:21 Patrice Chotard
  2022-08-02 10:23 ` Michal Simek
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Patrice Chotard @ 2022-08-02  8:21 UTC (permalink / raw)
  To: u-boot
  Cc: Patrice CHOTARD, Patrick DELAUNAY, U-Boot STM32,
	Ashok Reddy Soma, Heinrich Schuchardt, Ilias Apalodimas,
	Marek Vasut, Michal Simek, Simon Glass

This patch is fixing a broken boot observed on stm32mp157c-dk2 board.

IS_ENABLED macro should be used to check if a compilation flag is set
to "y" or "m".
LMB_MEMORY_REGIONS is set to a numerical value, IS_ENABLED macro is not
suitable in this case.

Fixes: 7c1860fce4e3 ("lmb: Fix lmb property's defination under struct lmb")
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
---

 include/lmb.h | 2 +-
 lib/lmb.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/lmb.h b/include/lmb.h
index 1476d78c28..7298c2ccc4 100644
--- a/include/lmb.h
+++ b/include/lmb.h
@@ -68,7 +68,7 @@ struct lmb_region {
 struct lmb {
 	struct lmb_region memory;
 	struct lmb_region reserved;
-#if IS_ENABLED(CONFIG_LMB_MEMORY_REGIONS)
+#ifdef CONFIG_LMB_MEMORY_REGIONS
 	struct lmb_property memory_regions[CONFIG_LMB_MEMORY_REGIONS];
 	struct lmb_property reserved_regions[CONFIG_LMB_RESERVED_REGIONS];
 #endif
diff --git a/lib/lmb.c b/lib/lmb.c
index f21fe672ae..c599608fa3 100644
--- a/lib/lmb.c
+++ b/lib/lmb.c
@@ -108,7 +108,7 @@ void lmb_init(struct lmb *lmb)
 #if IS_ENABLED(CONFIG_LMB_USE_MAX_REGIONS)
 	lmb->memory.max = CONFIG_LMB_MAX_REGIONS;
 	lmb->reserved.max = CONFIG_LMB_MAX_REGIONS;
-#elif IS_ENABLED(CONFIG_LMB_MEMORY_REGIONS)
+#elif defined(CONFIG_LMB_MEMORY_REGIONS)
 	lmb->memory.max = CONFIG_LMB_MEMORY_REGIONS;
 	lmb->reserved.max = CONFIG_LMB_RESERVED_REGIONS;
 	lmb->memory.region = lmb->memory_regions;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] lmb: Fix LMB_MEMORY_REGIONS flag usage
  2022-08-02  8:21 [PATCH] lmb: Fix LMB_MEMORY_REGIONS flag usage Patrice Chotard
@ 2022-08-02 10:23 ` Michal Simek
  2022-08-02 12:36 ` Tom Rini
  2022-08-10 21:51 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Michal Simek @ 2022-08-02 10:23 UTC (permalink / raw)
  To: Patrice Chotard, u-boot, Tom Rini
  Cc: Patrick DELAUNAY, U-Boot STM32, Ashok Reddy Soma,
	Heinrich Schuchardt, Ilias Apalodimas, Marek Vasut, Simon Glass



On 8/2/22 10:21, Patrice Chotard wrote:
> This patch is fixing a broken boot observed on stm32mp157c-dk2 board.
> 
> IS_ENABLED macro should be used to check if a compilation flag is set
> to "y" or "m".
> LMB_MEMORY_REGIONS is set to a numerical value, IS_ENABLED macro is not
> suitable in this case.
> 
> Fixes: 7c1860fce4e3 ("lmb: Fix lmb property's defination under struct lmb")
> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
> ---
> 
>   include/lmb.h | 2 +-
>   lib/lmb.c     | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/lmb.h b/include/lmb.h
> index 1476d78c28..7298c2ccc4 100644
> --- a/include/lmb.h
> +++ b/include/lmb.h
> @@ -68,7 +68,7 @@ struct lmb_region {
>   struct lmb {
>   	struct lmb_region memory;
>   	struct lmb_region reserved;
> -#if IS_ENABLED(CONFIG_LMB_MEMORY_REGIONS)
> +#ifdef CONFIG_LMB_MEMORY_REGIONS
>   	struct lmb_property memory_regions[CONFIG_LMB_MEMORY_REGIONS];
>   	struct lmb_property reserved_regions[CONFIG_LMB_RESERVED_REGIONS];
>   #endif
> diff --git a/lib/lmb.c b/lib/lmb.c
> index f21fe672ae..c599608fa3 100644
> --- a/lib/lmb.c
> +++ b/lib/lmb.c
> @@ -108,7 +108,7 @@ void lmb_init(struct lmb *lmb)
>   #if IS_ENABLED(CONFIG_LMB_USE_MAX_REGIONS)
>   	lmb->memory.max = CONFIG_LMB_MAX_REGIONS;
>   	lmb->reserved.max = CONFIG_LMB_MAX_REGIONS;
> -#elif IS_ENABLED(CONFIG_LMB_MEMORY_REGIONS)
> +#elif defined(CONFIG_LMB_MEMORY_REGIONS)
>   	lmb->memory.max = CONFIG_LMB_MEMORY_REGIONS;
>   	lmb->reserved.max = CONFIG_LMB_RESERVED_REGIONS;
>   	lmb->memory.region = lmb->memory_regions;

Acked-by: Michal Simek <michal.simek@amd.com>

Tom: Can you pick this up directly?

Thanks,
Michal

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] lmb: Fix LMB_MEMORY_REGIONS flag usage
  2022-08-02  8:21 [PATCH] lmb: Fix LMB_MEMORY_REGIONS flag usage Patrice Chotard
  2022-08-02 10:23 ` Michal Simek
@ 2022-08-02 12:36 ` Tom Rini
  2022-08-10 21:51 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2022-08-02 12:36 UTC (permalink / raw)
  To: Patrice Chotard
  Cc: u-boot, Patrick DELAUNAY, U-Boot STM32, Ashok Reddy Soma,
	Heinrich Schuchardt, Ilias Apalodimas, Marek Vasut, Michal Simek,
	Simon Glass

[-- Attachment #1: Type: text/plain, Size: 585 bytes --]

On Tue, Aug 02, 2022 at 10:21:35AM +0200, Patrice Chotard wrote:

> This patch is fixing a broken boot observed on stm32mp157c-dk2 board.
> 
> IS_ENABLED macro should be used to check if a compilation flag is set
> to "y" or "m".
> LMB_MEMORY_REGIONS is set to a numerical value, IS_ENABLED macro is not
> suitable in this case.
> 
> Fixes: 7c1860fce4e3 ("lmb: Fix lmb property's defination under struct lmb")
> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>

Reviewed-by: Tom Rini <trini@konsulko.com>

And I'll pick this up in a bit, thanks.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] lmb: Fix LMB_MEMORY_REGIONS flag usage
  2022-08-02  8:21 [PATCH] lmb: Fix LMB_MEMORY_REGIONS flag usage Patrice Chotard
  2022-08-02 10:23 ` Michal Simek
  2022-08-02 12:36 ` Tom Rini
@ 2022-08-10 21:51 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2022-08-10 21:51 UTC (permalink / raw)
  To: Patrice Chotard
  Cc: u-boot, Patrick DELAUNAY, U-Boot STM32, Ashok Reddy Soma,
	Heinrich Schuchardt, Ilias Apalodimas, Marek Vasut, Michal Simek,
	Simon Glass

[-- Attachment #1: Type: text/plain, Size: 628 bytes --]

On Tue, Aug 02, 2022 at 10:21:35AM +0200, Patrice Chotard wrote:

> This patch is fixing a broken boot observed on stm32mp157c-dk2 board.
> 
> IS_ENABLED macro should be used to check if a compilation flag is set
> to "y" or "m".
> LMB_MEMORY_REGIONS is set to a numerical value, IS_ENABLED macro is not
> suitable in this case.
> 
> Fixes: 7c1860fce4e3 ("lmb: Fix lmb property's defination under struct lmb")
> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Acked-by: Michal Simek <michal.simek@amd.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-10 21:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-02  8:21 [PATCH] lmb: Fix LMB_MEMORY_REGIONS flag usage Patrice Chotard
2022-08-02 10:23 ` Michal Simek
2022-08-02 12:36 ` Tom Rini
2022-08-10 21:51 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).