消除unreadVariable:移除3处冗余变量初始化

This commit is contained in:
2026-09-01 13:45:02 +08:00
parent 5b569ea390
commit f1d5483a49
3 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -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;