]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ata: ahci-imx: Fix Wvoid-pointer-to-enum-cast warning
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Mon, 5 Jan 2026 14:29:46 +0000 (15:29 +0100)
committerDamien Le Moal <dlemoal@kernel.org>
Thu, 8 Jan 2026 08:43:00 +0000 (17:43 +0900)
"imxpriv->type" is an enum, thus cast of pointer on 64-bit compile test
with clang W=1 causes:

  ahci_imx.c:872:18: error: cast to smaller integer type 'enum ahci_imx_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
drivers/ata/ahci_imx.c

index 86aedd5923ac305c32c720b189a4e42a2ce2b2ae..3d26595524d3e27343285263a33d12ab596c1ec3 100644 (file)
@@ -869,7 +869,7 @@ static int imx_ahci_probe(struct platform_device *pdev)
        imxpriv->ahci_pdev = pdev;
        imxpriv->no_device = false;
        imxpriv->first_time = true;
-       imxpriv->type = (enum ahci_imx_type)device_get_match_data(dev);
+       imxpriv->type = (unsigned long)device_get_match_data(dev);
 
        imxpriv->sata_clk = devm_clk_get(dev, "sata");
        if (IS_ERR(imxpriv->sata_clk)) {