/* Return a ptr to the next read wr in the SWSQ or NULL.  */
static void advance_oldest_read(struct t3_wq *wq)
/* Return a ptr to the next read wr in the SWSQ or NULL.  */
static void advance_oldest_read(struct t3_wq *wq)
{
	u32 rptr = wq->oldest_read - wq->sq + 1;
	u32 wptr = Q_PTR2IDX(wq->sq_wptr, wq->sq_size_log2);
	while (Q_PTR2IDX(rptr, wq->sq_size_log2) != wptr) {
		wq->oldest_read = wq->sq + Q_PTR2IDX(rptr, wq->sq_size_log2);
		if (wq->oldest_read->opcode == T3_READ_REQ)
			return;
		rptr++;
	}
	wq->oldest_read = NULL;
}