From patchwork Thu Dec 5 19:48:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 297381 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 4BACB2C00A1 for ; Fri, 6 Dec 2013 06:49:25 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5D540AB600; Thu, 5 Dec 2013 20:49: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 pajO9N5hDPOZ; Thu, 5 Dec 2013 20:49:11 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B9C52AB5EB; Thu, 5 Dec 2013 20:48:54 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5C6EDAB5EB for ; Thu, 5 Dec 2013 20:48:49 +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 xOWJNsePHx78 for ; Thu, 5 Dec 2013 20:48:44 +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-qc0-f176.google.com (mail-qc0-f176.google.com [209.85.216.176]) by theia.denx.de (Postfix) with ESMTPS id 5FA2CAB5DE for ; Thu, 5 Dec 2013 20:48:24 +0100 (CET) Received: by mail-qc0-f176.google.com with SMTP id i8so5180074qcq.21 for ; Thu, 05 Dec 2013 11:48:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=6E45pigNUhvXVjagz8EMI6JJOydQhyslw1rmniyjgME=; b=elCKbPIDYUFweh0x1SPzsuynKH1rDQba4X5XGGXAVBUmcnmdle9IsCk5UvskWCEHuO oeIUkkT36jiMNR05NHv23FyxJpm8iXu7TpyVnJGeW/IpDeQn2SBKxioEdZDNVese//QK dwa15+vSERWTfgDCcR0PgTVR301Y+N9S286UNQJQIgYUzRyMG/QAPoE8B4u1IPB6B4Ua 15BurQNH5tbwcVTTMsk8t/5z8diz9y7rdgbKDo04VXetbrOclVk5SrcHaXpbwr/X85Oy V2OVivT4ehD8l8HiZKV1ACU0feyM8eNya1SaUhtiP7jAjEZM3JEIuQ4N+QOgfS1Nyp+j x6gg== X-Received: by 10.224.61.1 with SMTP id r1mr107526442qah.97.1386272903186; Thu, 05 Dec 2013 11:48:23 -0800 (PST) Received: from localhost.localdomain (cpe-174-106-216-211.ec.res.rr.com. [174.106.216.211]) by mx.google.com with ESMTPSA id g10sm33931689qaf.9.2013.12.05.11.48.21 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Dec 2013 11:48:22 -0800 (PST) From: Tom Rini To: u-boot@lists.denx.de Date: Thu, 5 Dec 2013 14:48:39 -0500 Message-Id: <1386272919-22615-5-git-send-email-trini@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1386272919-22615-1-git-send-email-trini@ti.com> References: <1386272919-22615-1-git-send-email-trini@ti.com> Subject: [U-Boot] [PATCH 5/5] yaffs2: Use lldiv for 64bit division 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 Signed-off-by: Tom Rini --- fs/yaffs2/yaffs_uboot_glue.c | 3 ++- fs/yaffs2/yaffsfs.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/yaffs2/yaffs_uboot_glue.c b/fs/yaffs2/yaffs_uboot_glue.c index e113e40..50000a1 100644 --- a/fs/yaffs2/yaffs_uboot_glue.c +++ b/fs/yaffs2/yaffs_uboot_glue.c @@ -20,6 +20,7 @@ */ #include +#include #include #include "nand.h" @@ -184,7 +185,7 @@ void cmd_yaffs_devconfig(char *_mp, int flash_dev, } if (end_block == 0) - end_block = mtd->size / mtd->erasesize - 1; + end_block = lldiv(mtd->size, mtd->erasesize - 1); if (end_block < start_block) { printf("Bad start/end\n"); diff --git a/fs/yaffs2/yaffsfs.c b/fs/yaffs2/yaffsfs.c index ac4a010..334598e 100644 --- a/fs/yaffs2/yaffsfs.c +++ b/fs/yaffs2/yaffsfs.c @@ -11,6 +11,7 @@ * published by the Free Software Foundation. */ +#include #include "yaffsfs.h" #include "yaffs_guts.h" #include "yaffscfg.h" @@ -1603,8 +1604,8 @@ static int yaffsfs_DoStat(struct yaffs_obj *obj, struct yaffs_stat *buf) buf->st_rdev = obj->yst_rdev; buf->st_size = yaffs_get_obj_length(obj); buf->st_blksize = obj->my_dev->data_bytes_per_chunk; - buf->st_blocks = (buf->st_size + buf->st_blksize - 1) / - buf->st_blksize; + buf->st_blocks = lldiv(buf->st_size + buf->st_blksize - 1, + buf->st_blksize); #if CONFIG_YAFFS_WINCE buf->yst_wince_atime[0] = obj->win_atime[0]; buf->yst_wince_atime[1] = obj->win_atime[1];