[openwrt/openwrt] lantiq: 5.15: fix compilation warning pciex fixup patch

LEDE Commits lede-commits at lists.infradead.org
Fri May 12 03:42:03 PDT 2023


ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/eaca62f31c1f9c8b28fd87ef6fd8afb270d7e351

commit eaca62f31c1f9c8b28fd87ef6fd8afb270d7e351
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Fri May 12 12:38:30 2023 +0200

    lantiq: 5.15: fix compilation warning pciex fixup patch
    
    pcibios_map_irq request a const pci_dev while pci_find_capability
    doesn't. Cast dropping the const to fix compilation warning.
    Fix compilation warning:
    arch/mips/pci/fixup-lantiq.c: In function 'pcibios_map_irq':
    arch/mips/pci/fixup-lantiq.c:34:33: error: passing argument 1 of 'pci_find_capability' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
       34 |         if (pci_find_capability(dev, PCI_CAP_ID_EXP))
          |                                 ^~~
    In file included from arch/mips/pci/fixup-lantiq.c:9:
    ./include/linux/pci.h:1129:40: note: expected 'struct pci_dev *' but argument is of type 'const struct pci_dev *'
     1129 | u8 pci_find_capability(struct pci_dev *dev, int cap);
          |                        ~~~~~~~~~~~~~~~~^~~
    cc1: all warnings being treated as errors
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 target/linux/lantiq/patches-5.15/0001-MIPS-lantiq-add-pcie-driver.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/lantiq/patches-5.15/0001-MIPS-lantiq-add-pcie-driver.patch b/target/linux/lantiq/patches-5.15/0001-MIPS-lantiq-add-pcie-driver.patch
index 294bafed4a..9cd3b08b8e 100644
--- a/target/linux/lantiq/patches-5.15/0001-MIPS-lantiq-add-pcie-driver.patch
+++ b/target/linux/lantiq/patches-5.15/0001-MIPS-lantiq-add-pcie-driver.patch
@@ -178,7 +178,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
  {
 +#ifdef CONFIG_PCIE_LANTIQ
-+	if (pci_find_capability(dev, PCI_CAP_ID_EXP))
++	if (pci_find_capability((struct pci_dev *)dev, PCI_CAP_ID_EXP))
 +		return ifx_pcie_bios_map_irq(dev, slot, pin);
 +#endif
 +




More information about the lede-commits mailing list