Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

nvme: change return type of nvme_poll_cq() to bool

The nvme_poll_cq() function currently returns the number of CQEs
found, However, only one caller, nvme_poll(), requires a boolean
value to check whether any CQE was completed. The other callers do
not use the return value at all.

To better reflect its usage, update the return type of nvme_poll_cq()
from int to bool.

Signed-off-by: Yongsoo Joo <ysjoo@kookmin.ac.kr>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>

authored by

Yongsoo Joo and committed by
Keith Busch
002bb027 ac32057a

+4 -4
+4 -4
drivers/nvme/host/pci.c
··· 1147 1147 } 1148 1148 } 1149 1149 1150 - static inline int nvme_poll_cq(struct nvme_queue *nvmeq, 1151 - struct io_comp_batch *iob) 1150 + static inline bool nvme_poll_cq(struct nvme_queue *nvmeq, 1151 + struct io_comp_batch *iob) 1152 1152 { 1153 - int found = 0; 1153 + bool found = false; 1154 1154 1155 1155 while (nvme_cqe_pending(nvmeq)) { 1156 - found++; 1156 + found = true; 1157 1157 /* 1158 1158 * load-load control dependency between phase and the rest of 1159 1159 * the cqe requires a full read memory barrier