Skip to content

Commit 888df39

Browse files
committed
Merge branch 'bugfix/app_update_compile_warning' into 'master'
fix: app update compile warning See merge request sdk/ESP8266_RTOS_SDK!399
2 parents df029cf + c3e2d11 commit 888df39

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

components/app_update/esp_ota_ops.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,6 @@ static esp_err_t esp_rewrite_ota_data(esp_partition_subtype_t subtype)
303303
uint16_t ota_app_count = 0;
304304
uint32_t i = 0;
305305
uint32_t seq;
306-
const void *result = NULL;
307306

308307
find_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_OTA, NULL);
309308
if (find_partition != NULL) {
@@ -327,6 +326,7 @@ static esp_err_t esp_rewrite_ota_data(esp_partition_subtype_t subtype)
327326
return ESP_ERR_INVALID_ARG;
328327
}
329328
#ifdef CONFIG_TARGET_PLATFORM_ESP32
329+
const void *result = NULL;
330330
static spi_flash_mmap_memory_t ota_data_map;
331331
ret = esp_partition_mmap(find_partition, 0, find_partition->size, SPI_FLASH_MMAP_DATA, &result, &ota_data_map);
332332
if (ret != ESP_OK) {
@@ -343,13 +343,13 @@ static esp_err_t esp_rewrite_ota_data(esp_partition_subtype_t subtype)
343343
ret = spi_flash_read(find_partition->address, &s_ota_select[0], sizeof(ota_select));
344344
if (ret != ESP_OK) {
345345
ESP_LOGE(TAG, "read failed");
346-
return NULL;
346+
return ret;
347347
}
348348

349349
ret = spi_flash_read(find_partition->address + 0x1000, &s_ota_select[1], sizeof(ota_select));
350350
if (ret != ESP_OK) {
351351
ESP_LOGE(TAG, "read failed");
352-
return NULL;
352+
return ret;
353353
}
354354
#endif
355355

@@ -465,7 +465,6 @@ const esp_partition_t *esp_ota_get_boot_partition(void)
465465
esp_err_t ret;
466466
const esp_partition_t *find_partition = NULL;
467467

468-
const void *result = NULL;
469468
uint16_t ota_app_count = 0;
470469
find_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_OTA, NULL);
471470

@@ -475,6 +474,7 @@ const esp_partition_t *esp_ota_get_boot_partition(void)
475474
}
476475

477476
#ifdef CONFIG_TARGET_PLATFORM_ESP32
477+
const void *result = NULL;
478478
static spi_flash_mmap_memory_t ota_data_map;
479479
ret = esp_partition_mmap(find_partition, 0, find_partition->size, SPI_FLASH_MMAP_DATA, &result, &ota_data_map);
480480
if (ret != ESP_OK) {

0 commit comments

Comments
 (0)