Skip to content

Commit

Permalink
[SCSI] pm8001: fix endian issue with code optimization.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Santosh Nayak authored and James Bottomley committed Apr 23, 2012
1 parent c6f5c93 commit fd00f7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions drivers/scsi/pm8001/pm8001_hwi.c
Original file line number Diff line number Diff line change
Expand Up @@ -3357,7 +3357,7 @@ mpi_fw_flash_update_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)
struct fw_control_ex fw_control_context;
struct fw_flash_Update_resp *ppayload =
(struct fw_flash_Update_resp *)(piomb + 4);
u32 tag = ppayload->tag;
u32 tag = le32_to_cpu(ppayload->tag);
struct pm8001_ccb_info *ccb = &pm8001_ha->ccb_info[tag];
status = le32_to_cpu(ppayload->status);
memcpy(&fw_control_context,
Expand Down Expand Up @@ -3703,8 +3703,8 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void* piomb)
*/
static void process_one_iomb(struct pm8001_hba_info *pm8001_ha, void *piomb)
{
u32 pHeader = (u32)*(u32 *)piomb;
u8 opc = (u8)(pHeader & 0xFFF);
__le32 pHeader = *(__le32 *)piomb;
u8 opc = (u8)((le32_to_cpu(pHeader)) & 0xFFF);

PM8001_MSG_DBG(pm8001_ha, pm8001_printk("process_one_iomb:"));

Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/pm8001/pm8001_hwi.h
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ struct fw_flash_Update_req {
*
*/
struct fw_flash_Update_resp {
dma_addr_t tag;
__le32 tag;
__le32 status;
u32 reserved[13];
} __attribute__((packed, aligned(4)));
Expand Down

0 comments on commit fd00f7c

Please sign in to comment.