esp_hw_support: fix gcc-12 compile errors

This commit is contained in:
Alexey Lapshin
2023-02-17 16:53:50 +08:00
parent ddd645e2c0
commit 1e3c18a94a

View File

@@ -198,7 +198,6 @@ void sleep_retention_entries_show_memories(void)
void * sleep_retention_find_link_by_id(int id) void * sleep_retention_find_link_by_id(int id)
{ {
void *link = NULL; void *link = NULL;
if (&s_retention.lock) {
_lock_acquire_recursive(&s_retention.lock); _lock_acquire_recursive(&s_retention.lock);
if (s_retention.highpri >= SLEEP_RETENTION_REGDMA_LINK_HIGHEST_PRIORITY && if (s_retention.highpri >= SLEEP_RETENTION_REGDMA_LINK_HIGHEST_PRIORITY &&
s_retention.highpri <= SLEEP_RETENTION_REGDMA_LINK_LOWEST_PRIORITY) { s_retention.highpri <= SLEEP_RETENTION_REGDMA_LINK_LOWEST_PRIORITY) {
@@ -207,7 +206,6 @@ void * sleep_retention_find_link_by_id(int id)
} }
} }
_lock_release_recursive(&s_retention.lock); _lock_release_recursive(&s_retention.lock);
}
return link; return link;
} }
@@ -331,7 +329,6 @@ static void sleep_retention_entries_all_destroy_wrapper(uint32_t module)
void sleep_retention_entries_destroy(int module) void sleep_retention_entries_destroy(int module)
{ {
assert(module != 0); assert(module != 0);
if (&s_retention.lock) {
_lock_acquire_recursive(&s_retention.lock); _lock_acquire_recursive(&s_retention.lock);
sleep_retention_entries_join(); sleep_retention_entries_join();
sleep_retention_entries_stats(); sleep_retention_entries_stats();
@@ -347,7 +344,6 @@ void sleep_retention_entries_destroy(int module)
return; return;
} }
_lock_acquire_recursive(&s_retention.lock); _lock_acquire_recursive(&s_retention.lock);
}
} }
static esp_err_t sleep_retention_entries_create_impl(const sleep_retention_entries_config_t retent[], int num, regdma_link_priority_t priority, int module) static esp_err_t sleep_retention_entries_create_impl(const sleep_retention_entries_config_t retent[], int num, regdma_link_priority_t priority, int module)
@@ -447,14 +443,12 @@ error:
void sleep_retention_entries_get(sleep_retention_entries_t *entries) void sleep_retention_entries_get(sleep_retention_entries_t *entries)
{ {
memset(entries, 0, sizeof(sleep_retention_entries_t)); memset(entries, 0, sizeof(sleep_retention_entries_t));
if (&s_retention.lock) {
_lock_acquire_recursive(&s_retention.lock); _lock_acquire_recursive(&s_retention.lock);
if (s_retention.highpri >= SLEEP_RETENTION_REGDMA_LINK_HIGHEST_PRIORITY && if (s_retention.highpri >= SLEEP_RETENTION_REGDMA_LINK_HIGHEST_PRIORITY &&
s_retention.highpri <= SLEEP_RETENTION_REGDMA_LINK_LOWEST_PRIORITY) { s_retention.highpri <= SLEEP_RETENTION_REGDMA_LINK_LOWEST_PRIORITY) {
memcpy(entries, &s_retention.lists[s_retention.highpri].entries, sizeof(sleep_retention_entries_t)); memcpy(entries, &s_retention.lists[s_retention.highpri].entries, sizeof(sleep_retention_entries_t));
} }
_lock_release_recursive(&s_retention.lock); _lock_release_recursive(&s_retention.lock);
}
} }
uint32_t IRAM_ATTR sleep_retention_get_modules(void) uint32_t IRAM_ATTR sleep_retention_get_modules(void)