From 672d3676421dc55c6a41ba977ac124ff4b6aede1 Mon Sep 17 00:00:00 2001 From: Lyle Zhu Date: Fri, 13 Jun 2025 10:17:02 +0800 Subject: [PATCH] Bluetooth: Remove useless `sys_cpu_to_le16` for `uint8_t` type The target variable is a `uint8_t`. It is not reasonable to pass a value with `uint16_t` in little-endian format. Remove `sys_cpu_to_le16`, and pass the value directly. Signed-off-by: Lyle Zhu --- subsys/bluetooth/host/hci_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 335fdc642a3..9ac9e18459e 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -334,7 +334,7 @@ void bt_hci_host_num_completed_packets(struct net_buf *buf) } cp = net_buf_add(buf, sizeof(*cp)); - cp->num_handles = sys_cpu_to_le16(1); + cp->num_handles = 1; hc = net_buf_add(buf, sizeof(*hc)); hc->handle = sys_cpu_to_le16(handle);