Skip to content

Commit abf8c74

Browse files
nordic-krchcfriedt
authored andcommitted
logging: Prefix internal functions with z_
There are 2 function in log_internal that were not prefixed. Signed-off-by: Krzysztof Chruscinski <[email protected]>
1 parent 03165c9 commit abf8c74

File tree

5 files changed

+23
-23
lines changed

5 files changed

+23
-23
lines changed

include/logging/log_internal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ bool z_log_dropped_pending(void);
4040
*
4141
* @param buf Buffer.
4242
*/
43-
void log_free(void *buf);
43+
void z_log_free(void *buf);
4444

4545
/* Initialize runtime filters */
4646
void z_log_runtime_filters_init(void);
@@ -54,13 +54,13 @@ void z_log_notify_backend_enabled(void);
5454
*
5555
* @return Pointer to the filter set.
5656
*/
57-
static inline uint32_t *log_dynamic_filters_get(uint32_t source_id)
57+
static inline uint32_t *z_log_dynamic_filters_get(uint32_t source_id)
5858
{
5959
return &__log_dynamic_start[source_id].filters;
6060
}
6161

6262
/** @brief Get number of registered sources. */
63-
static inline uint32_t log_sources_count(void)
63+
static inline uint32_t z_log_sources_count(void)
6464
{
6565
return log_const_source_id(__log_const_end);
6666
}

