diff --git a/nimble/host/src/ble_hs_hci_cmd.c b/nimble/host/src/ble_hs_hci_cmd.c index 5b99f5dd1..d95486cc6 100644 --- a/nimble/host/src/ble_hs_hci_cmd.c +++ b/nimble/host/src/ble_hs_hci_cmd.c @@ -478,7 +478,10 @@ ble_hs_hci_cmd_body_le_create_connection(const struct hci_create_conn *hcc, } /* Check connection latency */ - if ((hcc->conn_latency < BLE_HCI_CONN_LATENCY_MIN) || + if ( +#if BLE_HCI_CONN_LATENCY_MIN + (hcc->conn_latency < BLE_HCI_CONN_LATENCY_MIN) || +#endif (hcc->conn_latency > BLE_HCI_CONN_LATENCY_MAX)) { return BLE_ERR_INV_HCI_CMD_PARMS; } @@ -1379,7 +1382,10 @@ ble_hs_hci_check_conn_params(uint8_t phy, } /* Check connection latency */ - if ((params->conn_latency < BLE_HCI_CONN_LATENCY_MIN) || + if ( +#if BLE_HCI_CONN_LATENCY_MIN + (params->conn_latency < BLE_HCI_CONN_LATENCY_MIN) || +#endif (params->conn_latency > BLE_HCI_CONN_LATENCY_MAX)) { return BLE_ERR_INV_HCI_CMD_PARMS; } diff --git a/nimble/host/src/ble_hs_hci_evt.c b/nimble/host/src/ble_hs_hci_evt.c index ec412f2a1..7cbeccae3 100644 --- a/nimble/host/src/ble_hs_hci_evt.c +++ b/nimble/host/src/ble_hs_hci_evt.c @@ -678,7 +678,10 @@ ble_hs_hci_evt_le_conn_upd_complete(uint8_t subevent, uint8_t *data, int len) return BLE_HS_EBADDATA; } - if (evt.conn_latency < BLE_HCI_CONN_LATENCY_MIN || + if ( +#if BLE_HCI_CONN_LATENCY_MIN + (evt.conn_latency < BLE_HCI_CONN_LATENCY_MIN) || +#endif evt.conn_latency > BLE_HCI_CONN_LATENCY_MAX) { return BLE_HS_EBADDATA; @@ -736,7 +739,10 @@ ble_hs_hci_evt_le_conn_parm_req(uint8_t subevent, uint8_t *data, int len) return BLE_HS_EBADDATA; } - if (evt.latency < BLE_HCI_CONN_LATENCY_MIN || + if ( +#if BLE_HCI_CONN_LATENCY_MIN + (evt.latency < BLE_HCI_CONN_LATENCY_MIN) || +#endif evt.latency > BLE_HCI_CONN_LATENCY_MAX) { return BLE_HS_EBADDATA; diff --git a/porting/nimble/src/os_mempool.c b/porting/nimble/src/os_mempool.c index bce78ef81..7648d4911 100644 --- a/porting/nimble/src/os_mempool.c +++ b/porting/nimble/src/os_mempool.c @@ -70,7 +70,7 @@ os_mempool_init(struct os_mempool *mp, uint16_t blocks, uint32_t block_size, struct os_memblock *block_ptr; /* Check for valid parameters */ - if (!mp || (blocks < 0) || (block_size <= 0)) { + if (!mp || (block_size <= 0)) { return OS_INVALID_PARM; } diff --git a/porting/npl/freertos/src/npl_os_freertos.c b/porting/npl/freertos/src/npl_os_freertos.c index 515892737..53c0426df 100644 --- a/porting/npl/freertos/src/npl_os_freertos.c +++ b/porting/npl/freertos/src/npl_os_freertos.c @@ -294,10 +294,6 @@ npl_freertos_callout_reset(struct ble_npl_callout *co, ble_npl_time_t ticks) { BaseType_t woken1, woken2, woken3; - if (ticks < 0) { - return BLE_NPL_INVALID_PARAM; - } - if (ticks == 0) { ticks = 1; }