layer2/packet_queue: remove unused function packet_queue_can_add_packet()

This commit is contained in:
Simon Ruderich 2024-07-23 08:41:42 +02:00
parent 9845514a46
commit 8aacbaf8c3
2 changed files with 1 additions and 14 deletions

View file

@ -15,16 +15,9 @@ void packet_queue_destroy(packet_queue_t *q)
packet_queue_delete(q, packet_queue_get_used_space(q)); packet_queue_delete(q, packet_queue_get_used_space(q));
} }
bool packet_queue_can_add_packet(const packet_queue_t *q)
{
return packet_queue_get_free_space(q) != 0;
}
bool packet_queue_add(packet_queue_t *q, const layer2_packet_header_t *header, uint8_t *data, size_t data_len) bool packet_queue_add(packet_queue_t *q, const layer2_packet_header_t *header, uint8_t *data, size_t data_len)
{ {
if (!packet_queue_can_add_packet(q)) { if (packet_queue_get_free_space(q) == 0) {
return false; return false;
} }

View file

@ -29,12 +29,6 @@ void packet_queue_init(packet_queue_t *q);
*/ */
void packet_queue_destroy(packet_queue_t *q); void packet_queue_destroy(packet_queue_t *q);
/*!\brief Check if a packet can be added to the queue.
* \param q Pointer to the queue to check.
* \returns True if a packet can be added, false if the queue is full.
*/
bool packet_queue_can_add_packet(const packet_queue_t *q);
/*!\brief Add a packet to the queue. /*!\brief Add a packet to the queue.
* \details * \details
* This function takes ownership of the given data block which must be * This function takes ownership of the given data block which must be