Skip to content

Commit 26d9f48

Browse files
author
Damien Le Moal
committed
ata: ahci_imx: Fix compilation warning
When compiling with clang and W=1, the following warning is generated: drivers/ata/ahci_imx.c:1070:18: error: cast to smaller integer type 'enum ahci_imx_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] imxpriv->type = (enum ahci_imx_type)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]>
1 parent e8fbdf1 commit 26d9f48

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/ata/ahci_imx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,7 @@ static int imx_ahci_probe(struct platform_device *pdev)
10671067
imxpriv->ahci_pdev = pdev;
10681068
imxpriv->no_device = false;
10691069
imxpriv->first_time = true;
1070-
imxpriv->type = (enum ahci_imx_type)of_id->data;
1070+
imxpriv->type = (unsigned long)of_id->data;
10711071

10721072
imxpriv->sata_clk = devm_clk_get(dev, "sata");
10731073
if (IS_ERR(imxpriv->sata_clk)) {

0 commit comments

Comments
 (0)