Skip to contentSkip to conversation

scsi: lpfc: Fix different base types in assignment

PATCH New Yang Li 1 participant 1 message Feb 19, 2021

Subsystems (2)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 scsi: lpfc: Fix different base types in assignment

Fix the following sparse warnings:
drivers/scsi/lpfc/lpfc_nvme.c:833:22: warning: incorrect type in assignment (different base types)

cpu_to_le32() returns __le32, but sgl->sge_len is uint32_t type.

---
 drivers/scsi/lpfc/lpfc_nvme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/lpfc/lpfc_nvme.c +1 -1
index 39d147e..b916a20 100644
@@ -833,7 +833,7 @@
 	 * operation.
 	 */
 	sgl = lpfc_ncmd->dma_sgl;
-	sgl->sge_len = cpu_to_le32(nCmd->cmdlen);
+	sgl->sge_len = (__force uint32_t)cpu_to_le32(nCmd->cmdlen);
 	if (phba->cfg_nvme_embed_cmd) {
 		sgl->addr_hi = 0;
 		sgl->addr_lo = 0;
Signature · 1 line
1.8.3.1