u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm: riscv: Remove additional ifdef from code guarded by CONFIG_IS_ENABLED
@ 2022-07-07  8:47 Michal Simek
  2022-07-07 12:31 ` Tom Rini
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michal Simek @ 2022-07-07  8:47 UTC (permalink / raw)
  To: Simon Glass, u-boot, git
  Cc: Alexandru Gagniuc, Jan Kiszka, Leo, Marek Vasut, Peter Hoyes,
	Rick Chen, Tom Rini

CONFIG_OF_LIBFDT is used twice for guarding the same code. It is enough to
do it once that's why remove additional ifdefs from arm and risc-v code.

Fixes: 0c303f9a6628 ("image: Drop IMAGE_ENABLE_OF_LIBFDT")
Signed-off-by: Michal Simek <michal.simek@amd.com>
---

 arch/arm/lib/bootm.c   | 2 --
 arch/riscv/lib/bootm.c | 2 --
 2 files changed, 4 deletions(-)

diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index a59a5e6c0ea0..fc22befeac1f 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -200,12 +200,10 @@ static void boot_prep_linux(bootm_headers_t *images)
 	char *commandline = env_get("bootargs");
 
 	if (CONFIG_IS_ENABLED(OF_LIBFDT) && images->ft_len) {
-#ifdef CONFIG_OF_LIBFDT
 		debug("using: FDT\n");
 		if (image_setup_linux(images)) {
 			panic("FDT creation failed!");
 		}
-#endif
 	} else if (BOOTM_ENABLE_TAGS) {
 		debug("using: ATAGS\n");
 		setup_start_tag(gd->bd);
diff --git a/arch/riscv/lib/bootm.c b/arch/riscv/lib/bootm.c
index 2e1e286c8ef6..c1ac339283a6 100644
--- a/arch/riscv/lib/bootm.c
+++ b/arch/riscv/lib/bootm.c
@@ -65,13 +65,11 @@ static void announce_and_cleanup(int fake)
 static void boot_prep_linux(bootm_headers_t *images)
 {
 	if (CONFIG_IS_ENABLED(OF_LIBFDT) && images->ft_len) {
-#ifdef CONFIG_OF_LIBFDT
 		debug("using: FDT\n");
 		if (image_setup_linux(images)) {
 			printf("FDT creation failed! hanging...");
 			hang();
 		}
-#endif
 	} else {
 		printf("Device tree not found or missing FDT support\n");
 		hang();
-- 
2.36.1


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

* Re: [PATCH] arm: riscv: Remove additional ifdef from code guarded by CONFIG_IS_ENABLED
  2022-07-07  8:47 [PATCH] arm: riscv: Remove additional ifdef from code guarded by CONFIG_IS_ENABLED Michal Simek
@ 2022-07-07 12:31 ` Tom Rini
       [not found] ` <HK0PR03MB299426DC64F7B62933B03268C1879@HK0PR03MB2994.apcprd03.prod.outlook.com>
  2022-07-15  7:42 ` Michal Simek
  2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2022-07-07 12:31 UTC (permalink / raw)
  To: Michal Simek
  Cc: Simon Glass, u-boot, git, Alexandru Gagniuc, Jan Kiszka, Leo,
	Marek Vasut, Peter Hoyes, Rick Chen

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

On Thu, Jul 07, 2022 at 10:47:16AM +0200, Michal Simek wrote:

> CONFIG_OF_LIBFDT is used twice for guarding the same code. It is enough to
> do it once that's why remove additional ifdefs from arm and risc-v code.
> 
> Fixes: 0c303f9a6628 ("image: Drop IMAGE_ENABLE_OF_LIBFDT")
> Signed-off-by: Michal Simek <michal.simek@amd.com>

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

-- 
Tom

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

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

* Re: [PATCH] arm: riscv: Remove additional ifdef from code guarded by CONFIG_IS_ENABLED
       [not found] ` <HK0PR03MB299426DC64F7B62933B03268C1879@HK0PR03MB2994.apcprd03.prod.outlook.com>
@ 2022-07-11  7:26   ` Rick Chen
  0 siblings, 0 replies; 4+ messages in thread
From: Rick Chen @ 2022-07-11  7:26 UTC (permalink / raw)
  To: michal.simek
  Cc: U-Boot Mailing List, Simon Glass, git, mr.nuke.me, jan.kiszka,
	Marek Vasut, Peter.Hoyes, Tom Rini, Leo Liang, rick

