tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 3e029760e6f8ce90c122c267a039ae73b3f1f5a4 commit: db756746807b5cb64bbe2e6ac4ff38d18b7787ed [4945/5886] riscv: enable generic PCI resource mapping config: riscv-allyesconfig (attached as .config) compiler: riscv64-linux-gcc (GCC) 9.3.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # apt-get install sparse # sparse version: v0.6.3-341-g8af24329-dirty # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=db756746807b5cb64bbe2e6ac4ff38d18b7787ed git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout db756746807b5cb64bbe2e6ac4ff38d18b7787ed # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=riscv If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@xxxxxxxxx> sparse warnings: (new ones prefixed by >>) >> drivers/pci/pci-sysfs.c:1098:25: sparse: sparse: cast removes address space '__iomem' of expression >> drivers/pci/pci-sysfs.c:1098:25: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@ drivers/pci/pci-sysfs.c:1098:25: sparse: expected void volatile [noderef] __iomem *addr drivers/pci/pci-sysfs.c:1098:25: sparse: got void * drivers/pci/pci-sysfs.c:1100:38: sparse: sparse: cast removes address space '__iomem' of expression >> drivers/pci/pci-sysfs.c:1100:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@ drivers/pci/pci-sysfs.c:1100:38: sparse: expected void const volatile [noderef] __iomem *addr drivers/pci/pci-sysfs.c:1100:38: sparse: got void * drivers/pci/pci-sysfs.c:1104:25: sparse: sparse: cast removes address space '__iomem' of expression drivers/pci/pci-sysfs.c:1104:25: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@ drivers/pci/pci-sysfs.c:1104:25: sparse: expected void volatile [noderef] __iomem *addr drivers/pci/pci-sysfs.c:1104:25: sparse: got void * drivers/pci/pci-sysfs.c:1106:39: sparse: sparse: cast removes address space '__iomem' of expression drivers/pci/pci-sysfs.c:1106:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@ drivers/pci/pci-sysfs.c:1106:39: sparse: expected void const volatile [noderef] __iomem *addr drivers/pci/pci-sysfs.c:1106:39: sparse: got void * drivers/pci/pci-sysfs.c:1110:25: sparse: sparse: cast removes address space '__iomem' of expression drivers/pci/pci-sysfs.c:1110:25: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@ drivers/pci/pci-sysfs.c:1110:25: sparse: expected void volatile [noderef] __iomem *addr drivers/pci/pci-sysfs.c:1110:25: sparse: got void * drivers/pci/pci-sysfs.c:1112:39: sparse: sparse: cast removes address space '__iomem' of expression drivers/pci/pci-sysfs.c:1112:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@ drivers/pci/pci-sysfs.c:1112:39: sparse: expected void const volatile [noderef] __iomem *addr drivers/pci/pci-sysfs.c:1112:39: sparse: got void * vim +/__iomem +1098 drivers/pci/pci-sysfs.c ^1da177e4c3f41 Linus Torvalds 2005-04-16 1078 3c78bc61f5ef3b Ryan Desfosses 2014-04-18 1079 static ssize_t pci_resource_io(struct file *filp, struct kobject *kobj, 8633328be24267 Alex Williamson 2010-07-19 1080 struct bin_attribute *attr, char *buf, 8633328be24267 Alex Williamson 2010-07-19 1081 loff_t off, size_t count, bool write) 8633328be24267 Alex Williamson 2010-07-19 1082 { 554a60379aaa50 Geliang Tang 2015-12-23 1083 struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj)); dca40b186b757c David Woodhouse 2017-04-12 1084 int bar = (unsigned long)attr->private; 8633328be24267 Alex Williamson 2010-07-19 1085 unsigned long port = off; 8633328be24267 Alex Williamson 2010-07-19 1086 dca40b186b757c David Woodhouse 2017-04-12 1087 port += pci_resource_start(pdev, bar); 8633328be24267 Alex Williamson 2010-07-19 1088 dca40b186b757c David Woodhouse 2017-04-12 1089 if (port > pci_resource_end(pdev, bar)) 8633328be24267 Alex Williamson 2010-07-19 1090 return 0; 8633328be24267 Alex Williamson 2010-07-19 1091 dca40b186b757c David Woodhouse 2017-04-12 1092 if (port + count - 1 > pci_resource_end(pdev, bar)) 8633328be24267 Alex Williamson 2010-07-19 1093 return -EINVAL; 8633328be24267 Alex Williamson 2010-07-19 1094 8633328be24267 Alex Williamson 2010-07-19 1095 switch (count) { 8633328be24267 Alex Williamson 2010-07-19 1096 case 1: 8633328be24267 Alex Williamson 2010-07-19 1097 if (write) 8633328be24267 Alex Williamson 2010-07-19 @1098 outb(*(u8 *)buf, port); 8633328be24267 Alex Williamson 2010-07-19 1099 else 8633328be24267 Alex Williamson 2010-07-19 @1100 *(u8 *)buf = inb(port); 8633328be24267 Alex Williamson 2010-07-19 1101 return 1; 8633328be24267 Alex Williamson 2010-07-19 1102 case 2: 8633328be24267 Alex Williamson 2010-07-19 1103 if (write) 8633328be24267 Alex Williamson 2010-07-19 1104 outw(*(u16 *)buf, port); 8633328be24267 Alex Williamson 2010-07-19 1105 else 8633328be24267 Alex Williamson 2010-07-19 1106 *(u16 *)buf = inw(port); 8633328be24267 Alex Williamson 2010-07-19 1107 return 2; 8633328be24267 Alex Williamson 2010-07-19 1108 case 4: 8633328be24267 Alex Williamson 2010-07-19 1109 if (write) 8633328be24267 Alex Williamson 2010-07-19 1110 outl(*(u32 *)buf, port); 8633328be24267 Alex Williamson 2010-07-19 1111 else 8633328be24267 Alex Williamson 2010-07-19 1112 *(u32 *)buf = inl(port); 8633328be24267 Alex Williamson 2010-07-19 1113 return 4; 8633328be24267 Alex Williamson 2010-07-19 1114 } 8633328be24267 Alex Williamson 2010-07-19 1115 return -EINVAL; 8633328be24267 Alex Williamson 2010-07-19 1116 } 8633328be24267 Alex Williamson 2010-07-19 1117 :::::: The code at line 1098 was first introduced by commit :::::: 8633328be242677fdedc42052838dd0608e7f342 PCI: Allow read/write access to sysfs I/O port resources :::::: TO: Alex Williamson <alex.williamson@xxxxxxxxxx> :::::: CC: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx> --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip