Commit e4c397ee authored by Jan Sokolowski's avatar Jan Sokolowski Committed by Doug Ledford
Browse files

IB/hfi1: Remove unnecessary if check



A for loop condition of data_iovs in user_sdma_free_request
is unnecessarily repeated before the loop as an if check.

Remove the if enveloping the loop.

Reviewed-by: default avatarJakub Byczkowski <jakub.byczkowski@intel.com>
Signed-off-by: default avatarJan Sokolowski <jan.sokolowski@intel.com>
Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent d61ea075
Loading
Loading
Loading
Loading
+15 −15
Original line number Diff line number Diff line
@@ -1428,6 +1428,8 @@ static inline void pq_update(struct hfi1_user_sdma_pkt_q *pq)

static void user_sdma_free_request(struct user_sdma_request *req, bool unpin)
{
	int i;

	if (!list_empty(&req->txps)) {
		struct sdma_txreq *t, *p;

@@ -1439,12 +1441,10 @@ static void user_sdma_free_request(struct user_sdma_request *req, bool unpin)
			kmem_cache_free(req->pq->txreq_cache, tx);
		}
	}
	if (req->data_iovs) {
		struct sdma_mmu_node *node;
		int i;

	for (i = 0; i < req->data_iovs; i++) {
			node = req->iovs[i].node;
		struct sdma_mmu_node *node = req->iovs[i].node;

		if (!node)
			continue;

@@ -1454,7 +1454,7 @@ static void user_sdma_free_request(struct user_sdma_request *req, bool unpin)
		else
			atomic_dec(&node->refcount);
	}
	}

	kfree(req->tids);
	clear_bit(req->info.comp_idx, req->pq->req_in_use);
}