From 26056c8318eb273344e05ac6dc418ffa9a7b062c Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 9 Dec 2016 13:40:10 +0200 Subject: [PATCH] Bluetooth: Fix left-over printf usage These should have been converted to using printk instead. Change-Id: I62323704dad4fc51cc14ee4734acb6b325dcda14 Signed-off-by: Johan Hedberg --- subsys/bluetooth/host/monitor.c | 3 ++- subsys/bluetooth/host/uuid.c | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/host/monitor.c b/subsys/bluetooth/host/monitor.c index 818e2adcf1f..d599051b732 100644 --- a/subsys/bluetooth/host/monitor.c +++ b/subsys/bluetooth/host/monitor.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -84,7 +85,7 @@ void bt_log(int prio, const char *fmt, ...) int len, key; va_start(ap, fmt); - len = vsnprintf(NULL, 0, fmt, ap); + len = vsnprintk(NULL, 0, fmt, ap); va_end(ap); if (len < 0) { diff --git a/subsys/bluetooth/host/uuid.c b/subsys/bluetooth/host/uuid.c index 4f3ac4e3750..7df1bfde715 100644 --- a/subsys/bluetooth/host/uuid.c +++ b/subsys/bluetooth/host/uuid.c @@ -19,6 +19,7 @@ #include #include #include +#include #include @@ -100,10 +101,10 @@ void bt_uuid_to_str(const struct bt_uuid *uuid, char *str, size_t len) switch (uuid->type) { case BT_UUID_TYPE_16: - snprintf(str, len, "%.4x", BT_UUID_16(uuid)->val); + snprintk(str, len, "%.4x", BT_UUID_16(uuid)->val); break; case BT_UUID_TYPE_32: - snprintf(str, len, "%.4x", BT_UUID_32(uuid)->val); + snprintk(str, len, "%.4x", BT_UUID_32(uuid)->val); break; case BT_UUID_TYPE_128: memcpy(&tmp0, &BT_UUID_128(uuid)->val[0], sizeof(tmp0)); @@ -113,7 +114,7 @@ void bt_uuid_to_str(const struct bt_uuid *uuid, char *str, size_t len) memcpy(&tmp4, &BT_UUID_128(uuid)->val[10], sizeof(tmp4)); memcpy(&tmp5, &BT_UUID_128(uuid)->val[12], sizeof(tmp5)); - snprintf(str, len, "%.8x-%.4x-%.4x-%.4x-%.8x%.4x", + snprintk(str, len, "%.8x-%.4x-%.4x-%.4x-%.8x%.4x", tmp5, tmp4, tmp3, tmp2, tmp1, tmp0); break; default: