[PATCH 5/7] mtd: rawnand: vf610: Fix Wvoid-pointer-to-enum-cast warning

Krzysztof Kozlowski
2026-01-02T12:49:52Z

"nfc->variant" is an enum, thus cast of pointer on 64-bit compile test
with clang W=1 causes:

vf610_nfc.c:843:17: error: cast to smaller integer type 'enum vf610_nfc_variant' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
drivers/mtd/nand/raw/vf610_nfc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/vf610_nfc.c b/drivers/mtd/nand/raw/vf610_nfc.c
index 4b5ba3187853..1955dc50b40a 100644
--- a/drivers/mtd/nand/raw/vf610_nfc.c
+++ b/drivers/mtd/nand/raw/vf610_nfc.c
@@ -840,7 +840,7 @@ static int vf610_nfc_probe(struct platform_device *pdev)
return PTR_ERR(nfc->clk);
}

- nfc->variant = (enum vf610_nfc_variant)device_get_match_data(&pdev->dev);
+ nfc->variant = (unsigned long)device_get_match_data(&pdev->dev);
if (!nfc->variant)
return -ENODEV;

--
2.51.0