Skip to content

Commit f8bc938

Browse files
author
Damien Le Moal
committed
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 <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]>
1 parent e5b48ee commit f8bc938

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

drivers/ata/sata_fsl.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,10 @@ enum {
221221
* 4 Dwords per command slot, command header size == 64 Dwords.
222222
*/
223223
struct cmdhdr_tbl_entry {
224-
u32 cda;
225-
u32 prde_fis_len;
226-
u32 ttl;
227-
u32 desc_info;
224+
__le32 cda;
225+
__le32 prde_fis_len;
226+
__le32 ttl;
227+
__le32 desc_info;
228228
};
229229

230230
/*
@@ -259,9 +259,9 @@ struct command_desc {
259259
*/
260260

261261
struct prde {
262-
u32 dba;
262+
__le32 dba;
263263
u8 fill[2 * 4];
264-
u32 ddc_and_ext;
264+
__le32 ddc_and_ext;
265265
};
266266

267267
/*
@@ -426,10 +426,10 @@ static void sata_fsl_setup_cmd_hdr_entry(struct ata_port *ap,
426426
pp->cmdslot[tag].desc_info = cpu_to_le32(desc_info | (tag & 0x1F));
427427

428428
ata_port_dbg(ap, "cda=0x%x, prde_fis_len=0x%x, ttl=0x%x, di=0x%x\n",
429-
pp->cmdslot[tag].cda,
430-
pp->cmdslot[tag].prde_fis_len,
431-
pp->cmdslot[tag].ttl, pp->cmdslot[tag].desc_info);
432-
429+
le32_to_cpu(pp->cmdslot[tag].cda),
430+
le32_to_cpu(pp->cmdslot[tag].prde_fis_len),
431+
le32_to_cpu(pp->cmdslot[tag].ttl),
432+
le32_to_cpu(pp->cmdslot[tag].desc_info));
433433
}
434434

435435
static unsigned int sata_fsl_fill_sg(struct ata_queued_cmd *qc, void *cmd_desc,

0 commit comments

Comments
 (0)