Skip to content

Commit 0d01f0b

Browse files
cfriedtChristopher Friedt
authored andcommitted
logging: log_core: do not alias atomic_t
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 <chrisfriedt@gmail.com>
1 parent 1457b09 commit 0d01f0b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/logging/log_core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static bool backend_attached;
8686
static atomic_t buffered_cnt;
8787
static atomic_t dropped_cnt;
8888
static k_tid_t proc_tid;
89-
static uint32_t log_strdup_in_use;
89+
static atomic_t log_strdup_in_use;
9090
static uint32_t log_strdup_max;
9191
static uint32_t log_strdup_longest;
9292
static struct k_timer log_process_thread_timer;
@@ -953,7 +953,7 @@ void log_free(void *str)
953953
if (atomic_dec(&dup->refcount) == 1) {
954954
k_mem_slab_free(&log_strdup_pool, (void **)&dup);
955955
if (IS_ENABLED(CONFIG_LOG_STRDUP_POOL_PROFILING)) {
956-
atomic_dec((atomic_t *)&log_strdup_in_use);
956+
atomic_dec(&log_strdup_in_use);
957957
}
958958
}
959959
}

0 commit comments

Comments
 (0)