TPL: TM2: f_thor: fix wrong size caused by casting s32 to u64
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 10 Apr 2017 11:14:02 +0000 (20:14 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Tue, 20 Oct 2020 01:35:21 +0000 (10:35 +0900)
Currently, in arm64 environment, thor download for a file more than
2GB size is failed because requested file size is not properly set.
It is because of assignment of a signed value to a bigger unsigned
type for the size of a file. So this patch fixes wrong size casting.
This also fixes to print debug information about the requested file
size with casted variable.

Change-Id: Id0e67035be05b0df346a8bb0ea17b5ba3e40e8f2
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
drivers/usb/gadget/f_thor.c

index 28e84b3f583d0b40accf18cd9e7d2d0c34a1857c..884eb1bba9fdd7ddf49ce79357b53aabefc04c5e 100644 (file)
@@ -290,7 +290,7 @@ static int process_rqt_download(const struct rqt_box *rqt)
                total_file_size = thor_file_size;
                downloaded_file_size = 0;
 #endif
-               debug("INIT: total %zu bytes\n", (size_t)rqt->int_data[0]);
+               debug("INIT: total %zu bytes\n", thor_file_size);
                break;
        case RQT_DL_FILE_INFO:
                file_type = rqt->int_data[0];