Re: [PATCH] nvme-pci: deduplicate empty request list checks in nvme_queue_rqs()

From: Christoph Hellwig

Date: Wed Nov 19 2025 - 00:48:52 EST


On Tue, Nov 18, 2025 at 07:17:00PM -0700, Caleb Sander Mateos wrote:
> nvme_queue_rqs() checks that nvmeq is non-NULL before calling
> nvme_submit_cmds() and nvme_submit_cmds() checks that submit_list is
> non-empty before doing anything. A NULL nvmeq means no requests were
> processed from the rqlist in nvme_queue_rqs() since the last call to
> nvme_submit_cmds(), which implies submit_list is empty. So just check
> that submit_list is non-empty before calling nvme_submit_cmds() and drop
> the check for NULL nvmeq.

What is the rationale for this? I had a hard time understanding the
logic in the new version, so I don't think this helps with readability
at least.