/* Returns pointer to next entry in queue, or NULL if there are no new entried in the CRQ.  */
static struct viosrp_crq* crq_queue_next_crq(struct crq_queue *queue)
/* Returns pointer to next entry in queue, or NULL if there are no new entried in the CRQ.  */
static struct viosrp_crq* crq_queue_next_crq(struct crq_queue *queue)
{
	struct viosrp_crq *crq;
	unsigned long flags;
	spin_lock_irqsave(&queue->lock, flags);
	crq = &queue->msgs[queue->cur];
	if (crq->valid & 0x80) {
		if (++queue->cur == queue->size)
			queue->cur = 0;
	} else
		crq = NULL;
	spin_unlock_irqrestore(&queue->lock, flags);
	return crq;
}