[xilinx-xlnx:xlnx_rebase_v5.15_LTS_2022.1_update 627/1104] drivers/gpu/drm/xlnx/xlnx_bridge.c:339:22: sparse: sparse: incorrect type in argument 1 (different address spaces)

kernel test robot lkp at intel.com
Sat Jun 4 12:43:05 PDT 2022


tree:   https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15_LTS_2022.1_update
head:   9203af14476dce35e697e2c3f2d6d2aa7ee0e77a
commit: e9b2e76207572317b0b92e330a639c8a8ebe06ff [627/1104] drm: xlnx: drv: Add Xilinx bridge support
config: m68k-randconfig-s032-20220605 (https://download.01.org/0day-ci/archive/20220605/202206050337.2ZUVpmxB-lkp@intel.com/config)
compiler: m68k-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-18-g56afb504-dirty
        # https://github.com/Xilinx/linux-xlnx/commit/e9b2e76207572317b0b92e330a639c8a8ebe06ff
        git remote add xilinx-xlnx https://github.com/Xilinx/linux-xlnx
        git fetch --no-tags xilinx-xlnx xlnx_rebase_v5.15_LTS_2022.1_update
        git checkout e9b2e76207572317b0b92e330a639c8a8ebe06ff
        # 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=m68k SHELL=/bin/bash drivers/gpu/drm/xlnx/

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/gpu/drm/xlnx/xlnx_bridge.c:339:22: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected char const * @@     got char const [noderef] __user *buf @@
   drivers/gpu/drm/xlnx/xlnx_bridge.c:339:22: sparse:     expected char const *
   drivers/gpu/drm/xlnx/xlnx_bridge.c:339:22: sparse:     got char const [noderef] __user *buf
   drivers/gpu/drm/xlnx/xlnx_bridge.c:341:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected char const * @@     got char const [noderef] __user *buf @@
   drivers/gpu/drm/xlnx/xlnx_bridge.c:341:29: sparse:     expected char const *
   drivers/gpu/drm/xlnx/xlnx_bridge.c:341:29: sparse:     got char const [noderef] __user *buf
   drivers/gpu/drm/xlnx/xlnx_bridge.c:343:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected char const * @@     got char const [noderef] __user *buf @@
   drivers/gpu/drm/xlnx/xlnx_bridge.c:343:29: sparse:     expected char const *
   drivers/gpu/drm/xlnx/xlnx_bridge.c:343:29: sparse:     got char const [noderef] __user *buf

vim +339 drivers/gpu/drm/xlnx/xlnx_bridge.c

   330	
   331	static ssize_t xlnx_bridge_debugfs_write(struct file *f, const char __user *buf,
   332						 size_t size, loff_t *pos)
   333	{
   334		struct xlnx_bridge *bridge = f->f_inode->i_private;
   335	
   336		if (*pos != 0 || size <= 0)
   337			return -EINVAL;
   338	
 > 339		if (!strncmp(buf, "enable", 5)) {
   340			xlnx_bridge_enable(bridge);
   341		} else if (!strncmp(buf, "disable", 6)) {
   342			xlnx_bridge_disable(bridge);
   343		} else if (!strncmp(buf, "set_input", 3)) {
   344			char *cmd, **tmp;
   345			char *w, *h, *bus_fmt;
   346			u32 width = 0, height = 0, fmt = 0;
   347			int ret;
   348	
   349			cmd = kzalloc(size, GFP_KERNEL);
   350			if (!cmd)
   351				return -ENOMEM;
   352	
   353			ret = strncpy_from_user(cmd, buf, size);
   354			if (ret < 0) {
   355				pr_err("%s %d failed to copy the command  %s\n",
   356				       __func__, __LINE__, buf);
   357				kfree(cmd);
   358				return ret;
   359			}
   360	
   361			tmp = &cmd;
   362			strsep(tmp, " ");
   363			w = strsep(tmp, " ");
   364			h = strsep(tmp, " ");
   365			bus_fmt = strsep(tmp, " ");
   366			if (w && h && bus_fmt) {
   367				ret = kstrtouint(w, 0, &width);
   368				ret |= kstrtouint(h, 0, &height);
   369				ret |= kstrtouint(bus_fmt, 0, &fmt);
   370			}
   371	
   372			kfree(cmd);
   373			if (ret) {
   374				pr_err("%s %d invalid command: %s\n",
   375				       __func__, __LINE__, buf);
   376				return -EINVAL;
   377			}
   378			xlnx_bridge_set_input(bridge, width, height, fmt);
   379		}
   380	
   381		return size;
   382	}
   383	

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



More information about the linux-arm-kernel mailing list