mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
ata: fix read_id() ata port operation interface
Drivers that need to tweak a device IDENTIFY data implement the read_id() port operation. The IDENTIFY data buffer is passed as an argument to the read_id() operation for drivers to use. However, when this operation is called, the IDENTIFY data is not yet converted to CPU endian and contains le16 words. Change the interface of the read_id operation to pass a __le16 * pointer to the IDENTIFY data buffer to clarify the buffer endianness. Fix the pata_netcell, pata_it821x, ahci_xgene, ahci_ceva and ahci_brcm drivers implementation of this operation and modify the code to corretly deal with identify data words manipulation to avoid sparse warnings such as: drivers/ata/ahci_xgene.c:262:33: warning: invalid assignment: &= drivers/ata/ahci_xgene.c:262:33: left side has type unsigned short drivers/ata/ahci_xgene.c:262:33: right side has type restricted __le16 Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Reviewed-by: Hannes Reinecke <hare@suse.de>
This commit is contained in:
parent
2bce69072a
commit
0561e514c9
7 changed files with 24 additions and 24 deletions
|
@ -884,7 +884,8 @@ struct ata_port_operations {
|
|||
void (*set_piomode)(struct ata_port *ap, struct ata_device *dev);
|
||||
void (*set_dmamode)(struct ata_port *ap, struct ata_device *dev);
|
||||
int (*set_mode)(struct ata_link *link, struct ata_device **r_failed_dev);
|
||||
unsigned int (*read_id)(struct ata_device *dev, struct ata_taskfile *tf, u16 *id);
|
||||
unsigned int (*read_id)(struct ata_device *dev, struct ata_taskfile *tf,
|
||||
__le16 *id);
|
||||
|
||||
void (*dev_config)(struct ata_device *dev);
|
||||
|
||||
|
@ -1119,7 +1120,7 @@ extern void ata_id_string(const u16 *id, unsigned char *s,
|
|||
extern void ata_id_c_string(const u16 *id, unsigned char *s,
|
||||
unsigned int ofs, unsigned int len);
|
||||
extern unsigned int ata_do_dev_read_id(struct ata_device *dev,
|
||||
struct ata_taskfile *tf, u16 *id);
|
||||
struct ata_taskfile *tf, __le16 *id);
|
||||
extern void ata_qc_complete(struct ata_queued_cmd *qc);
|
||||
extern u64 ata_qc_get_active(struct ata_port *ap);
|
||||
extern void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue