From patchwork Mon Nov 3 23:44:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 406375 X-Patchwork-Delegate: trini@ti.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 8A227140081 for ; Tue, 4 Nov 2014 10:45:14 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 527424B8F9; Tue, 4 Nov 2014 00:45:12 +0100 (CET) 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 Eflhg6IhPlgb; Tue, 4 Nov 2014 00:45:11 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 795064B8EB; Tue, 4 Nov 2014 00:45:11 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9B4B34B8EB for ; Tue, 4 Nov 2014 00:45:06 +0100 (CET) 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 p8MkgavRfQFr for ; Tue, 4 Nov 2014 00:45:06 +0100 (CET) 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 comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by theia.denx.de (Postfix) with ESMTPS id 446E84B8DE for ; Tue, 4 Nov 2014 00:45:01 +0100 (CET) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id sA3NixFw008145 for ; Mon, 3 Nov 2014 17:44:59 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id sA3NixsQ028688 for ; Mon, 3 Nov 2014 17:44:59 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Mon, 3 Nov 2014 17:44:58 -0600 Received: from khorivan.synapse.com (incasgf5a_e1_2.itg.ti.com [10.167.216.36]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id sA3NiuPC023194; Mon, 3 Nov 2014 17:44:57 -0600 From: Ivan Khoronzhuk To: , Date: Tue, 4 Nov 2014 01:44:53 +0200 Message-ID: <1415058293-923-1-git-send-email-ivan.khoronzhuk@ti.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Subject: [U-Boot] [U-boot] [Patch] keystone2: replace printf on puts where it's possible X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de It is better to use simple puts() function instead of printf() when it's possible. Also remove redundant sprintf(). Signed-off-by: Ivan Khoronzhuk --- arch/arm/cpu/armv7/keystone/ddr3.c | 2 +- arch/arm/cpu/armv7/keystone/keystone.c | 4 ++-- board/ti/ks2_evm/board.c | 7 ++----- board/ti/ks2_evm/ddr3_k2e.c | 4 ++-- board/ti/ks2_evm/ddr3_k2hk.c | 10 +++++----- board/ti/ks2_evm/ddr3_k2l.c | 2 +- 6 files changed, 13 insertions(+), 16 deletions(-) diff --git a/arch/arm/cpu/armv7/keystone/ddr3.c b/arch/arm/cpu/armv7/keystone/ddr3.c index 923906a..3e65c2e 100644 --- a/arch/arm/cpu/armv7/keystone/ddr3.c +++ b/arch/arm/cpu/armv7/keystone/ddr3.c @@ -352,7 +352,7 @@ void ddr3_err_reset_workaround(void) tmp_b = __raw_readl(KS2_DDR3B_DDRPHYC + KS2_DDRPHY_PGSR0_OFFSET); if (((tmp_a & 0x0FE00000) != 0) || ((tmp_b & 0x0FE00000) != 0)) { - printf("DDR Leveling Error Detected!\n"); + puts("DDR Leveling Error Detected!\n"); printf("DDR3A PGSR0 = 0x%x\n", tmp_a); printf("DDR3B PGSR0 = 0x%x\n", tmp_b); diff --git a/arch/arm/cpu/armv7/keystone/keystone.c b/arch/arm/cpu/armv7/keystone/keystone.c index 11a9357..52cb6fc 100644 --- a/arch/arm/cpu/armv7/keystone/keystone.c +++ b/arch/arm/cpu/armv7/keystone/keystone.c @@ -32,7 +32,7 @@ int cpu_to_bus(u32 *ptr, u32 length) static int turn_off_myself(void) { - printf("Turning off ourselves\r\n"); + puts("Turning off ourselves\r\n"); mon_power_off(0); psc_disable_module(KS2_LPSC_TETRIS); @@ -42,7 +42,7 @@ static int turn_off_myself(void) "dsb\n" "wfi\n"); - printf("What! Should not see that\n"); + puts("What! Should not see that\n"); return 0; } diff --git a/board/ti/ks2_evm/board.c b/board/ti/ks2_evm/board.c index 4029493..ff7bc4b 100644 --- a/board/ti/ks2_evm/board.c +++ b/board/ti/ks2_evm/board.c @@ -122,7 +122,6 @@ void ft_board_setup(void *blob, bd_t *bd) int nbanks; u64 size[2]; u64 start[2]; - char name[32]; int nodeoffset; u32 ddr3a_size; int unitrd_fixup = 0; @@ -158,15 +157,13 @@ void ft_board_setup(void *blob, bd_t *bd) } /* reserve memory at start of bank */ - sprintf(name, "mem_reserve_head"); - env = getenv(name); + env = getenv("mem_reserve_head"); if (env) { start[0] += ustrtoul(env, &endp, 0); size[0] -= ustrtoul(env, &endp, 0); } - sprintf(name, "mem_reserve"); - env = getenv(name); + env = getenv("mem_reserve"); if (env) size[0] -= ustrtoul(env, &endp, 0); diff --git a/board/ti/ks2_evm/ddr3_k2e.c b/board/ti/ks2_evm/ddr3_k2e.c index 40fd966..3f100ed 100644 --- a/board/ti/ks2_evm/ddr3_k2e.c +++ b/board/ti/ks2_evm/ddr3_k2e.c @@ -31,7 +31,7 @@ void ddr3_init(void) if (!strcmp(dimm_name, "18KSF1G72HZ-1G6E2 ")) { /* 8G SO-DIMM */ ddr3_size = 8; - printf("DRAM: 8 GiB\n"); + puts("DRAM: 8 GiB\n"); ddr3phy_1600_8g.zq0cr1 |= 0x10000; ddr3phy_1600_8g.zq1cr1 |= 0x10000; ddr3phy_1600_8g.zq2cr1 |= 0x10000; @@ -40,7 +40,7 @@ void ddr3_init(void) } else if (!strcmp(dimm_name, "18KSF51272HZ-1G6K2")) { /* 4G SO-DIMM */ ddr3_size = 4; - printf("DRAM: 4 GiB\n"); + puts("DRAM: 4 GiB\n"); ddr3_init_ddrphy(KS2_DDR3A_DDRPHYC, &ddr3phy_1600_4g); ddr3_init_ddremif(KS2_DDR3A_EMIF_CTRL_BASE, &ddr3_1600_4g); } diff --git a/board/ti/ks2_evm/ddr3_k2hk.c b/board/ti/ks2_evm/ddr3_k2hk.c index a1c3d05..115aed7 100644 --- a/board/ti/ks2_evm/ddr3_k2hk.c +++ b/board/ti/ks2_evm/ddr3_k2hk.c @@ -45,14 +45,14 @@ void ddr3_init(void) ddr3_init_ddremif(KS2_DDR3A_EMIF_CTRL_BASE, &ddr3_1600_8g); - printf("DRAM: Capacity 8 GiB (includes reported below)\n"); + puts("DRAM: Capacity 8 GiB (includes reported below)\n"); ddr3_size = 8; } else { ddr3_init_ddrphy(KS2_DDR3A_DDRPHYC, &ddr3phy_1600_8g); ddr3_1600_8g.sdcfg |= 0x1000; ddr3_init_ddremif(KS2_DDR3A_EMIF_CTRL_BASE, &ddr3_1600_8g); - printf("DRAM: Capacity 4 GiB (includes reported below)\n"); + puts("DRAM: Capacity 4 GiB (includes reported below)\n"); ddr3_size = 4; } } else if (!strcmp(dimm_name, "SQR-SD3T-2G1333SED")) { @@ -75,17 +75,17 @@ void ddr3_init(void) ddr3_init_ddremif(KS2_DDR3A_EMIF_CTRL_BASE, &ddr3_1333_2g); ddr3_size = 2; - printf("DRAM: 2 GiB"); + puts("DRAM: 2 GiB\n"); } else { ddr3_init_ddrphy(KS2_DDR3A_DDRPHYC, &ddr3phy_1333_2g); ddr3_1333_2g.sdcfg |= 0x1000; ddr3_init_ddremif(KS2_DDR3A_EMIF_CTRL_BASE, &ddr3_1333_2g); ddr3_size = 1; - printf("DRAM: 1 GiB"); + puts("DRAM: 1 GiB\n"); } } else { - printf("Unknown SO-DIMM. Cannot configure DDR3\n"); + puts("Unknown SO-DIMM. Cannot configure DDR3\n"); while (1) ; } diff --git a/board/ti/ks2_evm/ddr3_k2l.c b/board/ti/ks2_evm/ddr3_k2l.c index 15a14f2..32fb4b7 100644 --- a/board/ti/ks2_evm/ddr3_k2l.c +++ b/board/ti/ks2_evm/ddr3_k2l.c @@ -19,7 +19,7 @@ void ddr3_init(void) init_pll(&ddr3_400); /* No SO-DIMM, 2GB discreet DDR */ - printf("DRAM: 2 GiB\n"); + puts("DRAM: 2 GiB\n"); ddr3_size = 2; /* Reset DDR3 PHY after PLL enabled */