diff options
author | Santosh Nayak <santoshprasadnayak@gmail.com> | 2012-03-19 11:56:27 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-04-23 14:25:50 -0400 |
commit | fd00f7c1034391efa55bf87235a933fd76975af9 (patch) | |
tree | 4338a5c8d2c365f4b2b27499ee6cbabc27cb9da0 /drivers/scsi | |
parent | c6f5c93098f5577210f8f3ea22209b3f266c66af (diff) |
[SCSI] pm8001: fix endian issue with code optimization.
Data type of the 'tag' field of 'fw_flash_Update_resp' should be __le32.
Data type of 'pHeader' should be __le32. Remove 2nd cast to 'piomb'.
Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com>
Acked-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/pm8001/pm8001_hwi.c | 6 | ||||
-rw-r--r-- | drivers/scsi/pm8001/pm8001_hwi.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c index 9d82ee5c10d..2da0accf1a5 100644 --- a/drivers/scsi/pm8001/pm8001_hwi.c +++ b/drivers/scsi/pm8001/pm8001_hwi.c | |||
@@ -3357,7 +3357,7 @@ mpi_fw_flash_update_resp(struct pm8001_hba_info *pm8001_ha, void *piomb) | |||
3357 | struct fw_control_ex fw_control_context; | 3357 | struct fw_control_ex fw_control_context; |
3358 | struct fw_flash_Update_resp *ppayload = | 3358 | struct fw_flash_Update_resp *ppayload = |
3359 | (struct fw_flash_Update_resp *)(piomb + 4); | 3359 | (struct fw_flash_Update_resp *)(piomb + 4); |
3360 | u32 tag = ppayload->tag; | 3360 | u32 tag = le32_to_cpu(ppayload->tag); |
3361 | struct pm8001_ccb_info *ccb = &pm8001_ha->ccb_info[tag]; | 3361 | struct pm8001_ccb_info *ccb = &pm8001_ha->ccb_info[tag]; |
3362 | status = le32_to_cpu(ppayload->status); | 3362 | status = le32_to_cpu(ppayload->status); |
3363 | memcpy(&fw_control_context, | 3363 | memcpy(&fw_control_context, |
@@ -3703,8 +3703,8 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void* piomb) | |||
3703 | */ | 3703 | */ |
3704 | static void process_one_iomb(struct pm8001_hba_info *pm8001_ha, void *piomb) | 3704 | static void process_one_iomb(struct pm8001_hba_info *pm8001_ha, void *piomb) |
3705 | { | 3705 | { |
3706 | u32 pHeader = (u32)*(u32 *)piomb; | 3706 | __le32 pHeader = *(__le32 *)piomb; |
3707 | u8 opc = (u8)(pHeader & 0xFFF); | 3707 | u8 opc = (u8)((le32_to_cpu(pHeader)) & 0xFFF); |
3708 | 3708 | ||
3709 | PM8001_MSG_DBG(pm8001_ha, pm8001_printk("process_one_iomb:")); | 3709 | PM8001_MSG_DBG(pm8001_ha, pm8001_printk("process_one_iomb:")); |
3710 | 3710 | ||
diff --git a/drivers/scsi/pm8001/pm8001_hwi.h b/drivers/scsi/pm8001/pm8001_hwi.h index 1a4611eb032..d437309cb1e 100644 --- a/drivers/scsi/pm8001/pm8001_hwi.h +++ b/drivers/scsi/pm8001/pm8001_hwi.h | |||
@@ -599,7 +599,7 @@ struct fw_flash_Update_req { | |||
599 | * | 599 | * |
600 | */ | 600 | */ |
601 | struct fw_flash_Update_resp { | 601 | struct fw_flash_Update_resp { |
602 | dma_addr_t tag; | 602 | __le32 tag; |
603 | __le32 status; | 603 | __le32 status; |
604 | u32 reserved[13]; | 604 | u32 reserved[13]; |
605 | } __attribute__((packed, aligned(4))); | 605 | } __attribute__((packed, aligned(4))); |