Commit b9e002a3 authored by Justin Stitt's avatar Justin Stitt Committed by Miquel Raynal

mtd: rawnand: fix -Wvoid-pointer-to-enum-cast warning

When building with clang 18 I see the following warning:
|       drivers/mtd/nand/raw/vf610_nfc.c:853:17: warning: cast to smaller integer
|               type 'enum vf610_nfc_variant' from 'const void *' [-Wvoid-pointer-to-enum-cast]
|         853 |         nfc->variant = (enum vf610_nfc_variant)of_id->data;

This is due to the fact that `of_id->data` is a void* while `enum vf610_nfc_variant`
has the size of an int.

Cast `of_id->data` to a uintptr_t to silence the above warning for clang
builds using W=1.

Link: https://github.com/ClangBuiltLinux/linux/issues/1910Reported-by: default avatarNathan Chancellor <nathan@kernel.org>
Signed-off-by: default avatarJustin Stitt <justinstitt@google.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20230817-void-drivers-mtd-nand-raw-vf610_nfc-v2-1-870a7c948c44@google.com
parent a5a88125
...@@ -850,7 +850,7 @@ static int vf610_nfc_probe(struct platform_device *pdev) ...@@ -850,7 +850,7 @@ static int vf610_nfc_probe(struct platform_device *pdev)
goto err_disable_clk; goto err_disable_clk;
} }
nfc->variant = (enum vf610_nfc_variant)of_id->data; nfc->variant = (uintptr_t)of_id->data;
for_each_available_child_of_node(nfc->dev->of_node, child) { for_each_available_child_of_node(nfc->dev->of_node, child) {
if (of_device_is_compatible(child, "fsl,vf610-nfc-nandcs")) { if (of_device_is_compatible(child, "fsl,vf610-nfc-nandcs")) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment