From patchwork Wed Feb 14 18:14:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 873465 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zhSHY6bblz9sRW for ; Thu, 15 Feb 2018 05:15:04 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id C946AC220C8; Wed, 14 Feb 2018 18:14:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 940F0C21FD1; Wed, 14 Feb 2018 18:14:56 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 73F26C21FD1; Wed, 14 Feb 2018 18:14:55 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by lists.denx.de (Postfix) with ESMTPS id 13B9AC21E18 for ; Wed, 14 Feb 2018 18:14:55 +0000 (UTC) Received: from localhost.localdomain ([109.40.65.148]) by mail.gmx.com (mrgmx001 [212.227.17.184]) with ESMTPSA (Nemesis) id 0M9sa0-1ewysU1cq0-00B62n; Wed, 14 Feb 2018 19:14:50 +0100 From: Heinrich Schuchardt To: Tom Rini Date: Wed, 14 Feb 2018 19:14:43 +0100 Message-Id: <20180214181443.1926-1-xypron.glpk@gmx.de> X-Mailer: git-send-email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9knGiQ0jrtO1oZUGz5riyMw0BF56GbaZL9QZaAhJC3S 881kLjaDqN0qMMYmMbgX7o53jxrkj1UEyKw9sGBOEh92RRghVY= Cc: Heinrich Schuchardt , u-boot@lists.denx.de Subject: [U-Boot] [PATCH v2 1/1] fs: fat: avoid superfluous conversion calling set_cluster X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Parameter size of function set_cluster is of type unsigned long. It makes no sense to convert actsize to int before passing it to set_cluster as size. Let's use loff_t as type of parameter size to avoid any conversion. Signed-off-by: Heinrich Schuchardt --- v2 change type of parameter size --- fs/fat/fat_write.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c index 2b753df2820..270b2908acd 100644 --- a/fs/fat/fat_write.c +++ b/fs/fat/fat_write.c @@ -494,8 +494,7 @@ static __u32 determine_fatent(fsdata *mydata, __u32 entry) * Return 0 on success, -1 otherwise. */ static int -set_cluster(fsdata *mydata, __u32 clustnum, __u8 *buffer, - unsigned long size) +set_cluster(fsdata *mydata, __u32 clustnum, __u8 *buffer, loff_t size) { __u32 idx = 0; __u32 startsect; @@ -679,7 +678,7 @@ set_contents(fsdata *mydata, dir_entry *dentptr, __u8 *buffer, /* set remaining bytes */ actsize = filesize; - if (set_cluster(mydata, curclust, buffer, (int)actsize) != 0) { + if (set_cluster(mydata, curclust, buffer, actsize) != 0) { debug("error: writing cluster\n"); return -1; } @@ -696,7 +695,7 @@ set_contents(fsdata *mydata, dir_entry *dentptr, __u8 *buffer, return 0; getit: - if (set_cluster(mydata, curclust, buffer, (int)actsize) != 0) { + if (set_cluster(mydata, curclust, buffer, actsize) != 0) { debug("error: writing cluster\n"); return -1; }