From 2d927d8dbf83bbe1bcba79d1d46272043c208cac Mon Sep 17 00:00:00 2001 From: Jakub Tyszkowski Date: Wed, 11 Feb 2015 15:34:06 +0100 Subject: [PATCH] android/gatt: Remove not needed checks and jumps In the end we check the status anyway so its safe to break out of switch statement. There is also no point in calling 'goto label' when the 'label' is right after switch statement closing bracket. --- android/gatt.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/android/gatt.c b/android/gatt.c index 44b3f0424..ae8fca568 100644 --- a/android/gatt.c +++ b/android/gatt.c @@ -6642,8 +6642,6 @@ static void att_handler(const uint8_t *ipdu, uint16_t len, gpointer user_data) break; case ATT_OP_WRITE_REQ: status = write_req_request(ipdu, len, dev); - if (!status) - return; break; case ATT_OP_WRITE_CMD: write_cmd_request(ipdu, len, dev); @@ -6655,22 +6653,18 @@ static void att_handler(const uint8_t *ipdu, uint16_t len, gpointer user_data) return; case ATT_OP_PREP_WRITE_REQ: status = write_prep_request(ipdu, len, dev); - if (!status) - return; break; case ATT_OP_FIND_BY_TYPE_REQ: status = find_by_type_request(ipdu, len, dev); break; case ATT_OP_EXEC_WRITE_REQ: status = write_execute_request(ipdu, len, dev); - if (!status) - return; break; case ATT_OP_READ_MULTI_REQ: default: DBG("Unsupported request 0x%02x", ipdu[0]); status = ATT_ECODE_REQ_NOT_SUPP; - goto done; + break; } done: -- 2.47.3