[xlnx:xlnx_rebase_v5.4 864/1701] drivers/fpga/fpga-mgr.c:828:2: error: implicit declaration of function 'set_dma_ops'

kernel test robot lkp at intel.com
Thu Apr 1 22:19:06 BST 2021


tree:   https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.4
head:   8540825db3d5519ef205a710515b7819b95eeb4f
commit: 1a0c556193a3d81ff6bde4c571c38b2c19bbb443 [864/1701] fpga: support loading from a pre-allocated buffer
config: um-allmodconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/Xilinx/linux-xlnx/commit/1a0c556193a3d81ff6bde4c571c38b2c19bbb443
        git remote add xlnx https://github.com/Xilinx/linux-xlnx
        git fetch --no-tags xlnx xlnx_rebase_v5.4
        git checkout 1a0c556193a3d81ff6bde4c571c38b2c19bbb443
        # save the attached .config to linux build tree
        make W=1 ARCH=um 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>

All errors (new ones prefixed by >>):

   cc1: warning: arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
   In file included from include/linux/file.h:9,
                    from include/linux/dma-buf.h:16,
                    from drivers/fpga/fpga-mgr.c:11:
   include/asm-generic/fixmap.h: In function 'fix_to_virt':
   include/asm-generic/fixmap.h:32:19: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
      32 |  BUILD_BUG_ON(idx >= __end_of_fixed_addresses);
         |                   ^~
   include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
     330 |   if (!(condition))     \
         |         ^~~~~~~~~
   include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
     350 |  _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
         |  ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
      39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
         |                                     ^~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:50:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
      50 |  BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
         |  ^~~~~~~~~~~~~~~~
   include/asm-generic/fixmap.h:32:2: note: in expansion of macro 'BUILD_BUG_ON'
      32 |  BUILD_BUG_ON(idx >= __end_of_fixed_addresses);
         |  ^~~~~~~~~~~~
   In file included from include/linux/uaccess.h:11,
                    from include/linux/highmem.h:9,
                    from drivers/fpga/fpga-mgr.c:21:
   arch/um/include/asm/uaccess.h: In function '__access_ok':
   arch/um/include/asm/uaccess.h:17:29: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
      17 |    (((unsigned long) (addr) >= FIXADDR_USER_START) && \
         |                             ^~
   arch/um/include/asm/uaccess.h:45:3: note: in expansion of macro '__access_ok_vsyscall'
      45 |   __access_ok_vsyscall(addr, size) ||
         |   ^~~~~~~~~~~~~~~~~~~~
   drivers/fpga/fpga-mgr.c: In function 'fpga_mgr_create':
>> drivers/fpga/fpga-mgr.c:828:2: error: implicit declaration of function 'set_dma_ops' [-Werror=implicit-function-declaration]
     828 |  set_dma_ops(&mgr->dev, get_dma_ops(dev));
         |  ^~~~~~~~~~~
>> drivers/fpga/fpga-mgr.c:828:25: error: implicit declaration of function 'get_dma_ops'; did you mean 'get_dma_buf'? [-Werror=implicit-function-declaration]
     828 |  set_dma_ops(&mgr->dev, get_dma_ops(dev));
         |                         ^~~~~~~~~~~
         |                         get_dma_buf
   cc1: some warnings being treated as errors

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for UIO_DMEM_GENIRQ
   Depends on UIO && HAS_DMA
   Selected by
   - UIO_XILINX_AI_ENGINE && UIO


vim +/set_dma_ops +828 drivers/fpga/fpga-mgr.c

   773	
   774	/**
   775	 * fpga_mgr_create - create and initialize a FPGA manager struct
   776	 * @dev:	fpga manager device from pdev
   777	 * @name:	fpga manager name
   778	 * @mops:	pointer to structure of fpga manager ops
   779	 * @priv:	fpga manager private data
   780	 *
   781	 * The caller of this function is responsible for freeing the struct with
   782	 * fpga_mgr_free().  Using devm_fpga_mgr_create() instead is recommended.
   783	 *
   784	 * Return: pointer to struct fpga_manager or NULL
   785	 */
   786	struct fpga_manager *fpga_mgr_create(struct device *dev, const char *name,
   787					     const struct fpga_manager_ops *mops,
   788					     void *priv)
   789	{
   790		struct fpga_manager *mgr;
   791		int id, ret;
   792	
   793		if (!mops || !mops->write_complete || !mops->state ||
   794		    !mops->write_init || (!mops->write && !mops->write_sg)) {
   795			dev_err(dev, "Attempt to register without fpga_manager_ops\n");
   796			return NULL;
   797		}
   798	
   799		if (!name || !strlen(name)) {
   800			dev_err(dev, "Attempt to register with no name!\n");
   801			return NULL;
   802		}
   803	
   804		mgr = kzalloc(sizeof(*mgr), GFP_KERNEL);
   805		if (!mgr)
   806			return NULL;
   807	
   808		id = ida_simple_get(&fpga_mgr_ida, 0, 0, GFP_KERNEL);
   809		if (id < 0) {
   810			ret = id;
   811			goto error_kfree;
   812		}
   813	
   814		mutex_init(&mgr->ref_mutex);
   815	
   816		mgr->name = name;
   817		mgr->mops = mops;
   818		mgr->priv = priv;
   819	
   820		device_initialize(&mgr->dev);
   821		mgr->dev.class = fpga_mgr_class;
   822		mgr->dev.groups = mops->groups;
   823		mgr->dev.parent = dev;
   824		mgr->dev.of_node = dev->of_node;
   825		mgr->dev.id = id;
   826	
   827		/* Make device dma capable by inheriting from parent's */
 > 828		set_dma_ops(&mgr->dev, get_dma_ops(dev));
   829		ret = dma_coerce_mask_and_coherent(&mgr->dev, dma_get_mask(dev));
   830		if (ret) {
   831			dev_warn(dev,
   832			"Failed to set DMA mask %llx. Trying to continue... %x\n",
   833			dma_get_mask(dev), ret);
   834		}
   835	
   836		ret = dev_set_name(&mgr->dev, "fpga%d", id);
   837		if (ret)
   838			goto error_device;
   839	
   840		mgr->miscdev.minor = MISC_DYNAMIC_MINOR;
   841		mgr->miscdev.name = kobject_name(&mgr->dev.kobj);
   842		mgr->miscdev.fops = &fpga_fops;
   843		ret = misc_register(&mgr->miscdev);
   844		if (ret) {
   845			pr_err("fpga: failed to register misc device.\n");
   846			goto error_device;
   847		}
   848	
   849		return mgr;
   850	
   851	error_device:
   852		ida_simple_remove(&fpga_mgr_ida, id);
   853	error_kfree:
   854		kfree(mgr);
   855	
   856		return NULL;
   857	}
   858	EXPORT_SYMBOL_GPL(fpga_mgr_create);
   859	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 21928 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20210402/c2a4e270/attachment-0001.gz>


More information about the linux-arm-kernel mailing list