diff --git a/ports-foc/src/lib/l4lx/genode_block.cc b/ports-foc/src/lib/l4lx/genode_block.cc index a059963c21..2a9d9c65f4 100644 --- a/ports-foc/src/lib/l4lx/genode_block.cc +++ b/ports-foc/src/lib/l4lx/genode_block.cc @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -44,7 +45,7 @@ namespace { }; - enum { MAX = 128 }; + enum { MAX = Block::Session::TX_QUEUE_SIZE }; Req_entry _cache[MAX]; @@ -61,20 +62,16 @@ namespace { void insert(void *packet, void *request) { int idx = _find(0); - if (idx < 0) - PERR("Req cache is full!"); - else - _cache[idx] = Req_entry(packet, request); + ASSERT(idx >= 0, "Req cache full!"); + + _cache[idx] = Req_entry(packet, request); } void remove(void *packet, void **request) { int idx = _find(packet); + ASSERT(idx >= 0, "Req cache entry not found!"); - if (idx < 0) { - *request = 0; - PERR("Req cache entry not found!"); - } *request = _cache[idx].req; _cache[idx].pkt = 0; _cache[idx].req = 0;