[hch-misc:i915-mdev 37/40] virt/kvm/vfio.c:63:19: error: redefinition of 'kv'

From: kernel test robot
Date: Sat Jul 24 2021 - 23:45:20 EST


tree: git://git.infradead.org/users/hch/misc.git i915-mdev
head: 3e7e1da34feaeb5473f397c9cab73b4eb7f6a33c
commit: 4e07f42532ddb1837a7eeb3e1ed6dc18fa673220 [37/40] kvm/vfio: refactor kvm_vfio_set_group
config: powerpc64-randconfig-p001-20210725 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 10.3.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 i915-mdev
git checkout 4e07f42532ddb1837a7eeb3e1ed6dc18fa673220
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=powerpc SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

virt/kvm/vfio.c: In function 'kvm_vfio_set_spapr_tce':
>> virt/kvm/vfio.c:63:19: error: redefinition of 'kv'
63 | struct kvm_vfio *kv = dev->private;
| ^~
virt/kvm/vfio.c:60:19: note: previous definition of 'kv' was here
60 | struct kvm_vfio *kv = dev->private;
| ^~
>> virt/kvm/vfio.c:65:25: error: redeclaration of 'kvg' with no linkage
65 | struct kvm_vfio_group *kvg;
| ^~~
virt/kvm/vfio.c:61:25: note: previous declaration of 'kvg' was here
61 | struct kvm_vfio_group *kvg;
| ^~~


vim +/kv +63 virt/kvm/vfio.c

57
58 static int kvm_vfio_set_spapr_tce(struct kvm_device *dev, void __user *argp)
59 {
60 struct kvm_vfio *kv = dev->private;
61 struct kvm_vfio_group *kvg;
62 struct kvm_vfio_spapr_tce param;
> 63 struct kvm_vfio *kv = dev->private;
64 struct vfio_group *vfio_group;
> 65 struct kvm_vfio_group *kvg;
66 struct iommu_group *grp;
67 struct fd f;
68 int ret;
69
70 if (copy_from_user(&param, argp, sizeof(struct kvm_vfio_spapr_tce)))
71 return -EFAULT;
72
73 f = fdget(param.groupfd);
74 if (!f.file)
75 return -EBADF;
76 vfio_group = vfio_group_get_external_user(f.file);
77 fdput(f);
78
79 if (IS_ERR(vfio_group))
80 return PTR_ERR(vfio_group);
81
82 ret = -EIO;
83 grp = kvm_vfio_group_get_iommu_group(vfio_group);
84 if (WARN_ON_ONCE(!grp))
85 goto out;
86
87 ret = -ENOENT;
88 mutex_lock(&kv->lock);
89 list_for_each_entry(kvg, &kv->group_list, node) {
90 if (kvg->vfio_group != vfio_group)
91 continue;
92 ret = kvm_spapr_tce_attach_iommu_group(dev->kvm, param.tablefd,
93 grp);
94 break;
95 }
96 mutex_unlock(&kv->lock);
97
98 iommu_group_put(grp);
99 out:
100 vfio_group_put_external_user(vfio_group);
101 return ret;
102 }
103 #else
104 static inline void kvm_spapr_tce_release_vfio_group(struct kvm *kvm,
105 struct vfio_group *vfio_group)
106 {
107 }
108 #endif /* CONFIG_SPAPR_TCE_IOMMU */
109

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip