Re: [PATCH v5 2/2] media: v4l2: Get rid of ->vidioc_enum_fmt_vid_{cap,out}_mplane

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

 



Hi Boris,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on next-20190603]
[cannot apply to v5.2-rc3]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Boris-Brezillon/media-v4l2-Make-sure-all-drivers-set-_MPLANE-caps-in-vdev-device_caps/20190604-072816
base:   git://linuxtv.org/media_tree.git master
config: i386-randconfig-x074-201922 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

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

All warnings (new ones prefixed by >>):

   In file included from include/asm-generic/bug.h:5:0,
                    from arch/x86/include/asm/bug.h:83,
                    from include/linux/bug.h:5,
                    from include/linux/mmdebug.h:5,
                    from include/linux/mm.h:9,
                    from drivers/media/v4l2-core/v4l2-ioctl.c:15:
   drivers/media/v4l2-core/v4l2-ioctl.c: In function 'v4l_enum_fmt':
   drivers/media/v4l2-core/v4l2-ioctl.c:1397:15: warning: comparison of constant '9' with boolean expression is always false [-Wbool-compare]
          p->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
                  ^
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                       ^~~~
>> drivers/media/v4l2-core/v4l2-ioctl.c:1396:3: note: in expansion of macro 'if'
      if (!!(vdev->device_caps & V4L2_CAP_VIDEO_CAPTURE_MPLANE) !=
      ^~
   drivers/media/v4l2-core/v4l2-ioctl.c:1396:61: warning: suggest parentheses around comparison in operand of '==' [-Wparentheses]
      if (!!(vdev->device_caps & V4L2_CAP_VIDEO_CAPTURE_MPLANE) !=
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
          p->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
          ~~~~                                                   
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                       ^~~~
>> drivers/media/v4l2-core/v4l2-ioctl.c:1396:3: note: in expansion of macro 'if'
      if (!!(vdev->device_caps & V4L2_CAP_VIDEO_CAPTURE_MPLANE) !=
      ^~
   drivers/media/v4l2-core/v4l2-ioctl.c:1397:15: warning: comparison of constant '9' with boolean expression is always false [-Wbool-compare]
          p->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
                  ^
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                ^~~~
>> drivers/media/v4l2-core/v4l2-ioctl.c:1396:3: note: in expansion of macro 'if'
      if (!!(vdev->device_caps & V4L2_CAP_VIDEO_CAPTURE_MPLANE) !=
      ^~
   drivers/media/v4l2-core/v4l2-ioctl.c:1396:61: warning: suggest parentheses around comparison in operand of '==' [-Wparentheses]
      if (!!(vdev->device_caps & V4L2_CAP_VIDEO_CAPTURE_MPLANE) !=
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
          p->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
          ~~~~                                                   
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                ^~~~
>> drivers/media/v4l2-core/v4l2-ioctl.c:1396:3: note: in expansion of macro 'if'
      if (!!(vdev->device_caps & V4L2_CAP_VIDEO_CAPTURE_MPLANE) !=
      ^~
   drivers/media/v4l2-core/v4l2-ioctl.c:1397:15: warning: comparison of constant '9' with boolean expression is always false [-Wbool-compare]
          p->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
                  ^
   include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
     (cond) ?     \
      ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
    #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                               ^~~~~~~~~~~~~~
>> drivers/media/v4l2-core/v4l2-ioctl.c:1396:3: note: in expansion of macro 'if'
      if (!!(vdev->device_caps & V4L2_CAP_VIDEO_CAPTURE_MPLANE) !=
      ^~
   drivers/media/v4l2-core/v4l2-ioctl.c:1396:61: warning: suggest parentheses around comparison in operand of '==' [-Wparentheses]
      if (!!(vdev->device_caps & V4L2_CAP_VIDEO_CAPTURE_MPLANE) !=
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
          p->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
          ~~~~                                                   
   include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
     (cond) ?     \
      ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
    #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                               ^~~~~~~~~~~~~~
>> drivers/media/v4l2-core/v4l2-ioctl.c:1396:3: note: in expansion of macro 'if'
      if (!!(vdev->device_caps & V4L2_CAP_VIDEO_CAPTURE_MPLANE) !=
      ^~
   drivers/media/v4l2-core/v4l2-ioctl.c:1412:15: warning: comparison of constant '10' with boolean expression is always false [-Wbool-compare]
          p->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
                  ^
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                       ^~~~
   drivers/media/v4l2-core/v4l2-ioctl.c:1411:3: note: in expansion of macro 'if'
      if (!!(vdev->device_caps & V4L2_CAP_VIDEO_OUTPUT_MPLANE) !=
      ^~
   drivers/media/v4l2-core/v4l2-ioctl.c:1411:60: warning: suggest parentheses around comparison in operand of '==' [-Wparentheses]
      if (!!(vdev->device_caps & V4L2_CAP_VIDEO_OUTPUT_MPLANE) !=
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
          p->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
          ~~~~                                                  
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                       ^~~~
   drivers/media/v4l2-core/v4l2-ioctl.c:1411:3: note: in expansion of macro 'if'
      if (!!(vdev->device_caps & V4L2_CAP_VIDEO_OUTPUT_MPLANE) !=
      ^~
   drivers/media/v4l2-core/v4l2-ioctl.c:1412:15: warning: comparison of constant '10' with boolean expression is always false [-Wbool-compare]
          p->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
                  ^
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                ^~~~
   drivers/media/v4l2-core/v4l2-ioctl.c:1411:3: note: in expansion of macro 'if'
      if (!!(vdev->device_caps & V4L2_CAP_VIDEO_OUTPUT_MPLANE) !=
      ^~
   drivers/media/v4l2-core/v4l2-ioctl.c:1411:60: warning: suggest parentheses around comparison in operand of '==' [-Wparentheses]
      if (!!(vdev->device_caps & V4L2_CAP_VIDEO_OUTPUT_MPLANE) !=
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
          p->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
          ~~~~                                                  
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                ^~~~
   drivers/media/v4l2-core/v4l2-ioctl.c:1411:3: note: in expansion of macro 'if'
      if (!!(vdev->device_caps & V4L2_CAP_VIDEO_OUTPUT_MPLANE) !=
      ^~
   drivers/media/v4l2-core/v4l2-ioctl.c:1412:15: warning: comparison of constant '10' with boolean expression is always false [-Wbool-compare]
          p->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
                  ^
   include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
     (cond) ?     \
      ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
    #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                               ^~~~~~~~~~~~~~
   drivers/media/v4l2-core/v4l2-ioctl.c:1411:3: note: in expansion of macro 'if'
      if (!!(vdev->device_caps & V4L2_CAP_VIDEO_OUTPUT_MPLANE) !=
      ^~
   drivers/media/v4l2-core/v4l2-ioctl.c:1411:60: warning: suggest parentheses around comparison in operand of '==' [-Wparentheses]
      if (!!(vdev->device_caps & V4L2_CAP_VIDEO_OUTPUT_MPLANE) !=
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
          p->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
          ~~~~                                                  
   include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
     (cond) ?     \
      ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
    #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                               ^~~~~~~~~~~~~~
   drivers/media/v4l2-core/v4l2-ioctl.c:1411:3: note: in expansion of macro 'if'
      if (!!(vdev->device_caps & V4L2_CAP_VIDEO_OUTPUT_MPLANE) !=
      ^~

vim +/if +1396 drivers/media/v4l2-core/v4l2-ioctl.c

  1381	
  1382	static int v4l_enum_fmt(const struct v4l2_ioctl_ops *ops,
  1383					struct file *file, void *fh, void *arg)
  1384	{
  1385		struct video_device *vdev = video_devdata(file);
  1386		struct v4l2_fmtdesc *p = arg;
  1387		int ret = check_fmt(file, p->type);
  1388	
  1389		if (ret)
  1390			return ret;
  1391		ret = -EINVAL;
  1392	
  1393		switch (p->type) {
  1394		case V4L2_BUF_TYPE_VIDEO_CAPTURE:
  1395		case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
> 1396			if (!!(vdev->device_caps & V4L2_CAP_VIDEO_CAPTURE_MPLANE) !=
  1397			    p->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
  1398				break;
  1399	
  1400			if (unlikely(!ops->vidioc_enum_fmt_vid_cap))
  1401				break;
  1402			ret = ops->vidioc_enum_fmt_vid_cap(file, fh, arg);
  1403			break;
  1404		case V4L2_BUF_TYPE_VIDEO_OVERLAY:
  1405			if (unlikely(!ops->vidioc_enum_fmt_vid_overlay))
  1406				break;
  1407			ret = ops->vidioc_enum_fmt_vid_overlay(file, fh, arg);
  1408			break;
  1409		case V4L2_BUF_TYPE_VIDEO_OUTPUT:
  1410		case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
  1411			if (!!(vdev->device_caps & V4L2_CAP_VIDEO_OUTPUT_MPLANE) !=
  1412			    p->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
  1413				break;
  1414	
  1415			if (unlikely(!ops->vidioc_enum_fmt_vid_out))
  1416				break;
  1417			ret = ops->vidioc_enum_fmt_vid_out(file, fh, arg);
  1418			break;
  1419		case V4L2_BUF_TYPE_SDR_CAPTURE:
  1420			if (unlikely(!ops->vidioc_enum_fmt_sdr_cap))
  1421				break;
  1422			ret = ops->vidioc_enum_fmt_sdr_cap(file, fh, arg);
  1423			break;
  1424		case V4L2_BUF_TYPE_SDR_OUTPUT:
  1425			if (unlikely(!ops->vidioc_enum_fmt_sdr_out))
  1426				break;
  1427			ret = ops->vidioc_enum_fmt_sdr_out(file, fh, arg);
  1428			break;
  1429		case V4L2_BUF_TYPE_META_CAPTURE:
  1430			if (unlikely(!ops->vidioc_enum_fmt_meta_cap))
  1431				break;
  1432			ret = ops->vidioc_enum_fmt_meta_cap(file, fh, arg);
  1433			break;
  1434		case V4L2_BUF_TYPE_META_OUTPUT:
  1435			if (unlikely(!ops->vidioc_enum_fmt_meta_out))
  1436				break;
  1437			ret = ops->vidioc_enum_fmt_meta_out(file, fh, arg);
  1438			break;
  1439		}
  1440		if (ret == 0)
  1441			v4l_fill_fmtdesc(p);
  1442		return ret;
  1443	}
  1444	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

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