Skip to content

Commit 9d7fa99

Browse files
calebsanderaxboe
authored andcommitted
ublk: skip 1 NULL check in ublk_cmd_list_tw_cb() loop
ublk_cmd_list_tw_cb() is always performed on a non-empty request list. So don't check whether rq is NULL on the first iteration of the loop, just on subsequent iterations. Signed-off-by: Caleb Sander Mateos <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent dfbce8b commit 9d7fa99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/block/ublk_drv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,12 +1290,12 @@ static void ublk_cmd_list_tw_cb(struct io_uring_cmd *cmd,
12901290
struct ublk_queue *ubq = rq->mq_hctx->driver_data;
12911291
struct request *next;
12921292

1293-
while (rq) {
1293+
do {
12941294
next = rq->rq_next;
12951295
rq->rq_next = NULL;
12961296
ublk_dispatch_req(ubq, rq, issue_flags);
12971297
rq = next;
1298-
}
1298+
} while (rq);
12991299
}
13001300

13011301
static void ublk_queue_cmd_list(struct ublk_queue *ubq, struct rq_list *l)

0 commit comments

Comments
 (0)