Fix to convert variable type explicitly 06/190606/4
authorDongwoo <dwoo08.lee@samsung.com>
Thu, 4 Oct 2018 01:22:47 +0000 (10:22 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 4 Oct 2018 10:50:27 +0000 (10:50 +0000)
This patch resolves svace warnings "SIGNED_TO_BIGGER_UNSIGNED", which
means assignment of a signed value which has type int(void*) to a
variable of a bigger integer type uint64_t.

Change-Id: Icb9576641a41f695272d61fd1f0847884b865935
Signed-off-by: Dongwoo <dwoo08.lee@samsung.com>
src/thor.c

index 5757d56..1d131cf 100644 (file)
@@ -171,7 +171,7 @@ static int thor_download_head(struct tfm_context *ctx, unsigned int packet_size)
                thor_send_data_rsp(conn, 0, ++usb_pkt_cnt);
        }
 
-       ctx->remain = (total - recv) + buf - ctx->transfer_buffer;
+       ctx->remain = (total - recv) + (uint64_t)(buf - ctx->transfer_buffer);
 
        if ((total - recv) > 0) {
                n = thor_rx_data(conn, buf, packet_size);