gadget: f_thor: fix wrong file size cast
[platform/kernel/u-boot.git] / drivers / usb / gadget / f_thor.c
index ed6cde8..f8dd8e6 100644 (file)
@@ -279,8 +279,8 @@ static int process_rqt_download(const struct rqt_box *rqt)
 
        switch (rqt->rqt_data) {
        case RQT_DL_INIT:
-               thor_file_size = (unsigned long long int)rqt->int_data[0] +
-                                (((unsigned long long int)rqt->int_data[1])
+               thor_file_size = (uint64_t)(uint32_t)rqt->int_data[0] +
+                                (((uint64_t)(uint32_t)rqt->int_data[1])
                                  << 32);
 #ifdef CONFIG_TIZEN
                total_file_size = thor_file_size;
@@ -297,8 +297,8 @@ static int process_rqt_download(const struct rqt_box *rqt)
                        break;
                }
 
-               thor_file_size = (unsigned long long int)rqt->int_data[1] +
-                                (((unsigned long long int)rqt->int_data[2])
+               thor_file_size = (uint64_t)(uint32_t)rqt->int_data[1] +
+                                (((uint64_t)(uint32_t)rqt->int_data[2])
                                  << 32);
                memcpy(f_name, rqt->str_data[0], F_NAME_BUF_SIZE);
                f_name[F_NAME_BUF_SIZE] = '\0';