Re: [PATCH v4 4/5] v4l2-subdev: add VIDIOC_SUBDEV_QUERYCAP ioctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jacopo,

I love your patch! Yet something to improve:

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on linus/master v5.7-rc2 next-20200420]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Jacopo-Mondi/media-Register-read-only-sub-dev-devnode/20200421-053419
base:   git://linuxtv.org/media_tree.git master
config: arm-bcm2835_defconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project a9b137f9ffba8cb25dfd7dd1fb613e8aac121b37)
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 

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

All errors (new ones prefixed by >>):

>> drivers/media/v4l2-core/v4l2-subdev.c:345:23: error: use of undeclared identifier 'ro_subdev'
                   cap->subdev_caps |= ro_subdev ? V4L2_SUBDEV_CAP_RO_SUBDEV
                                       ^
   1 error generated.

vim +/ro_subdev +345 drivers/media/v4l2-core/v4l2-subdev.c

   327	
   328	static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg)
   329	{
   330		struct video_device *vdev = video_devdata(file);
   331		struct v4l2_subdev *sd = vdev_to_v4l2_subdev(vdev);
   332		struct v4l2_fh *vfh = file->private_data;
   333	#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
   334		struct v4l2_subdev_fh *subdev_fh = to_v4l2_subdev_fh(vfh);
   335		bool ro_subdev = test_bit(V4L2_FL_SUBDEV_RO_DEVNODE, &vdev->flags);
   336	#endif
   337		int rval;
   338	
   339		switch (cmd) {
   340		case VIDIOC_SUBDEV_QUERYCAP: {
   341			struct v4l2_subdev_capability *cap = arg;
   342	
   343			memset(cap, 0, sizeof(*cap));
   344			cap->version = LINUX_VERSION_CODE;
 > 345			cap->subdev_caps |= ro_subdev ? V4L2_SUBDEV_CAP_RO_SUBDEV
   346						      : V4L2_SUBDEV_CAP_RW_SUBDEV;
   347	
   348			return 0;
   349		}
   350	
   351		case VIDIOC_QUERYCTRL:
   352			/*
   353			 * TODO: this really should be folded into v4l2_queryctrl (this
   354			 * currently returns -EINVAL for NULL control handlers).
   355			 * However, v4l2_queryctrl() is still called directly by
   356			 * drivers as well and until that has been addressed I believe
   357			 * it is safer to do the check here. The same is true for the
   358			 * other control ioctls below.
   359			 */
   360			if (!vfh->ctrl_handler)
   361				return -ENOTTY;
   362			return v4l2_queryctrl(vfh->ctrl_handler, arg);
   363	
   364		case VIDIOC_QUERY_EXT_CTRL:
   365			if (!vfh->ctrl_handler)
   366				return -ENOTTY;
   367			return v4l2_query_ext_ctrl(vfh->ctrl_handler, arg);
   368	
   369		case VIDIOC_QUERYMENU:
   370			if (!vfh->ctrl_handler)
   371				return -ENOTTY;
   372			return v4l2_querymenu(vfh->ctrl_handler, arg);
   373	
   374		case VIDIOC_G_CTRL:
   375			if (!vfh->ctrl_handler)
   376				return -ENOTTY;
   377			return v4l2_g_ctrl(vfh->ctrl_handler, arg);
   378	
   379		case VIDIOC_S_CTRL:
   380			if (!vfh->ctrl_handler)
   381				return -ENOTTY;
   382			return v4l2_s_ctrl(vfh, vfh->ctrl_handler, arg);
   383	
   384		case VIDIOC_G_EXT_CTRLS:
   385			if (!vfh->ctrl_handler)
   386				return -ENOTTY;
   387			return v4l2_g_ext_ctrls(vfh->ctrl_handler,
   388						vdev, sd->v4l2_dev->mdev, arg);
   389	
   390		case VIDIOC_S_EXT_CTRLS:
   391			if (!vfh->ctrl_handler)
   392				return -ENOTTY;
   393			return v4l2_s_ext_ctrls(vfh, vfh->ctrl_handler,
   394						vdev, sd->v4l2_dev->mdev, arg);
   395	
   396		case VIDIOC_TRY_EXT_CTRLS:
   397			if (!vfh->ctrl_handler)
   398				return -ENOTTY;
   399			return v4l2_try_ext_ctrls(vfh->ctrl_handler,
   400						  vdev, sd->v4l2_dev->mdev, arg);
   401	
   402		case VIDIOC_DQEVENT:
   403			if (!(sd->flags & V4L2_SUBDEV_FL_HAS_EVENTS))
   404				return -ENOIOCTLCMD;
   405	
   406			return v4l2_event_dequeue(vfh, arg, file->f_flags & O_NONBLOCK);
   407	
   408		case VIDIOC_DQEVENT_TIME32: {
   409			struct v4l2_event_time32 *ev32 = arg;
   410			struct v4l2_event ev = { };
   411	
   412			if (!(sd->flags & V4L2_SUBDEV_FL_HAS_EVENTS))
   413				return -ENOIOCTLCMD;
   414	
   415			rval = v4l2_event_dequeue(vfh, &ev, file->f_flags & O_NONBLOCK);
   416	
   417			*ev32 = (struct v4l2_event_time32) {
   418				.type		= ev.type,
   419				.pending	= ev.pending,
   420				.sequence	= ev.sequence,
   421				.timestamp.tv_sec  = ev.timestamp.tv_sec,
   422				.timestamp.tv_nsec = ev.timestamp.tv_nsec,
   423				.id		= ev.id,
   424			};
   425	
   426			memcpy(&ev32->u, &ev.u, sizeof(ev.u));
   427			memcpy(&ev32->reserved, &ev.reserved, sizeof(ev.reserved));
   428	
   429			return rval;
   430		}
   431	
   432		case VIDIOC_SUBSCRIBE_EVENT:
   433			return v4l2_subdev_call(sd, core, subscribe_event, vfh, arg);
   434	
   435		case VIDIOC_UNSUBSCRIBE_EVENT:
   436			return v4l2_subdev_call(sd, core, unsubscribe_event, vfh, arg);
   437	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux