From d1117f8575dd3f72b9157b5a2677506bbae5be5a Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 22 Dec 2015 12:17:25 +0200 Subject: [PATCH] Bluetooth: drivers/h5: Remove unnecessary SIGNAL state The handling of SIGNAL and PAYLOAD states is exactly the same. Just remove the other one. Change-Id: Id82524812919658c6b1df76a7081c826aaf3df34 Signed-off-by: Johan Hedberg --- drivers/bluetooth/h5.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/bluetooth/h5.c b/drivers/bluetooth/h5.c index 5bc3f882257..ed7032d9a55 100644 --- a/drivers/bluetooth/h5.c +++ b/drivers/bluetooth/h5.c @@ -455,7 +455,6 @@ void bt_uart_isr(void *unused) START, HEADER, PAYLOAD, - SIGNAL, END, } status = START; @@ -527,7 +526,7 @@ void bt_uart_isr(void *unused) case HCI_3WIRE_LINK_PKT: case HCI_3WIRE_ACK_PKT: buf = bt_buf_get_sig(); - status = SIGNAL; + status = PAYLOAD; break; default: BT_ERR("Wrong packet type %u", @@ -536,27 +535,13 @@ void bt_uart_isr(void *unused) break; } break; - case SIGNAL: - memcpy(net_buf_add(buf, sizeof(byte)), &byte, - sizeof(byte)); - remaining--; - - if (remaining) { - break; - } - - status = END; - break; case PAYLOAD: memcpy(net_buf_add(buf, sizeof(byte)), &byte, sizeof(byte)); remaining--; - - if (remaining) { - break; + if (!remaining) { + status = END; } - - status = END; break; case END: if (!slip_delim) {