From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [hch-misc:pgmap-refcount 6/6] fs/fuse/virtio_fs.c:822:48: error: invalid application of 'sizeof' to incomplete type 'struct dev_pagemap'
Date: Fri, 04 Feb 2022 20:13:21 +0800 [thread overview]
Message-ID: <202202042003.sCpSBTvx-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 8469 bytes --]
tree: git://git.infradead.org/users/hch/misc.git pgmap-refcount
head: 3905e60c98f2335aeb84a2ebe5271b44cb302404
commit: 3905e60c98f2335aeb84a2ebe5271b44cb302404 [6/6] mm: don't include <linux/memremap.h> in <linux/mm.h>
config: riscv-randconfig-r042-20220130 (https://download.01.org/0day-ci/archive/20220204/202202042003.sCpSBTvx-lkp(a)intel.com/config)
compiler: riscv64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git remote add hch-misc git://git.infradead.org/users/hch/misc.git
git fetch --no-tags hch-misc pgmap-refcount
git checkout 3905e60c98f2335aeb84a2ebe5271b44cb302404
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=riscv SHELL=/bin/bash fs/fuse/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All error/warnings (new ones prefixed by >>):
fs/fuse/virtio_fs.c: In function 'virtio_fs_setup_dax':
>> fs/fuse/virtio_fs.c:822:48: error: invalid application of 'sizeof' to incomplete type 'struct dev_pagemap'
822 | pgmap = devm_kzalloc(&vdev->dev, sizeof(*pgmap), GFP_KERNEL);
| ^
>> fs/fuse/virtio_fs.c:826:14: error: invalid use of undefined type 'struct dev_pagemap'
826 | pgmap->type = MEMORY_DEVICE_FS_DAX;
| ^~
>> fs/fuse/virtio_fs.c:826:23: error: 'MEMORY_DEVICE_FS_DAX' undeclared (first use in this function)
826 | pgmap->type = MEMORY_DEVICE_FS_DAX;
| ^~~~~~~~~~~~~~~~~~~~
fs/fuse/virtio_fs.c:826:23: note: each undeclared identifier is reported only once for each function it appears in
fs/fuse/virtio_fs.c:833:14: error: invalid use of undefined type 'struct dev_pagemap'
833 | pgmap->range = (struct range) {
| ^~
fs/fuse/virtio_fs.c:837:14: error: invalid use of undefined type 'struct dev_pagemap'
837 | pgmap->nr_range = 1;
| ^~
>> fs/fuse/virtio_fs.c:839:28: error: implicit declaration of function 'devm_memremap_pages'; did you mean 'devm_memremap'? [-Werror=implicit-function-declaration]
839 | fs->window_kaddr = devm_memremap_pages(&vdev->dev, pgmap);
| ^~~~~~~~~~~~~~~~~~~
| devm_memremap
>> fs/fuse/virtio_fs.c:839:26: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
839 | fs->window_kaddr = devm_memremap_pages(&vdev->dev, pgmap);
| ^
cc1: some warnings being treated as errors
vim +822 fs/fuse/virtio_fs.c
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 794
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 795 static int virtio_fs_setup_dax(struct virtio_device *vdev, struct virtio_fs *fs)
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 796 {
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 797 struct virtio_shm_region cache_reg;
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 798 struct dev_pagemap *pgmap;
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 799 bool have_cache;
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 800
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 801 if (!IS_ENABLED(CONFIG_FUSE_DAX))
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 802 return 0;
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 803
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 804 /* Get cache region */
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 805 have_cache = virtio_get_shm_region(vdev, &cache_reg,
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 806 (u8)VIRTIO_FS_SHMCAP_ID_CACHE);
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 807 if (!have_cache) {
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 808 dev_notice(&vdev->dev, "%s: No cache capability\n", __func__);
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 809 return 0;
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 810 }
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 811
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 812 if (!devm_request_mem_region(&vdev->dev, cache_reg.addr, cache_reg.len,
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 813 dev_name(&vdev->dev))) {
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 814 dev_warn(&vdev->dev, "could not reserve region addr=0x%llx len=0x%llx\n",
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 815 cache_reg.addr, cache_reg.len);
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 816 return -EBUSY;
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 817 }
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 818
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 819 dev_notice(&vdev->dev, "Cache len: 0x%llx @ 0x%llx\n", cache_reg.len,
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 820 cache_reg.addr);
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 821
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 @822 pgmap = devm_kzalloc(&vdev->dev, sizeof(*pgmap), GFP_KERNEL);
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 823 if (!pgmap)
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 824 return -ENOMEM;
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 825
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 @826 pgmap->type = MEMORY_DEVICE_FS_DAX;
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 827
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 828 /* Ideally we would directly use the PCI BAR resource but
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 829 * devm_memremap_pages() wants its own copy in pgmap. So
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 830 * initialize a struct resource from scratch (only the start
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 831 * and end fields will be used).
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 832 */
694565356c2e062 Linus Torvalds 2020-10-19 833 pgmap->range = (struct range) {
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 834 .start = (phys_addr_t) cache_reg.addr,
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 835 .end = (phys_addr_t) cache_reg.addr + cache_reg.len - 1,
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 836 };
694565356c2e062 Linus Torvalds 2020-10-19 837 pgmap->nr_range = 1;
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 838
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 @839 fs->window_kaddr = devm_memremap_pages(&vdev->dev, pgmap);
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 840 if (IS_ERR(fs->window_kaddr))
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 841 return PTR_ERR(fs->window_kaddr);
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 842
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 843 fs->window_phys_addr = (phys_addr_t) cache_reg.addr;
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 844 fs->window_len = (phys_addr_t) cache_reg.len;
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 845
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 846 dev_dbg(&vdev->dev, "%s: window kaddr 0x%px phys_addr 0x%llx len 0x%llx\n",
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 847 __func__, fs->window_kaddr, cache_reg.addr, cache_reg.len);
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 848
30c6828a17a572a Christoph Hellwig 2021-12-15 849 fs->dax_dev = alloc_dax(fs, &virtio_fs_dax_ops);
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 850 if (IS_ERR(fs->dax_dev))
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 851 return PTR_ERR(fs->dax_dev);
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 852
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 853 return devm_add_action_or_reset(&vdev->dev, virtio_fs_cleanup_dax,
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 854 fs->dax_dev);
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 855 }
22f3787e9d95e72 Stefan Hajnoczi 2020-08-19 856
:::::: The code at line 822 was first introduced by commit
:::::: 22f3787e9d95e72d1f09795f294fb010e2998f43 virtiofs: set up virtio_fs dax_device
:::::: TO: Stefan Hajnoczi <stefanha@redhat.com>
:::::: CC: Miklos Szeredi <mszeredi@redhat.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
reply other threads:[~2022-02-04 12:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202202042003.sCpSBTvx-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.