From patchwork Sat Jul 9 13:05:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 646681 X-Patchwork-Delegate: hdegoede@redhat.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3rms6f3N6wz9sCk for ; Sat, 9 Jul 2016 23:05:46 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 92806A7521; Sat, 9 Jul 2016 15:05:42 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id b-CzzA88Hapv; Sat, 9 Jul 2016 15:05:42 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0E0D7A7530; Sat, 9 Jul 2016 15:05:40 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9EC4EA7517 for ; Sat, 9 Jul 2016 15:05:37 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0w5tDZ4cSifA for ; Sat, 9 Jul 2016 15:05:37 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by theia.denx.de (Postfix) with ESMTPS id 08428A74D2 for ; Sat, 9 Jul 2016 15:05:34 +0200 (CEST) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4A28780F6A; Sat, 9 Jul 2016 13:05:33 +0000 (UTC) Received: from shalem.localdomain.com (vpn1-5-171.ams2.redhat.com [10.36.5.171]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u69D5VoQ006047; Sat, 9 Jul 2016 09:05:31 -0400 From: Hans de Goede To: Ian Campbell Date: Sat, 9 Jul 2016 15:05:29 +0200 Message-Id: <1468069529-28442-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Sat, 09 Jul 2016 13:05:33 +0000 (UTC) Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH] sunxi: Remove some unnecessary #ifdefs X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- board/sunxi/board.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 955a44f..9767310 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 static void setup_environment(const void *fdt) { @@ -653,12 +650,10 @@ static void setup_environment(const void *fdt) } } -#ifdef CONFIG_MISC_INIT_R int misc_init_r(void) { int ret; -#if !defined(CONFIG_SPL_BUILD) setenv("fel_booted", NULL); setenv("fel_scriptaddr", NULL); /* determine if we are running in FEL mode */ @@ -666,7 +661,6 @@ int misc_init_r(void) setenv("fel_booted", "1"); parse_spl_header(SPL_ADDR); } -#endif setup_environment(gd->fdt_blob); @@ -679,7 +673,6 @@ int misc_init_r(void) return 0; } -#endif int ft_board_setup(void *blob, bd_t *bd) {