From: Hans de Goede Date: Sat, 9 Jul 2016 07:56:56 +0000 (+0200) Subject: sunxi: Remove some unnecessary #ifdefs X-Git-Tag: v2016.09-rc1~80^2~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4a8c7c1f45a25687e08ff98ab27ba664c8fd7b74;p=platform%2Fkernel%2Fu-boot.git sunxi: Remove some unnecessary #ifdefs We always define CONFIG_MISC_INIT_R on sunxi and misc_init_r is never called in the spl, so the linker will optimize it and parse_spl_header(), of which it is the only caller, away. On the tests I've done (Orange Pi PC build) the SPL actually becomes 8 bytes smaller with this patch. Signed-off-by: Hans de Goede Acked-by: Ian Campbell --- diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 5e48756..320958a 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -20,12 +20,14 @@ #include #include #include +#include #include #ifndef CONFIG_ARM64 #include #endif #include #include +#include #include #include #include @@ -572,10 +574,6 @@ void get_board_serial(struct tag_serialnr *serialnr) } #endif -#if !defined(CONFIG_SPL_BUILD) -#include -#include - /* * Check the SPL header for the "sunxi" variant. If found: parse values * that might have been passed by the loader ("fel" utility), and update @@ -608,7 +606,6 @@ static void parse_spl_header(const uint32_t spl_addr) /* otherwise assume .scr format (mkimage-type script) */ setenv_hex("fel_scriptaddr", spl->fel_script_address); } -#endif /* * Note this function gets called multiple times. @@ -657,12 +654,10 @@ static void setup_environment(const void *fdt) } } -#ifdef CONFIG_MISC_INIT_R int misc_init_r(void) { __maybe_unused int ret; -#if !defined(CONFIG_SPL_BUILD) setenv("fel_booted", NULL); setenv("fel_scriptaddr", NULL); /* determine if we are running in FEL mode */ @@ -670,7 +665,6 @@ int misc_init_r(void) setenv("fel_booted", "1"); parse_spl_header(SPL_ADDR); } -#endif setup_environment(gd->fdt_blob); @@ -683,7 +677,6 @@ int misc_init_r(void) return 0; } -#endif int ft_board_setup(void *blob, bd_t *bd) {