Skip to content

Commit 7682f19

Browse files
shimodaykwilczynski
authored andcommitted
PCI: rcar-gen4: Fix -Wvoid-pointer-to-enum-cast error
When building with clang 18 with the -Werror compiler option enabled, the following error will be reported: drivers/pci/controller/dwc/pcie-rcar-gen4.c:439:15: error: cast to smaller integer type 'enum dw_pcie_device_mode' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] 439 | rcar->mode = (enum dw_pcie_device_mode)of_device_get_match_data(&rcar->pdev->dev); To fix this issue, cast the data the of_device_get_match_data() helper returns to uintptr_t rather than the dw_pcie_device_mode enum. [kwilczynski: commit log] Link: https://lore.kernel.org/linux-pci/20231220053829.1921187-7-yoshihiro.shimoda.uh@renesas.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 f728967 commit 7682f19

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/pci/controller/dwc/pcie-rcar-gen4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ static void rcar_gen4_remove_dw_pcie_ep(struct rcar_gen4_pcie *rcar)
436436
/* Common */
437437
static int rcar_gen4_add_dw_pcie(struct rcar_gen4_pcie *rcar)
438438
{
439-
rcar->mode = (enum dw_pcie_device_mode)of_device_get_match_data(&rcar->pdev->dev);
439+
rcar->mode = (uintptr_t)of_device_get_match_data(&rcar->pdev->dev);
440440

441441
switch (rcar->mode) {
442442
case DW_PCIE_RC_TYPE:

0 commit comments

Comments
 (0)