universal_address: fix cppcheck warnings

This commit is contained in:
Martine Lenders 2017-03-07 16:52:43 +01:00 committed by Oleg Hahm
parent c2c2516a53
commit 32c60cd0aa

View File

@ -91,6 +91,10 @@ static universal_address_container_t *universal_address_find_entry(uint8_t *addr
*/
static universal_address_container_t *universal_address_get_next_unused_entry(void)
{
/* cppcheck-suppress unsignedLessThanZero
* (reason: UNIVERSAL_ADDRESS_MAX_ENTRIES may be zero in which case this
* code is optimized out)
*/
if (universal_address_table_filled < UNIVERSAL_ADDRESS_MAX_ENTRIES) {
for (size_t i = 0; i < UNIVERSAL_ADDRESS_MAX_ENTRIES; ++i) {
if (universal_address_table[i].use_count == 0) {