Skip to content

Commit 7d7b0c8

Browse files
author
Damien Le Moal
committed
ata: ahci_brcm: Fix compilation warning
When compiling with clang and W=1, the following warning is generated: drivers/ata/ahci_brcm.c:451:18: error: cast to smaller integer type 'enum brcm_ahci_version' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] priv->version = (enum brcm_ahci_version)of_id->data; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix this by using a cast to unsigned long to match the "void *" type size of of_id->data. Signed-off-by: Damien Le Moal <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Acked-by: Florian Fainelli <[email protected]>
1 parent 0ffac47 commit 7d7b0c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/ata/ahci_brcm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ static int brcm_ahci_probe(struct platform_device *pdev)
448448
if (!of_id)
449449
return -ENODEV;
450450

451-
priv->version = (enum brcm_ahci_version)of_id->data;
451+
priv->version = (unsigned long)of_id->data;
452452
priv->dev = dev;
453453

454454
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "top-ctrl");

0 commit comments

Comments
 (0)