Skip to content

Commit 4e1c64b

Browse files
lyakhlgirdwood
authored andcommitted
fast_get: replace tr_dbg() and tr_err() with LOG_*()
fast_get.c doesn't have a "trace context" - it doesn't have a DECLARE_TR_CTX() call. Hencs all calls to tr_err() and friends are wrong. Replace them with respective LOG_*() analogs. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent cdcf831 commit 4e1c64b

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

zephyr/lib/fast-get.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@
1616
#include <rtos/symbol.h>
1717
#include <ipc/topology.h>
1818

19+
#ifdef __ZEPHYR__
20+
#include <zephyr/logging/log.h>
21+
#else
22+
#define LOG_DBG(...) do {} while (0)
23+
#define LOG_INF(...) do {} while (0)
24+
#define LOG_WRN(...) do {} while (0)
25+
#define LOG_ERR(...) do {} while (0)
26+
#endif
27+
1928
struct sof_fast_get_entry {
2029
const void *dram_ptr;
2130
void *sram_ptr;
@@ -101,7 +110,7 @@ const void *fast_get(struct k_heap *heap, const void *dram_ptr, size_t size)
101110

102111
if (entry->sram_ptr) {
103112
if (entry->size != size || entry->dram_ptr != dram_ptr) {
104-
tr_err(fast_get, "size %u != %u or ptr %p != %p mismatch",
113+
LOG_ERR("size %u != %u or ptr %p != %p mismatch",
105114
entry->size, size, entry->dram_ptr, dram_ptr);
106115
ret = NULL;
107116
goto out;
@@ -128,8 +137,7 @@ const void *fast_get(struct k_heap *heap, const void *dram_ptr, size_t size)
128137
entry->refcount = 1;
129138
out:
130139
k_spin_unlock(&data->lock, key);
131-
tr_dbg(fast_get, "get %p, %p, size %u, refcnt %u", dram_ptr, ret, size,
132-
entry ? entry->refcount : 0);
140+
LOG_DBG("get %p, %p, size %u, refcnt %u", dram_ptr, ret, size, entry ? entry->refcount : 0);
133141

134142
return ret;
135143
}
@@ -157,7 +165,7 @@ void fast_put(struct k_heap *heap, const void *sram_ptr)
157165
key = k_spin_lock(&fast_get_data.lock);
158166
entry = fast_put_find_entry(data, sram_ptr);
159167
if (!entry) {
160-
tr_err(fast_get, "Put called to unknown address %p", sram_ptr);
168+
LOG_ERR("Put called to unknown address %p", sram_ptr);
161169
goto out;
162170
}
163171
entry->refcount--;
@@ -166,8 +174,8 @@ void fast_put(struct k_heap *heap, const void *sram_ptr)
166174
memset(entry, 0, sizeof(*entry));
167175
}
168176
out:
169-
tr_dbg(fast_get, "put %p, DRAM %p size %u refcnt %u", sram_ptr, entry ? entry->dram_ptr : 0,
170-
entry ? entry->size : 0, entry ? entry->refcount : 0);
177+
LOG_DBG("put %p, DRAM %p size %u refcnt %u", sram_ptr, entry ? entry->dram_ptr : 0,
178+
entry ? entry->size : 0, entry ? entry->refcount : 0);
171179
k_spin_unlock(&data->lock, key);
172180
}
173181
EXPORT_SYMBOL(fast_put);

0 commit comments

Comments
 (0)