From patchwork Mon Feb 25 03:33:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 222835 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 2C34F2C0080 for ; Mon, 25 Feb 2013 14:37:01 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B67664A147; Mon, 25 Feb 2013 04:36:15 +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 aoFWGSX1Dz+P; Mon, 25 Feb 2013 04:36:15 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 892F34A182; Mon, 25 Feb 2013 04:34:45 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 447804A10A for ; Mon, 25 Feb 2013 04:34: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 PhY8R6Vbphur for ; Mon, 25 Feb 2013 04:34: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-ye0-f201.google.com (mail-ye0-f201.google.com [209.85.213.201]) by theia.denx.de (Postfix) with ESMTPS id 36A514A118 for ; Mon, 25 Feb 2013 04:33:56 +0100 (CET) Received: by mail-ye0-f201.google.com with SMTP id m12so49098yen.4 for ; Sun, 24 Feb 2013 19:33:55 -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=TxaLfpMA/MNDOQ0Y7MHZkc2IDnA30f7o4og4RJSixXo=; b=QkCzAKQaX/5dZqo1klCTX5Ecb2AS+5PZQbCdtmJ3GFpoFoZQNgMe2KaL6jPjNf9ueU SJIy9y4u6cL0fIWrzRTIcKhuD1ogiPAhouNqkxtxUngsLXiYSvYV30WI03f4vZZw/pWz kqYxSWtoW7YN7vcZjeINosK2LzgrLj2rQiWuu+NZGGj6o5V/pN8Y4Ip3Hw5OKjlF3cfk MvYytGkPtvp4Xc5YgMilkJ3urTJoN3TsiCOm9hjsIQIKQs4zBViyZf9fvVa1on5JxxfK zltXW8gkZNdQluq1VV4afTXdU1xlFPl5ljq0tEUA0MaIJxVdc8R6sgzLlA7fq6bEtP1y F6AQ== X-Received: by 10.236.9.10 with SMTP id 10mr6139210yhs.44.1361763234897; Sun, 24 Feb 2013 19:33:54 -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 h26si809128yhf.3.2013.02.24.19.33.54 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Sun, 24 Feb 2013 19:33:54 -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 BBCEA31C208; Sun, 24 Feb 2013 19:33:54 -0800 (PST) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 9D77E160537; Sun, 24 Feb 2013 19:33:54 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Sun, 24 Feb 2013 19:33:23 -0800 Message-Id: <1361763213-31183-14-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.8.1.3 In-Reply-To: <1361763213-31183-1-git-send-email-sjg@chromium.org> References: <1361763213-31183-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQkvpwUg0JqjNeZJcZqe5RcjjZWvitxfw1NnWInO55sM0lGGG8qgBFbFlasgwKhpjfVG8wSoJGmHme9yeTlOqxQaOxkGEZE3faNydZttwVaaRZiNmEiPkdFFjeDeGXlXEVPHYiJ2SjUKGQwyNf58lkVZlVg8QEVMRh5P8GE/oFwAzT6YL4eAxruK8on86Bz288ZXe7h/ Cc: Tom Rini Subject: [U-Boot] [PATCH v3 13/22] fs: 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 fs/ Signed-off-by: Simon Glass --- Changes in v3: - Change incorrect commit title from drivers: to fs: Changes in v2: None 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"); }