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/20231220053829.1921187-6-yoshihiro.shimoda.uh@renesas.com Link: ClangBuiltLinux#1910 Reported-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Justin Stitt <justinstitt@google.com> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
1 parent 70fa02c commit f728967

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)