[linux-next:master 11990/13297] drivers/platform/x86/mlx-platform.c:6204:8: error: call to undeclared function 'pci_request_region'; ISO C99 and later do not support implicit function declarations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   ae782d4e2bf53b0b642ae860794f7a39470f995a
commit: 02daa222fbdd6afe52c25e5c2894d53946a4260d [11990/13297] platform: mellanox: Add initial support for PCIe based programming logic device
config: x86_64-buildonly-randconfig-001-20230830 (https://download.01.org/0day-ci/archive/20230830/202308300642.mptI4L5U-lkp@xxxxxxxxx/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230830/202308300642.mptI4L5U-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308300642.mptI4L5U-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> drivers/platform/x86/mlx-platform.c:6204:8: error: call to undeclared function 'pci_request_region'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
           err = pci_request_region(pci_dev, 0, res_name);
                 ^
   drivers/platform/x86/mlx-platform.c:6204:8: note: did you mean 'pci_request_regions'?
   include/linux/pci.h:1947:19: note: 'pci_request_regions' declared here
   static inline int pci_request_regions(struct pci_dev *dev, const char *res_name)
                     ^
   drivers/platform/x86/mlx-platform.c:6210:49: warning: shift count >= width of type [-Wshift-count-overflow]
           err = dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(64));
                                                          ^~~~~~~~~~~~~~~~
   include/linux/dma-mapping.h:77:54: note: expanded from macro 'DMA_BIT_MASK'
   #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                                                        ^ ~~~
   1 warning and 1 error generated.


vim +/pci_request_region +6204 drivers/platform/x86/mlx-platform.c

  6185	
  6186	static int
  6187	mlxplat_pci_fpga_device_init(unsigned int device, const char *res_name, struct pci_dev **pci_bridge,
  6188				     void __iomem **pci_bridge_addr)
  6189	{
  6190		void __iomem *pci_mem_addr;
  6191		struct pci_dev *pci_dev;
  6192		int err;
  6193	
  6194		pci_dev = pci_get_device(PCI_VENDOR_ID_LATTICE, device, NULL);
  6195		if (!pci_dev)
  6196			return -ENODEV;
  6197	
  6198		err = pci_enable_device(pci_dev);
  6199		if (err) {
  6200			dev_err(&pci_dev->dev, "pci_enable_device failed with error %d\n", err);
  6201			goto fail_pci_enable_device;
  6202		}
  6203	
> 6204		err = pci_request_region(pci_dev, 0, res_name);
  6205		if (err) {
  6206			dev_err(&pci_dev->dev, "pci_request_regions failed with error %d\n", err);
  6207			goto fail_pci_request_regions;
  6208		}
  6209	
  6210		err = dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(64));
  6211		if (err) {
  6212			err = dma_set_mask(&pci_dev->dev, DMA_BIT_MASK(32));
  6213			if (err) {
  6214				dev_err(&pci_dev->dev, "dma_set_mask failed with error %d\n", err);
  6215				goto fail_pci_set_dma_mask;
  6216			}
  6217		}
  6218	
  6219		pci_set_master(pci_dev);
  6220	
  6221		pci_mem_addr = devm_ioremap(&pci_dev->dev, pci_resource_start(pci_dev, 0),
  6222					    pci_resource_len(pci_dev, 0));
  6223		if (!pci_mem_addr) {
  6224			dev_err(&mlxplat_dev->dev, "ioremap failed\n");
  6225			err = -EIO;
  6226			goto fail_ioremap;
  6227		}
  6228	
  6229		*pci_bridge = pci_dev;
  6230		*pci_bridge_addr = pci_mem_addr;
  6231	
  6232		return 0;
  6233	
  6234	fail_ioremap:
  6235	fail_pci_set_dma_mask:
  6236		pci_release_regions(pci_dev);
  6237	fail_pci_request_regions:
  6238		pci_disable_device(pci_dev);
  6239	fail_pci_enable_device:
  6240		return err;
  6241	}
  6242	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux