subsys: Replace printf by printk when applicable

Signed-off-by: Xavier Chapron <xavier.chapron@stimio.fr>
This commit is contained in:
Xavier Chapron 2020-05-07 12:08:02 +02:00 committed by Carles Cufí
parent 2a8ff02ef2
commit e5aaf21a73
7 changed files with 7 additions and 7 deletions

View file

@ -61,7 +61,7 @@ static void thread_analyze_cb(const struct k_thread *cthread, void *user_data)
name = k_thread_name_get((k_tid_t)thread);
if (!name || name[0] == '\0') {
name = hexname;
sprintf(hexname, "%p", (void *)thread);
snprintk(hexname, sizeof(hexname), "%p", (void *)thread);
}
err = k_thread_stack_space_get(thread, &unused);

View file

@ -659,7 +659,7 @@ void log_output_dropped_process(const struct log_output *log_output, u32_t cnt)
struct device *dev = (struct device *)log_output->control_block->ctx;
cnt = MIN(cnt, 9999);
len = snprintf(buf, sizeof(buf), "%d", cnt);
len = snprintk(buf, sizeof(buf), "%d", cnt);
buffer_write(outf, (u8_t *)prefix, sizeof(prefix) - 1, dev);
buffer_write(outf, buf, len, dev);

View file

@ -823,7 +823,7 @@ int do_write_op_json(struct lwm2m_message *msg)
}
/* combine base_name + name */
snprintf(full_name, sizeof(full_name), "%s%s",
snprintk(full_name, sizeof(full_name), "%s%s",
base_name, value);
/* parse full_name into path */

View file

@ -129,7 +129,7 @@ size_t plain_text_put_float32fix(struct lwm2m_output_context *out,
char buf[sizeof("000000")];
/* value of 123 -> "000123" -- ignore sign */
len = snprintf(buf, sizeof(buf), "%06d", abs(value->val2));
len = snprintk(buf, sizeof(buf), "%06d", abs(value->val2));
if (len != 6U) {
strcpy(buf, "0");
} else {

View file

@ -27,7 +27,7 @@ void otPlatDiagProcess(otInstance *aInstance,
ARG_UNUSED(aInstance);
/* Add more plarform specific diagnostics features here. */
snprintf(aOutput, aOutputMaxLen,
snprintk(aOutput, aOutputMaxLen,
"diag feature '%s' is not supported\r\n", argv[0]);
}

View file

@ -52,7 +52,7 @@ static int ot_cmd(const struct shell *shell, size_t argc, char *argv[])
buf_ptr += arg_len + 1;
}
arg_len = snprintf(buf_ptr, buf_len, "%s", argv[i]);
arg_len = snprintk(buf_ptr, buf_len, "%s", argv[i]);
if (arg_len >= buf_len) {
shell_fprintf(shell, SHELL_WARNING,

View file

@ -25,7 +25,7 @@ int zsock_getnameinfo(const struct sockaddr *addr, socklen_t addrlen,
}
if (serv != NULL) {
snprintf(serv, servlen, "%hu", ntohs(a->sin_port));
snprintk(serv, servlen, "%hu", ntohs(a->sin_port));
}
return 0;