If a hardware event is targeting a CQ, that CQ should exist.
Add unlikely to error handling flows.
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Reviewed-by: Gal Pressman <galp@mellanox.com>
refcount_inc(&cq->refcount);
spin_unlock(&table->lock);
- if (!cq) {
+ if (unlikely(!cq)) {
mlx5_core_warn(eq->dev, "Completion event for bogus CQ 0x%x\n", cqn);
return;
}
spin_lock(&table->lock);
cq = radix_tree_lookup(&table->tree, cqn);
- if (cq)
+ if (likely(cq))
refcount_inc(&cq->refcount);
spin_unlock(&table->lock);
- if (!cq) {
+ if (unlikely(!cq)) {
mlx5_core_warn(eq->dev, "Async event for bogus CQ 0x%x\n", cqn);
return;
}