Skip to content

Commit 5dc6686

Browse files
cfriedtcarlescufi
authored andcommitted
logging: log_core: do not alias atomic_t
Previously, a `uint32_t` was aliased as an `atomic_t`. However, with #39531, `atomic_t` is now a `long` under the hood, which is 64-bit on 64-bit platforms. Fixes #40369 Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
1 parent c6f1027 commit 5dc6686

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
@@ -85,7 +85,7 @@ static bool backend_attached;
8585
static atomic_t buffered_cnt;
8686
static atomic_t dropped_cnt;
8787
static k_tid_t proc_tid;
88-
static uint32_t log_strdup_in_use;
88+
static atomic_t log_strdup_in_use;
8989
static uint32_t log_strdup_max;
9090
static uint32_t log_strdup_longest;
9191
static struct k_timer log_process_thread_timer;
@@ -939,7 +939,7 @@ void z_log_free(void *str)
939939
if (atomic_dec(&dup->refcount) == 1) {
940940
k_mem_slab_free(&log_strdup_pool, (void **)&dup);
941941
if (IS_ENABLED(CONFIG_LOG_STRDUP_POOL_PROFILING)) {
942-
atomic_dec((atomic_t *)&log_strdup_in_use);
942+
atomic_dec(&log_strdup_in_use);
943943
}
944944
}
945945
}

0 commit comments

Comments
 (0)