Fix code warning.
Change-Id: Ib11fb49f528d3688351ae349d5b4e307c28b3967
diff --git a/mbtk/mbtk_gnssd/agps/8122_agnss.c b/mbtk/mbtk_gnssd/agps/8122_agnss.c
index 34eef09..0bb7c5a 100755
--- a/mbtk/mbtk_gnssd/agps/8122_agnss.c
+++ b/mbtk/mbtk_gnssd/agps/8122_agnss.c
@@ -27,7 +27,7 @@
static int hd_agnss_uart_write(uint8_t *buf, uint32_t len)
{
- int TxLen;
+ int TxLen = -1;
if(hd_fd > 0)
{
TxLen = write(hd_fd,buf,len);
@@ -80,7 +80,7 @@
return src_len + 8;
}
-/************************************time inject*************************************/
+/************************************time inject*************************************/
static int gnss_inject_time(HD_AGNSS_UTC_TIME_TYPE *time)
{
uint8_t cmd[24] = {0}; /* packet head+payload */
@@ -185,7 +185,7 @@
return 0;
}
-/************************************eph data inject*************************************/
+/************************************eph data inject*************************************/
/**
* @brief get the eph frame and send to HD80xx
* @param data: the pointer of the eph data file
@@ -207,12 +207,12 @@
LOGE("malloc fail");
return INJECT_RESULT_FAIL;
}
-
+
eph_file_fd = open(eph_file_path, O_RDWR);
if (eph_file_fd <= 0)
{
LOGE("%s open file FAIL. errno:%d\n", __FUNCTION__, errno);
- goto error;
+ goto error;
}
while(0 < (size = read(eph_file_fd, (databuf + left_size), BUFFER_SIZE)))
{
@@ -230,7 +230,7 @@
if(write_size < 0)
{
LOGE("hd_agnss_uart_write fail");
- goto error;
+ goto error;
}
LOGD("%s Write[%d]\r\n", __FUNCTION__, write_size);
hd_agnss_delay(50);
@@ -281,7 +281,7 @@
}
}
}
-
+
if(databuf)
{
free(databuf);
@@ -326,17 +326,17 @@
HD_AGNSS_UTC_TIME_TYPE *UTC_time)
{
int ret = INJECT_RESULT_SUCCESS;
- if (UTC_time != NULL)
+ if (UTC_time != NULL)
{
gnss_inject_time(UTC_time);
}
- if ((latitude != 0) && (longitude != 0))
+ if ((latitude != 0) && (longitude != 0))
{
gnss_inject_location(latitude, longitude, altitude, accuracy);
}
- if (eph_file_path != NULL)
+ if (eph_file_path != NULL)
{
ret = gnss_eph_inject_data(eph_file_path);
if(ret < 0)