From 42abbac90e652d46aaef1f75bd8d1bd747e78e19 Mon Sep 17 00:00:00 2001 From: Changpeng Liu Date: Mon, 2 Aug 2021 18:21:52 +0800 Subject: [PATCH] nvmf/vfio-user: eliminate cq_next function There is only one place to call it now, so just remove it. Change-Id: Ib16d640c80dbe79df46c965c5ee8bcd092e57b0d Signed-off-by: Changpeng Liu Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9013 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Reviewed-by: Aleksey Marchuk Reviewed-by: Ben Walker Reviewed-by: Ziye Yang Reviewed-by: Jim Harris --- lib/nvmf/vfio_user.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/nvmf/vfio_user.c b/lib/nvmf/vfio_user.c index 9e47e1068..31f2ed62a 100644 --- a/lib/nvmf/vfio_user.c +++ b/lib/nvmf/vfio_user.c @@ -691,14 +691,6 @@ asq_setup(struct nvmf_vfio_user_ctrlr *ctrlr) return 0; } -static inline uint16_t -cq_next(struct nvme_q *q) -{ - assert(q != NULL); - assert(q->is_cq); - return (q->tail + 1) % q->size; -} - static inline int queue_index(uint16_t qid, int is_cq) { @@ -730,8 +722,9 @@ cq_is_full(struct nvmf_vfio_user_ctrlr *ctrlr, struct nvme_q *q) { assert(ctrlr != NULL); assert(q != NULL); + assert(q->is_cq); - return cq_next(q) == *hdbl(ctrlr, q); + return ((q->tail + 1) % q->size) == *hdbl(ctrlr, q); } static inline void