Skip to contentSkip to conversation

nvmet: fix the warning of assigne int to __le16

PATCH In review Guixin Liu 2 participants 2 messages Nov 8, 2024

Subsystems (2)
lore
Share & tools
lore

Guixin Liu

author
#0 lore raw

PATCH 1/1 nvmet: fix the warning of assigne int to __le16

Even though NVME_CNTLID_DYNAMIC is 0xffff, we still need use cpu_to_le16 to translate it to litte-endian.

---
 drivers/nvme/target/pr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/target/pr.c +1 -1
index 60899c22e7b6..bef82135a0e7 100644
@@ -854,7 +854,7 @@ static void nvmet_execute_pr_report(struct nvmet_req *req)
 		/*
 		 * Dynamic controller, set cntlid to 0xffff.
 		 */
-		ctrl_eds->cntlid = NVME_CNTLID_DYNAMIC;
+		ctrl_eds->cntlid = cpu_to_le16(NVME_CNTLID_DYNAMIC);
 		if (rtype == NVME_PR_WRITE_EXCLUSIVE_ALL_REGS ||
 		    rtype == NVME_PR_EXCLUSIVE_ACCESS_ALL_REGS)
 			ctrl_eds->rcsts = 1;
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 2 lines · Guixin Liu

Even though NVME_CNTLID_DYNAMIC is 0xffff, we still need use cpu_to_le16 to translate it to litte-endian.

Folded in, nvme-6.13 updated. Thanks.