Skip to contentSkip to conversation

nvme-core: use nvme_is_io_ctrl() for I/O controller check

PATCH Applied Martin George 3 participants 3 messages Sep 22, 2025 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme-core: use nvme_is_io_ctrl() for I/O controller check

Replace the current I/O controller check in nvme_init_non_mdts_limits() with the helper nvme_is_io_ctrl() function to maintain consistency with similar checks in other parts of the code and improve code readability.

---
 drivers/nvme/host/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/core.c +1 -1
index edfe7a267a4b..a46f0f2d1c37 100644
@@ -3370,7 +3370,7 @@ static int nvme_init_non_mdts_limits(struct nvme_ctrl *ctrl)
 	else
 		ctrl->max_zeroes_sectors = 0;
 
-	if (ctrl->subsys->subtype != NVME_NQN_NVME ||
+	if (!nvme_is_io_ctrl(ctrl) ||
 	    !nvme_id_cns_ok(ctrl, NVME_ID_CNS_CS_CTRL) ||
 	    test_bit(NVME_CTRL_SKIP_ID_CNS_CS, &ctrl->flags))
 		return 0;
Signature · 1 line
2.43.0
maintainer Applied
#2 lore raw
In reply to Martin George
Quoted 4 lines · Martin George

Replace the current I/O controller check in nvme_init_non_mdts_limits() with the helper nvme_is_io_ctrl() function to maintain consistency with similar checks in other parts of the code and improve code readability.

Thanks, applied to nvme-6.18.