diff options
author | Damien Le Moal <damien.lemoal@opensource.wdc.com> | 2022-01-04 11:04:49 +0100 |
---|---|---|
committer | Damien Le Moal <damien.lemoal@opensource.wdc.com> | 2022-01-14 07:17:16 +0100 |
commit | f8bc938ee6c60ec862fb5311789b6e277555f0b0 (patch) | |
tree | b1680195151fd0b07ccee76080111df351f42f4b /drivers/ata/sata_fsl.c | |
parent | ata: sata_fsl: fix scsi host initialization (diff) | |
download | linux-f8bc938ee6c60ec862fb5311789b6e277555f0b0.tar.xz linux-f8bc938ee6c60ec862fb5311789b6e277555f0b0.zip |
ata: sata_fsl: fix cmdhdr_tbl_entry and prde struct definitions
The fields of the cmdhdr_tbl_entry structure all store __le32 values,
and so are the dba and ddc_and_ext fields of the prde structure. Define
these fields using the __le32 type to avoid sparse warnings about
incorrect type in assignment.
The debug message in sata_fsl_setup_cmd_hdr_entry() is changed to
display the correct values of the cmdhdr_tbl_entry fields on big endian
systems.
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Diffstat (limited to 'drivers/ata/sata_fsl.c')
-rw-r--r-- | drivers/ata/sata_fsl.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c index 101d4dd79f62..da0152116d9f 100644 --- a/drivers/ata/sata_fsl.c +++ b/drivers/ata/sata_fsl.c @@ -221,10 +221,10 @@ enum { * 4 Dwords per command slot, command header size == 64 Dwords. */ struct cmdhdr_tbl_entry { - u32 cda; - u32 prde_fis_len; - u32 ttl; - u32 desc_info; + __le32 cda; + __le32 prde_fis_len; + __le32 ttl; + __le32 desc_info; }; /* @@ -259,9 +259,9 @@ struct command_desc { */ struct prde { - u32 dba; + __le32 dba; u8 fill[2 * 4]; - u32 ddc_and_ext; + __le32 ddc_and_ext; }; /* @@ -426,10 +426,10 @@ static void sata_fsl_setup_cmd_hdr_entry(struct ata_port *ap, pp->cmdslot[tag].desc_info = cpu_to_le32(desc_info | (tag & 0x1F)); ata_port_dbg(ap, "cda=0x%x, prde_fis_len=0x%x, ttl=0x%x, di=0x%x\n", - pp->cmdslot[tag].cda, - pp->cmdslot[tag].prde_fis_len, - pp->cmdslot[tag].ttl, pp->cmdslot[tag].desc_info); - + le32_to_cpu(pp->cmdslot[tag].cda), + le32_to_cpu(pp->cmdslot[tag].prde_fis_len), + le32_to_cpu(pp->cmdslot[tag].ttl), + le32_to_cpu(pp->cmdslot[tag].desc_info)); } static unsigned int sata_fsl_fill_sg(struct ata_queued_cmd *qc, void *cmd_desc, |