]> git.baikalelectronics.ru Git - kernel.git/commit
ata: fix read_id() ata port operation interface
authorDamien Le Moal <damien.lemoal@opensource.wdc.com>
Tue, 4 Jan 2022 08:54:18 +0000 (17:54 +0900)
committerDamien Le Moal <damien.lemoal@opensource.wdc.com>
Fri, 14 Jan 2022 06:17:16 +0000 (15:17 +0900)
commitc8f19264a0c8abdb3d9926712d7e78acc2d608c6
tree1ed1469ec940ca4f96ea9a18e3e6904060f067bb
parentafc0ccdfa3e9c3583f5497c379fdce2579b76eec
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>
drivers/ata/ahci_brcm.c
drivers/ata/ahci_ceva.c
drivers/ata/ahci_xgene.c
drivers/ata/libata-core.c
drivers/ata/pata_it821x.c
drivers/ata/pata_netcell.c
include/linux/libata.h