From patchwork Sun Feb 24 17:26:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 222785 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 E85E02C02A3 for ; Mon, 25 Feb 2013 04:31:12 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1BCA04A175; Sun, 24 Feb 2013 18:31:02 +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 Q-8FZm7R6ec9; Sun, 24 Feb 2013 18:31:01 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1F33C4A17A; Sun, 24 Feb 2013 18:30:19 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7C5944A117 for ; Sun, 24 Feb 2013 18:30:07 +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 9hwz6FxAQN81 for ; Sun, 24 Feb 2013 18:30: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 mail-vb0-f73.google.com (mail-vb0-f73.google.com [209.85.212.73]) by theia.denx.de (Postfix) with ESMTPS id A40D64A148 for ; Sun, 24 Feb 2013 18:30:02 +0100 (CET) Received: by mail-vb0-f73.google.com with SMTP id fj18so222567vbb.4 for ; Sun, 24 Feb 2013 09:30:00 -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=JKDcsbne/PuR29JXkQ/Elsevmn+j7Rsyy5uC2FkbeGE=; b=ZSX3On7JyvrfCYypY96K3SfZ4yaHmZbT5tW7TSoshN2giVonjEIc97/GT6e+0wQmJ8 lXyMPEoPuftJG9Vnew/wEtirnsj22RS8SU+a6vQa2QDY/aARaH3tL4UYR1hcr6f8YYkK FpNS4cbPTF+NiCVaWRO1adFSviAv7XSZK59oSjw6DPpyVY6wAKZbnyaxawwf/qbgh1ST NSpIhE6K9q7GzhaOI5yUeMxQP6iP51E+wX8lrEVIYQwbqo75njC96lli5eZWfpa6xTNx fTE2t9nTiAIRFOJShOxeGKRVaq5ETODY0ljCfQlOoHaqXbnMh3D2x3A4pGn3RldDcLRJ es9A== X-Received: by 10.236.159.100 with SMTP id r64mr5210191yhk.20.1361727000562; Sun, 24 Feb 2013 09:30:00 -0800 (PST) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id r4si376873ann.2.2013.02.24.09.30.00 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Sun, 24 Feb 2013 09:30:00 -0800 (PST) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 60B9131C206; Sun, 24 Feb 2013 09:30:00 -0800 (PST) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 2328816097F; Sun, 24 Feb 2013 09:30:00 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Sun, 24 Feb 2013 09:26:06 -0800 Message-Id: <1361726773-18639-9-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.8.1.3 In-Reply-To: <1361726773-18639-1-git-send-email-sjg@chromium.org> References: <1361726773-18639-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQn7wPCdmVGUNfw0yDzreBaQSo3EBwK24wwGZlw3ovV82MQ4lYsE8c+nX5CqPNUsGXuAyJqJ0BRXhA4Qp5uP81aM1h0eAkLD4X273ZbZ/3MoUqRewi3qQ10dwTxZ2TJocs5HIXFyIMEXe7118Bil/Nu4qSPbNtpTZU7AfNJhVSZ08viWbN3OKdQvEYYhM0wEJ0hHmGgY Cc: David Hendrix , Graeme Russ , Joe Hershberger , Tom Rini , Vadim Bendebury Subject: [U-Boot] [RFC PATCH v2 08/15] 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 v2: None common/main.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/common/main.c b/common/main.c index 37e42ca..4f11e58 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");