public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/1] fs: fat: avoid superfluous conversion calling set_cluster
@ 2018-02-13 18:23 Heinrich Schuchardt
  2018-02-13 21:27 ` Lukasz Majewski
  0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2018-02-13 18:23 UTC (permalink / raw)
  To: 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.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 fs/fat/fat_write.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
index 2b753df2820..ccc03cecb6e 100644
--- a/fs/fat/fat_write.c
+++ b/fs/fat/fat_write.c
@@ -679,7 +679,8 @@ 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,
+				(unsigned long)actsize) != 0) {
 			debug("error: writing cluster\n");
 			return -1;
 		}
@@ -696,7 +697,8 @@ 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,
+				(unsigned long)actsize) != 0) {
 			debug("error: writing cluster\n");
 			return -1;
 		}
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-02-13 21:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-13 18:23 [U-Boot] [PATCH 1/1] fs: fat: avoid superfluous conversion calling set_cluster Heinrich Schuchardt
2018-02-13 21:27 ` Lukasz Majewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox