[xilinx-xlnx:xlnx_rebase_v5.15_LTS 461/1181] drivers/staging/xroeframer/sysfs_xroe.c:194:43: sparse: sparse: cast removes address space '__iomem' of expression

kernel test robot lkp at intel.com
Sun Jun 19 02:09:46 PDT 2022


tree:   https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15_LTS
head:   59523b5c4aca0174f1f8cba2a07d3b3328b7c80e
commit: 0175545bc3e52db0029f52c324cf70f36d113540 [461/1181] staging: Add xroeframer driver
config: h8300-randconfig-s032-20220619 (https://download.01.org/0day-ci/archive/20220619/202206191650.t0qeNsah-lkp@intel.com/config)
compiler: h8300-linux-gcc (GCC) 11.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.4-30-g92122700-dirty
        # https://github.com/Xilinx/linux-xlnx/commit/0175545bc3e52db0029f52c324cf70f36d113540
        git remote add xilinx-xlnx https://github.com/Xilinx/linux-xlnx
        git fetch --no-tags xilinx-xlnx xlnx_rebase_v5.15_LTS
        git checkout 0175545bc3e52db0029f52c324cf70f36d113540
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=h8300 SHELL=/bin/bash drivers/clk/ drivers/staging/

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


sparse warnings: (new ones prefixed by >>)
>> drivers/staging/xroeframer/sysfs_xroe.c:194:43: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/staging/xroeframer/sysfs_xroe.c:195:9: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void [noderef] __iomem *working_address @@     got unsigned char [usertype] * @@
   drivers/staging/xroeframer/sysfs_xroe.c:195:9: sparse:     expected void [noderef] __iomem *working_address
   drivers/staging/xroeframer/sysfs_xroe.c:195:9: sparse:     got unsigned char [usertype] *
   drivers/staging/xroeframer/sysfs_xroe.c:227:43: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/staging/xroeframer/sysfs_xroe.c:228:9: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void [noderef] __iomem *working_address @@     got unsigned char [usertype] * @@
   drivers/staging/xroeframer/sysfs_xroe.c:228:9: sparse:     expected void [noderef] __iomem *working_address
   drivers/staging/xroeframer/sysfs_xroe.c:228:9: sparse:     got unsigned char [usertype] *
   drivers/staging/xroeframer/sysfs_xroe.c:263:43: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/staging/xroeframer/sysfs_xroe.c:263:67: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void [noderef] __iomem *working_address @@     got unsigned char [usertype] * @@
   drivers/staging/xroeframer/sysfs_xroe.c:263:67: sparse:     expected void [noderef] __iomem *working_address
   drivers/staging/xroeframer/sysfs_xroe.c:263:67: sparse:     got unsigned char [usertype] *
   drivers/staging/xroeframer/sysfs_xroe.c:293:43: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/staging/xroeframer/sysfs_xroe.c:293:67: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void [noderef] __iomem *working_address @@     got unsigned char [usertype] * @@
   drivers/staging/xroeframer/sysfs_xroe.c:293:67: sparse:     expected void [noderef] __iomem *working_address
   drivers/staging/xroeframer/sysfs_xroe.c:293:67: sparse:     got unsigned char [usertype] *
   drivers/staging/xroeframer/sysfs_xroe.c:329:43: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/staging/xroeframer/sysfs_xroe.c:329:67: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void [noderef] __iomem *working_address @@     got unsigned char [usertype] * @@
   drivers/staging/xroeframer/sysfs_xroe.c:329:67: sparse:     expected void [noderef] __iomem *working_address
   drivers/staging/xroeframer/sysfs_xroe.c:329:67: sparse:     got unsigned char [usertype] *
   drivers/staging/xroeframer/sysfs_xroe.c:357:43: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/staging/xroeframer/sysfs_xroe.c:357:67: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void [noderef] __iomem *working_address @@     got unsigned char [usertype] * @@
   drivers/staging/xroeframer/sysfs_xroe.c:357:67: sparse:     expected void [noderef] __iomem *working_address
   drivers/staging/xroeframer/sysfs_xroe.c:357:67: sparse:     got unsigned char [usertype] *
   drivers/staging/xroeframer/sysfs_xroe.c: note: in included file (through include/linux/io.h, include/linux/irq.h, include/asm-generic/hardirq.h, ...):
   arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
   arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
   arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
   arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
   arch/h8300/include/asm/io.h:14:18: sparse: sparse: cast removes address space '__iomem' of expression
   arch/h8300/include/asm/io.h:32:11: sparse: sparse: cast removes address space '__iomem' of expression
   arch/h8300/include/asm/io.h:32:11: sparse: sparse: cast removes address space '__iomem' of expression
   arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
   arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
   arch/h8300/include/asm/io.h:44:11: sparse: sparse: cast removes address space '__iomem' of expression
   arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
   arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression

vim +/__iomem +194 drivers/staging/xroeframer/sysfs_xroe.c

   176	
   177	/**
   178	 * deframer_restart_show - Returns the deframer's restart status
   179	 * @kobj:	The kernel object of the entry
   180	 * @attr:	The attributes of the kernel object
   181	 * @buff:	The buffer containing the restart status
   182	 *
   183	 * Reads and writes the deframer's restart status to the sysfs entry
   184	 *
   185	 * Return: XROE_SIZE_MAX on success
   186	 */
   187	static ssize_t deframer_restart_show(struct kobject *kobj,
   188					     struct kobj_attribute *attr, char *buff)
   189	{
   190		u32 offset = DEFM_RESTART_OFFSET;
   191		u32 mask = DEFM_RESTART_MASK;
   192		u32 buffer = 0;
   193		u32 restart = 0;
 > 194		void __iomem *working_address = ((u8 *)xroe_lp->base_addr
 > 195		+ DEFM_RESTART_ADDR);
   196	
   197		buffer = ioread32(working_address);
   198		restart = (buffer & mask) >> offset;
   199	
   200		if (restart)
   201			sprintf(buff, "true\n");
   202	
   203		else
   204			sprintf(buff, "false\n");
   205	
   206		return XROE_SIZE_MAX;
   207	}
   208	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp



More information about the linux-arm-kernel mailing list