From patchwork Wed Dec 26 18:57:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 208197 X-Patchwork-Delegate: sjg@chromium.org 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 B6F9B2C00C1 for ; Thu, 27 Dec 2012 06:00:36 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E87824A0FE; Wed, 26 Dec 2012 20:00:30 +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 ovRMY9C+s846; Wed, 26 Dec 2012 20:00:30 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 127354A108; Wed, 26 Dec 2012 19:58:48 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 099FD4A04C for ; Wed, 26 Dec 2012 19:57:51 +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 QPaLWRpTk16w for ; Wed, 26 Dec 2012 19:57:47 +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-gh0-f202.google.com (mail-gh0-f202.google.com [209.85.160.202]) by theia.denx.de (Postfix) with ESMTPS id 041194A09B for ; Wed, 26 Dec 2012 19:57:34 +0100 (CET) Received: by mail-gh0-f202.google.com with SMTP id z10so615239ghb.3 for ; Wed, 26 Dec 2012 10:57:31 -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=IrXJTIT4xYDZbjCQ/V5eEFsiPwaH227fMSti6kcsjEo=; b=I4OjJB0Uaxf7gZgL/qAM2wxKytDtwmBZYhcpgSdFeFZSTaDBwd5VB1mr9xWf0GkfCN Zo4NpCzCOUKUBR4GrzKRrbURKhipoJi5U48Cmf1NLXrs0ybhSS6KFkiOVRJKYpMkkINd bPc90qJxoXTcYtt2jtFxcXoZbrvA8DRKqqChoubF9kJpZ1kKHbztmD3EYaRn+YPHLkgE IOfYkXK0xB34WQeKdbShlhmJgRnizTpqCSqm5yS6k2vdMlzbFLmueW70gKFFUwGh/YEq dPwtwGwFCXbVtfgzaP/8fvRFHYEOq/0IIodqQh3cst+H+LbrC4mo3V7YRpUjj4ZXEKRD 7Vlw== X-Received: by 10.236.145.70 with SMTP id o46mr8909128yhj.7.1356548251568; Wed, 26 Dec 2012 10:57:31 -0800 (PST) Received: from wpzn4.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id s78si2351972yhh.3.2012.12.26.10.57.31 (version=TLSv1/SSLv3 cipher=AES128-SHA); Wed, 26 Dec 2012 10:57:31 -0800 (PST) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by wpzn4.hot.corp.google.com (Postfix) with ESMTP id 76ADF820055; Wed, 26 Dec 2012 10:57:31 -0800 (PST) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 57A6B161115; Wed, 26 Dec 2012 10:57:31 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Wed, 26 Dec 2012 10:57:06 -0800 Message-Id: <1356548233-5570-14-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1356548233-5570-1-git-send-email-sjg@chromium.org> References: <1356548233-5570-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQmygTP2TO2zCBVw7DcCKTNEmhID0BootQWxgmyvr3ygHTMK2liNqjh5eVMJjBLjpDYvxVyEv2yNTwAjqdMglvNoTu1eziMYHbLQRmUtOv8hXtPWAfbvk2h4gf2gECgc4cstjCoha6i/9RBjvND0C8dG+lRgczB/JgyPjnE+AxFqZs0zr6stfeHnLFRYRqS8fKdmOlyz Cc: Tom Rini , Joe Hershberger , Kumar Gala Subject: [U-Boot] [PATCH 13/20] drivers: Use new numeric setenv functions 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 Use setenv_ulong(), setenv_hex() and setenv_addr() in drivers/ Signed-off-by: Simon Glass --- fs/fs.c | 4 +--- fs/ubifs/ubifs.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/fs/fs.c b/fs/fs.c index 023e7ef..2c9f2c5 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -256,7 +256,6 @@ int do_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[], unsigned long bytes; unsigned long pos; int len_read; - char buf[12]; unsigned long time; if (argc < 2) @@ -308,8 +307,7 @@ int do_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[], } puts("\n"); - sprintf(buf, "0x%x", len_read); - setenv("filesize", buf); + setenv_hex("filesize", len_read); return 0; } diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c index 44be3f5..273c0a9 100644 --- a/fs/ubifs/ubifs.c +++ b/fs/ubifs/ubifs.c @@ -687,7 +687,6 @@ int ubifs_load(char *filename, u32 addr, u32 size) int i; int count; int last_block_size = 0; - char buf [10]; c->ubi = ubi_open_volume(c->vi.ubi_num, c->vi.vol_id, UBI_READONLY); /* ubifs_findfile will resolve symlinks, so we know that we get @@ -740,8 +739,7 @@ int ubifs_load(char *filename, u32 addr, u32 size) if (err) printf("Error reading file '%s'\n", filename); else { - sprintf(buf, "%X", size); - setenv("filesize", buf); + setenv_hex("filesize", size); printf("Done\n"); }