subsys/logging/log_cmds.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ static int log_status(const struct shell *shell,
9393
const struct log_backend *backend,
9494
size_t argc, char **argv)
9595
{
96-
uint32_t modules_cnt = log_sources_count();
96+
uint32_t modules_cnt = z_log_sources_count();
9797
uint32_t dynamic_lvl;
9898
uint32_t compiled_lvl;
9999

@@ -141,7 +141,7 @@ static int cmd_log_backend_status(const struct shell *shell,
141141

142142
static int module_id_get(const char *name)
143143
{
144-
uint32_t modules_cnt = log_sources_count();
144+
uint32_t modules_cnt = z_log_sources_count();
145145
const char *tmp_name;
146146
uint32_t i;
147147

@@ -162,7 +162,7 @@ static void filters_set(const struct shell *shell,
162162
int i;
163163
int id;
164164
bool all = argc ? false : true;
165-
int cnt = all ? log_sources_count() : argc;
165+
int cnt = all ? z_log_sources_count() : argc;
166166

167167
if (!backend->cb->active) {
168168
shell_warn(shell, "Backend not active.");

subsys/logging/log_core.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ bool log_is_strdup(const void *buf)
931931

932932
}
933933

934-
void log_free(void *str)
934+
void z_log_free(void *str)
935935
{
936936
struct log_strdup_buf *dup = CONTAINER_OF(str, struct log_strdup_buf,
937937
buf);
@@ -976,12 +976,12 @@ void z_vrfy_z_log_string_from_user(uint32_t src_level_val, const char *str)
976976
"Invalid log level"));
977977
Z_OOPS(Z_SYSCALL_VERIFY_MSG(domain_id == CONFIG_LOG_DOMAIN_ID,
978978
"Invalid log domain_id"));
979-
Z_OOPS(Z_SYSCALL_VERIFY_MSG(source_id < log_sources_count(),
979+
Z_OOPS(Z_SYSCALL_VERIFY_MSG(source_id < z_log_sources_count(),
980980
"Invalid log source id"));
981981

982982
if (IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING) &&
983983
(level != LOG_LEVEL_INTERNAL_RAW_STRING) &&
984-
(level > LOG_FILTER_SLOT_GET(log_dynamic_filters_get(source_id),
984+
(level > LOG_FILTER_SLOT_GET(z_log_dynamic_filters_get(source_id),
985985
LOG_FILTER_AGGR_SLOT_IDX))) {
986986
/* Skip filtered out messages. */
987987
return;
@@ -1074,12 +1074,12 @@ void z_vrfy_z_log_hexdump_from_user(uint32_t src_level_val, const char *metadata
10741074
src_level_union.structure.domain_id == CONFIG_LOG_DOMAIN_ID,
10751075
"Invalid log domain_id"));
10761076
Z_OOPS(Z_SYSCALL_VERIFY_MSG(
1077-
src_level_union.structure.source_id < log_sources_count(),
1077+
src_level_union.structure.source_id < z_log_sources_count(),
10781078
"Invalid log source id"));
10791079

10801080
if (IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING) &&
10811081
(src_level_union.structure.level > LOG_FILTER_SLOT_GET(
1082-
log_dynamic_filters_get(src_level_union.structure.source_id),
1082+
z_log_dynamic_filters_get(src_level_union.structure.source_id),
10831083
LOG_FILTER_AGGR_SLOT_IDX))) {
10841084
/* Skip filtered out messages. */
10851085
return;

subsys/logging/log_mgmt.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ void z_log_runtime_filters_init(void)
3333
* compile-time level. When backends are attached later on in
3434
* log_init(), they'll be initialized to the same value.
3535
*/
36-
for (int i = 0; i < log_sources_count(); i++) {
37-
uint32_t *filters = log_dynamic_filters_get(i);
36+
for (int i = 0; i < z_log_sources_count(); i++) {
37+
uint32_t *filters = z_log_dynamic_filters_get(i);
3838
uint8_t level = log_compiled_level_get(i);
3939

4040
LOG_FILTER_SLOT_SET(filters,
@@ -45,7 +45,7 @@ void z_log_runtime_filters_init(void)
4545

4646
uint32_t log_src_cnt_get(uint32_t domain_id)
4747
{
48-
return log_sources_count();
48+
return z_log_sources_count();
4949
}
5050

5151
/** @brief Get name of the log source.
@@ -60,7 +60,7 @@ static inline const char *log_name_get(uint32_t source_id)
6060

6161
const char *log_source_name_get(uint32_t domain_id, uint32_t src_id)
6262
{
63-
return src_id < log_sources_count() ? log_name_get(src_id) : NULL;
63+
return src_id < z_log_sources_count() ? log_name_get(src_id) : NULL;
6464
}
6565

6666
static uint32_t max_filter_get(uint32_t filters)
@@ -84,12 +84,12 @@ uint32_t z_impl_log_filter_set(struct log_backend const *const backend,
8484
uint32_t domain_id, int16_t source_id,
8585
uint32_t level)
8686
{
87-
__ASSERT_NO_MSG(source_id < log_sources_count());
87+
__ASSERT_NO_MSG(source_id < z_log_sources_count());
8888

8989
if (IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING)) {
9090
uint32_t new_aggr_filter;
9191

92-
uint32_t *filters = log_dynamic_filters_get(source_id);
92+
uint32_t *filters = z_log_dynamic_filters_get(source_id);
9393

9494
if (backend == NULL) {
9595
struct log_backend const *iter_backend;
@@ -139,7 +139,7 @@ uint32_t z_vrfy_log_filter_set(struct log_backend const *const backend,
139139
"Setting per-backend filters from user mode is not supported"));
140140
Z_OOPS(Z_SYSCALL_VERIFY_MSG(domain_id == CONFIG_LOG_DOMAIN_ID,
141141
"Invalid log domain_id"));
142-
Z_OOPS(Z_SYSCALL_VERIFY_MSG(src_id < log_sources_count(),
142+
Z_OOPS(Z_SYSCALL_VERIFY_MSG(src_id < z_log_sources_count(),
143143
"Invalid log source id"));
144144
Z_OOPS(Z_SYSCALL_VERIFY_MSG(
145145
(level <= LOG_LEVEL_DBG),
@@ -154,7 +154,7 @@ static void backend_filter_set(struct log_backend const *const backend,
154154
uint32_t level)
155155
{
156156
if (IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING)) {
157-
for (int i = 0; i < log_sources_count(); i++) {
157+
for (int i = 0; i < z_log_sources_count(); i++) {
158158
log_filter_set(backend, CONFIG_LOG_DOMAIN_ID, i, level);
159159
}
160160
}
@@ -185,14 +185,14 @@ void log_backend_disable(struct log_backend const *const backend)
185185
uint32_t log_filter_get(struct log_backend const *const backend,
186186
uint32_t domain_id, int16_t source_id, bool runtime)
187187
{
188-
__ASSERT_NO_MSG(source_id < log_sources_count());
188+
__ASSERT_NO_MSG(source_id < z_log_sources_count());
189189

190190
if (IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING) && runtime) {
191191
if (source_id < 0) {
192192
return LOG_LEVEL_DBG;
193193
}
194194

195-
uint32_t *filters = log_dynamic_filters_get(source_id);
195+
uint32_t *filters = z_log_dynamic_filters_get(source_id);
196196

197197
return LOG_FILTER_SLOT_GET(filters,
198198
log_backend_id_get(backend));

subsys/logging/log_msg.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static void msg_free(struct log_msg *msg)
134134
}
135135
}
136136
if (smask & BIT(i)) {
137-
log_free(buf);
137+
z_log_free(buf);
138138
}
139139
}
140140
}
@@ -147,7 +147,7 @@ static void msg_free(struct log_msg *msg)
147147
const char *str = log_msg_str_get(msg);
148148

149149
if (log_is_strdup(str)) {
150-
log_free((void *)(str));
150+
z_log_free((void *)(str));
151151
}
152152
} else {
153153
/* Message does not contain any arguments that might be a transient

0 commit comments

Comments
 (0)