Skip to content

Commit

Permalink
logging: log_core: do not alias atomic_t
Browse files Browse the repository at this point in the history
Previously, a `uint32_t` was aliased as an `atomic_t`. However,
with zephyrproject-rtos#39531, `atomic_t` is now a `long` under the hood, which
is 64-bit on 64-bit platforms.

Fixes zephyrproject-rtos#40369

Signed-off-by: Christopher Friedt <[email protected]>
  • Loading branch information
cfriedt committed Nov 16, 2021
1 parent 9042b9a commit 49a218f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions subsys/logging/log_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static bool backend_attached;
static atomic_t buffered_cnt;
static atomic_t dropped_cnt;
static k_tid_t proc_tid;
static uint32_t log_strdup_in_use;
static atomic_t log_strdup_in_use;
static uint32_t log_strdup_max;
static uint32_t log_strdup_longest;
static struct k_timer log_process_thread_timer;
Expand Down Expand Up @@ -939,7 +939,7 @@ void z_log_free(void *str)
if (atomic_dec(&dup->refcount) == 1) {
k_mem_slab_free(&log_strdup_pool, (void **)&dup);
if (IS_ENABLED(CONFIG_LOG_STRDUP_POOL_PROFILING)) {
atomic_dec((atomic_t *)&log_strdup_in_use);
atomic_dec(&log_strdup_in_use);
}
}
}
Expand Down

0 comments on commit 49a218f

Please sign in to comment.