> From: Michal Simek <michal.simek@amd.com>
> Sent: Thursday, July 07, 2022 4:47 PM
> To: Simon Glass <sjg@chromium.org>; u-boot@lists.denx.de; git@xilinx.com
> Cc: Alexandru Gagniuc <mr.nuke.me@gmail.com>; Jan Kiszka <jan.kiszka@siemens.com>; Leo Yu-Chi Liang(梁育齊) <ycliang@andestech.com>; Marek Vasut <marex@denx.de>; Peter Hoyes <Peter.Hoyes@arm.com>; Rick Jian-Zhi Chen(陳建志) <rick@andestech.com>; Tom Rini <trini@konsulko.com>
> Subject: [PATCH] arm: riscv: Remove additional ifdef from code guarded by CONFIG_IS_ENABLED
>
> CONFIG_OF_LIBFDT is used twice for guarding the same code. It is enough to do it once that's why remove additional ifdefs from arm and risc-v code.
>
> Fixes: 0c303f9a6628 ("image: Drop IMAGE_ENABLE_OF_LIBFDT")
> Signed-off-by: Michal Simek <michal.simek@amd.com>
> ---
>
>  arch/arm/lib/bootm.c   | 2 --
>  arch/riscv/lib/bootm.c | 2 --
>  2 files changed, 4 deletions(-)

Reviewed-by: Rick Chen <rick@andestech.com>

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

* Re: [PATCH] arm: riscv: Remove additional ifdef from code guarded by CONFIG_IS_ENABLED
  2022-07-07  8:47 [PATCH] arm: riscv: Remove additional ifdef from code guarded by CONFIG_IS_ENABLED Michal Simek
  2022-07-07 12:31 ` Tom Rini
       [not found] ` <HK0PR03MB299426DC64F7B62933B03268C1879@HK0PR03MB2994.apcprd03.prod.outlook.com>
@ 2022-07-15  7:42 ` Michal Simek
  2 siblings, 0 replies; 4+ messages in thread
From: Michal Simek @ 2022-07-15  7:42 UTC (permalink / raw)
  To: Simon Glass, u-boot, git
  Cc: Alexandru Gagniuc, Jan Kiszka, Leo, Marek Vasut, Peter Hoyes,
	Rick Chen, Tom Rini



On 7/7/22 10:47, Michal Simek wrote:
> CONFIG_OF_LIBFDT is used twice for guarding the same code. It is enough to
> do it once that's why remove additional ifdefs from arm and risc-v code.
> 
> Fixes: 0c303f9a6628 ("image: Drop IMAGE_ENABLE_OF_LIBFDT")
> Signed-off-by: Michal Simek <michal.simek@amd.com>
> ---
> 
>   arch/arm/lib/bootm.c   | 2 --
>   arch/riscv/lib/bootm.c | 2 --
>   2 files changed, 4 deletions(-)
> 
> diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> index a59a5e6c0ea0..fc22befeac1f 100644
> --- a/arch/arm/lib/bootm.c
> +++ b/arch/arm/lib/bootm.c
> @@ -200,12 +200,10 @@ static void boot_prep_linux(bootm_headers_t *images)
>   	char *commandline = env_get("bootargs");
>   
>   	if (CONFIG_IS_ENABLED(OF_LIBFDT) && images->ft_len) {
> -#ifdef CONFIG_OF_LIBFDT
>   		debug("using: FDT\n");
>   		if (image_setup_linux(images)) {
>   			panic("FDT creation failed!");
>   		}
> -#endif
>   	} else if (BOOTM_ENABLE_TAGS) {
>   		debug("using: ATAGS\n");
>   		setup_start_tag(gd->bd);
> diff --git a/arch/riscv/lib/bootm.c b/arch/riscv/lib/bootm.c
> index 2e1e286c8ef6..c1ac339283a6 100644
> --- a/arch/riscv/lib/bootm.c
> +++ b/arch/riscv/lib/bootm.c
> @@ -65,13 +65,11 @@ static void announce_and_cleanup(int fake)
>   static void boot_prep_linux(bootm_headers_t *images)
>   {
>   	if (CONFIG_IS_ENABLED(OF_LIBFDT) && images->ft_len) {
> -#ifdef CONFIG_OF_LIBFDT
>   		debug("using: FDT\n");
>   		if (image_setup_linux(images)) {
>   			printf("FDT creation failed! hanging...");
>   			hang();
>   		}
> -#endif
>   	} else {
>   		printf("Device tree not found or missing FDT support\n");
>   		hang();

Applied.
M
-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs


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

end of thread, other threads:[~2022-07-15  7:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-07  8:47 [PATCH] arm: riscv: Remove additional ifdef from code guarded by CONFIG_IS_ENABLED Michal Simek
2022-07-07 12:31 ` Tom Rini
     [not found] ` <HK0PR03MB299426DC64F7B62933B03268C1879@HK0PR03MB2994.apcprd03.prod.outlook.com>
2022-07-11  7:26   ` Rick Chen
2022-07-15  7:42 ` Michal Simek

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).