From patchwork Tue Feb 26 16:11:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 223333 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 44BFC2C0090 for ; Wed, 27 Feb 2013 03:16:00 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CAEE74A152; Tue, 26 Feb 2013 17:15:00 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 ut0nH5aGV6AQ; Tue, 26 Feb 2013 17:15:00 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 48E674A15B; Tue, 26 Feb 2013 17:13:33 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B7D5E4A0BD for ; Tue, 26 Feb 2013 17:13:11 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 mHfdPExMbAJ7 for ; Tue, 26 Feb 2013 17:13:10 +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 mail-ve0-f201.google.com (mail-ve0-f201.google.com [209.85.128.201]) by theia.denx.de (Postfix) with ESMTPS id 418B54A0A1 for ; Tue, 26 Feb 2013 17:13:03 +0100 (CET) Received: by mail-ve0-f201.google.com with SMTP id 14so458777vea.0 for ; Tue, 26 Feb 2013 08:13:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=xescRlw9YPp6lbhSivq8Ucb6sl0QjXkUb8dUm0Qlpq8=; b=ZdA/oGE8KJCmpig+GbIF7vpnsW45ptQ4cjhdHoi9aeFuy48VAJC4/2//8tvk+3lMv6 MQfo6/yM5Q21PdJ7x0iXo90udElShVUhB74z4PVZDNG2XlwLUpAggywzmlRAnsLjEEjc 45Vhn+3FLfvXshFnDne7YBInOlPo2rl4SYVMB0L2SZh6JSPD7aEZLO5olHfv7lBvTbLZ utWv/K/9K9bnGMMwcMcJMI0afoZwAX0aTtPefmrcntK9WF4i3UEnFic6S7lqaM8CGqN4 3+M3j91dTi+PIEO8n0spj633Nw5FzSrgRIeN2Y1kfmvicQWbgCLvRV6M4xavd2UMokWV kqIw== X-Received: by 10.236.68.231 with SMTP id l67mr9675545yhd.29.1361895180940; Tue, 26 Feb 2013 08:13:00 -0800 (PST) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id u28si65178yhm.1.2013.02.26.08.13.00 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Tue, 26 Feb 2013 08:13:00 -0800 (PST) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id B52755A41E9; Tue, 26 Feb 2013 08:13:00 -0800 (PST) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 7861D160913; Tue, 26 Feb 2013 08:13:00 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Tue, 26 Feb 2013 08:11:01 -0800 Message-Id: <1361895069-7343-9-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.8.1.3 In-Reply-To: <1361895069-7343-1-git-send-email-sjg@chromium.org> References: <1361895069-7343-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQkfYaVuJ4yzmEv4/QdxM5bKkL/xWRNlXNdcPADXJLAM4jQE0FYQ4q4vHGFWZa3GleaR7wagKpwp6LQO3r1xs+B8t03ouWtlz7z2iebfmj5v47+vnfTEgFZGr2XXAly1ZFNKvBXermijm/4/Wq8KBA/2OmQp8RMDdPJYGVXIlbwprIrQPeDhWZe3j2UIv65LKv3UkH4i Cc: David Hendrix , Graeme Russ , Joe Hershberger , Tom Rini , Vadim Bendebury Subject: [U-Boot] [PATCH v3 08/16] main: Use get/setenv_ulong() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de These functions are now available, so use them to avoid extra code here. Signed-off-by: Simon Glass Reviewed-by: Joe Hershberger --- Changes in v3: None Changes in v2: None common/main.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/common/main.c b/common/main.c index e2eb9ec..8987444 100644 --- a/common/main.c +++ b/common/main.c @@ -318,8 +318,6 @@ static void process_boot_delay(void) #ifdef CONFIG_BOOTCOUNT_LIMIT unsigned long bootcount = 0; unsigned long bootlimit = 0; - char *bcs; - char bcs_set[16]; #endif /* CONFIG_BOOTCOUNT_LIMIT */ #ifdef CONFIG_OF_CONTROL char *env; @@ -331,10 +329,8 @@ static void process_boot_delay(void) bootcount = bootcount_load(); bootcount++; bootcount_store (bootcount); - sprintf (bcs_set, "%lu", bootcount); - setenv ("bootcount", bcs_set); - bcs = getenv ("bootlimit"); - bootlimit = bcs ? simple_strtoul (bcs, NULL, 10) : 0; + setenv_ulong("bootcount", bootcount); + bootlimit = getenv_ulong("bootlimit", 10, 0); #endif /* CONFIG_BOOTCOUNT_LIMIT */ s = getenv ("bootdelay");