Skip to content

Commit f728967

Browse files
JustinStittkwilczynski
authored andcommitted
PCI: iproc: Fix -Wvoid-pointer-to-enum-cast warning
When building with clang 18, the following warning will be reported: drivers/pci/controller/pcie-iproc-platform.c:54:15: warning: cast to smaller integer type 'enum iproc_pcie_type' from 'const void *' [-Wvoid-pointer-to-enum-cast] 55 | pcie->type = (enum iproc_pcie_type) of_device_get_match_data(dev); To fix this issue, cast the data the of_device_get_match_data() helper returns to uintptr_t rather than the iproc_pcie_type enum. [kwilczynski: commit log] Link: https://lore.kernel.org/linux-pci/[email protected] Link: ClangBuiltLinux#1910 Reported-by: Nathan Chancellor <[email protected]> Signed-off-by: Justin Stitt <[email protected]> Signed-off-by: Yoshihiro Shimoda <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]>
1 parent 70fa02c commit f728967

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/controller/pcie-iproc-platform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static int iproc_pltfm_pcie_probe(struct platform_device *pdev)
5252
pcie = pci_host_bridge_priv(bridge);
5353

5454
pcie->dev = dev;
55-
pcie->type = (enum iproc_pcie_type) of_device_get_match_data(dev);
55+
pcie->type = (uintptr_t)of_device_get_match_data(dev);
5656

5757
ret = of_address_to_resource(np, 0, &reg);
5858
if (ret < 0) {

0 commit comments

Comments
 (0)