public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [U-boot] [Patch] keystone2: replace printf on puts where it's possible
Date: Tue, 4 Nov 2014 11:46:32 -0500	[thread overview]
Message-ID: <20141104164632.GD15133@bill-the-cat> (raw)
In-Reply-To: <1415058293-923-1-git-send-email-ivan.khoronzhuk@ti.com>

On Tue, Nov 04, 2014 at 01:44:53AM +0200, Ivan Khoronzhuk wrote:

> It is better to use simple puts() function instead of printf()
> when it's possible. Also remove redundant sprintf().
> 
> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>

One of the outcomes of the mini-summit and I think was summarized on the
list as well was that we're going to stop with the "use puts instead of
printf!" thing as it ends up being more annoying to contributors than
useful in terms of functionality and code size.

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

This is good to fix however.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141104/74beee07/attachment.pgp>

  reply	other threads:[~2014-11-04 16:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-03 23:44 [U-Boot] [U-boot] [Patch] keystone2: replace printf on puts where it's possible Ivan Khoronzhuk
2014-11-04 16:46 ` Tom Rini [this message]
2014-11-04 17:05   ` Ivan Khoronzhuk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141104164632.GD15133@bill-the-cat \
    --to=trini@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox