Skip to content

Commit 815b6cb

Browse files
author
Damien Le Moal
committed
ata: ahci_ceva: Fix id array access in ceva_ahci_read_id()
ATA IDENTIFY command returns an array of le16 words. Accessing it as a u16 array triggers the following sparse warning: drivers/ata/ahci_ceva.c:107:33: warning: invalid assignment: &= drivers/ata/ahci_ceva.c:107:33: left side has type unsigned short drivers/ata/ahci_ceva.c:107:33: right side has type restricted __le16 Use a local variable to explicitly cast the id array to __le16 to avoid this warning. Signed-off-by: Damien Le Moal <[email protected]>
1 parent 0fcfb00 commit 815b6cb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/ata/ahci_ceva.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ struct ceva_ahci_priv {
9494
static unsigned int ceva_ahci_read_id(struct ata_device *dev,
9595
struct ata_taskfile *tf, u16 *id)
9696
{
97+
__le16 *__id = (__le16 *)id;
9798
u32 err_mask;
9899

99100
err_mask = ata_do_dev_read_id(dev, tf, id);
@@ -103,7 +104,7 @@ static unsigned int ceva_ahci_read_id(struct ata_device *dev,
103104
* Since CEVA controller does not support device sleep feature, we
104105
* need to clear DEVSLP (bit 8) in word78 of the IDENTIFY DEVICE data.
105106
*/
106-
id[ATA_ID_FEATURE_SUPP] &= cpu_to_le16(~(1 << 8));
107+
__id[ATA_ID_FEATURE_SUPP] &= cpu_to_le16(~(1 << 8));
107108

108109
return 0;
109110
}

0 commit comments

Comments
 (0)