Bluetooth: controller: remove dup code in packet_rx_reserve_get()

The calculation in packet_rx_reserve_get() was already handled by
packet_rx_acquired_count_get().  So, let's use that code instead
and remove the duplication.

Change-Id: Ic76f70f1e78bebc74f5bef36cd92a3c332e489e9
Signed-off-by: Michael Scott <michael.scott@linaro.org>
This commit is contained in:
Michael Scott 2017-05-09 23:33:54 -07:00 committed by Johan Hedberg
commit 774567ea14

View file

@ -6813,18 +6813,9 @@ static struct radio_pdu_node_rx *packet_rx_reserve_get(u8_t count)
{
struct radio_pdu_node_rx *radio_pdu_node_rx;
if (_radio.packet_rx_last > _radio.packet_rx_acquire) {
if (count >
((_radio.packet_rx_count - _radio.packet_rx_last) +
_radio.packet_rx_acquire)) {
if (count > packet_rx_acquired_count_get()) {
return 0;
}
} else {
if (count >
(_radio.packet_rx_acquire - _radio.packet_rx_last)) {
return 0;
}
}
radio_pdu_node_rx = _radio.packet_rx[_radio.packet_rx_last];
radio_pdu_node_rx->hdr.type = NODE_RX_TYPE_DC_PDU;