Skip to contentSkip to conversation

pmcraid: cpu_to_le32() => cpu_to_le64()

PATCH In review Dan Carpenter 2 participants 2 messages Dec 16, 2011 – Apr 30, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 pmcraid: cpu_to_le32() => cpu_to_le64()

The cpu_to_le32() truncates the address to 32 bits. All the other places that set .address use cpu_to_le64().

---
What about if dma_addr_t is 32 bits on a big endian system? Can that happen?

drivers/scsi/pmcraid.c +1 -1
index d6bc4e6..8a239ea 100644
@@ -1242,7 +1242,7 @@ static struct pmcraid_cmd *pmcraid_init_hcam
 
 	ioadl[0].flags |= IOADL_FLAGS_READ_LAST;
 	ioadl[0].data_len = cpu_to_le32(rcb_size);
-	ioadl[0].address = cpu_to_le32(dma);
+	ioadl[0].address = cpu_to_le64(dma);
 
 	cmd->cmd_done = cmd_done;
 	return cmd;
#1 lore raw

ping?

regards,
dan carpenter

Quoted 27 lines · Dan Carpenter

The cpu_to_le32() truncates the address to 32 bits. All the other places that set .address use cpu_to_le64().

---
What about if dma_addr_t is 32 bits on a big endian system? Can that happen?

drivers/scsi/pmcraid.c +1 -2
index d6bc4e6..8a239ea 100644
@@ -1242,7 +1242,7 @@ static struct pmcraid_cmd *pmcraid_init_hcam
 
 	ioadl[0].flags |= IOADL_FLAGS_READ_LAST;
 	ioadl[0].data_len = cpu_to_le32(rcb_size);
-	ioadl[0].address = cpu_to_le32(dma);
+	ioadl[0].address = cpu_to_le64(dma);
 
 	cmd->cmd_done = cmd_done;
 	return cmd;
--

To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html