diff --git a/App/time_sync.c b/App/time_sync.c index 0bffdb40..accea4b9 100644 --- a/App/time_sync.c +++ b/App/time_sync.c @@ -36,7 +36,7 @@ static int time_sync_open_listener(void) { int retry; - int s = -1; + int s; for (retry = 0; retry < 5; retry++) { s = net_socket(NET_AF_INET, NET_SOCK_STREAM); diff --git a/App/util/ringbuf.c b/App/util/ringbuf.c index 7ce6fdba..62be778a 100644 --- a/App/util/ringbuf.c +++ b/App/util/ringbuf.c @@ -91,7 +91,7 @@ size_t ringbuf_peek(const ringbuf_t *rb, uint8_t *data, size_t len) { size_t n = 0; size_t i = 0; - size_t idx = 0; + size_t idx; n = ringbuf_avail(rb); n = (n < len) ? n : len; diff --git a/Drivers/BSP/GD5F2GQ5UE/gd5f2gq5ue.c b/Drivers/BSP/GD5F2GQ5UE/gd5f2gq5ue.c index 6d0f8617..231e186c 100644 --- a/Drivers/BSP/GD5F2GQ5UE/gd5f2gq5ue.c +++ b/Drivers/BSP/GD5F2GQ5UE/gd5f2gq5ue.c @@ -585,7 +585,7 @@ int gd5f2gq5ue_read_id(uint8_t *p_mid, uint8_t *p_did) { * 函数说明:自动处理跨页读取;offset+size 越界返回错误 */ int gd5f2gq5ue_read(long offset, uint8_t *p_buf, size_t size) { - int ret = GD5F_OK; + int ret; if (offset < 0 || (uint32_t)offset + (uint32_t)size > GD5F_TOTAL_SIZE) { return GD5F_ERROR; @@ -628,7 +628,7 @@ int gd5f2gq5ue_read(long offset, uint8_t *p_buf, size_t size) { * 函数说明:自动处理跨页写入;offset+size 越界返回错误 */ int gd5f2gq5ue_write(long offset, const uint8_t *p_buf, size_t size) { - int ret = GD5F_OK; + int ret; if (offset < 0 || (uint32_t)offset + (uint32_t)size > GD5F_TOTAL_SIZE) { return GD5F_ERROR; @@ -665,7 +665,7 @@ int gd5f2gq5ue_write(long offset, const uint8_t *p_buf, size_t size) { * 函数说明:循环擦除 [offset, offset+size) 覆盖的每个块,偏移/长度不对齐返回错误 */ int gd5f2gq5ue_erase(long offset, size_t size) { - int ret = GD5F_OK; + int ret; if (offset % GD5F_BLOCK_SIZE != 0) { return GD5F_ERROR;