Skip to content

Commit b9e002a

Browse files
JustinStittmiquelraynal
authored andcommitted
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: ClangBuiltLinux#1910 Reported-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Justin Stitt <justinstitt@google.com> Signed-off-by: Miquel 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
1 parent a5a8812 commit b9e002a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mtd/nand/raw/vf610_nfc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ static int vf610_nfc_probe(struct platform_device *pdev)
850850
goto err_disable_clk;
851851
}
852852

853-
nfc->variant = (enum vf610_nfc_variant)of_id->data;
853+
nfc->variant = (uintptr_t)of_id->data;
854854

855855
for_each_available_child_of_node(nfc->dev->of_node, child) {
856856
if (of_device_is_compatible(child, "fsl,vf610-nfc-nandcs")) {

0 commit comments

Comments
 (0)