]> granicus.if.org Git - esp-idf/commitdiff
app_update: clean up warning log when compile any project
authortzx <tianzhongxing@espressif.com>
Mon, 5 Dec 2016 05:32:10 +0000 (13:32 +0800)
committerAngus Gratton <angus@espressif.com>
Wed, 7 Dec 2016 21:49:53 +0000 (13:49 -0800)
components/app_update/esp_ota_ops.c

index 0c1a41337016f2c52141347e1e8ee8a527895298..e95937256f86b48fccd804f880d60a49665d54d3 100644 (file)
@@ -134,9 +134,7 @@ esp_err_t esp_ota_write(esp_ota_handle_t handle, const void *data, size_t size)
 
 esp_err_t esp_ota_end(esp_ota_handle_t handle)
 {
-    esp_err_t ret;
     ota_ops_entry_t *it;
-    size_t image_size;
     for (it = LIST_FIRST(&s_ota_ops_entries_head); it != NULL; it = LIST_NEXT(it, entries)) {
         if (it->handle == handle) {
             // an ota handle need to be ended after erased and wrote data in it
@@ -145,6 +143,8 @@ esp_err_t esp_ota_end(esp_ota_handle_t handle)
             }
 
 #ifdef CONFIG_SECUREBOOTLOADER
+            esp_err_t ret;
+            size_t image_size;
             if (esp_image_basic_verify(it->part.address, &image_size) != ESP_OK) {
                 return ESP_ERR_OTA_VALIDATE_FAILED;
             }
@@ -286,12 +286,12 @@ static esp_err_t esp_rewrite_ota_data(esp_partition_subtype_t subtype)
 esp_err_t esp_ota_set_boot_partition(const esp_partition_t *partition)
 {
     const esp_partition_t *find_partition = NULL;
-    size_t image_size;
     if (partition == NULL) {
         return ESP_ERR_INVALID_ARG;
     }
 
 #ifdef CONFIG_SECUREBOOTLOADER
+    size_t image_size;
     if (esp_image_basic_verify(partition->address, &image_size) != ESP_OK) {
         return ESP_ERR_OTA_VALIDATE_FAILED;
     }