[linuxtv-media:master 105/166] drivers/media/usb/dvb-usb/cxusb-analog.c:1498:41-42: WARNING: Use ARRAY_SIZE

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

 



tree:   git://linuxtv.org/media_tree.git master
head:   3b6471c7becd06325eb5e701cc2602b2edbbc7b6
commit: e478d40540544e229c843fe0c698ebc7d0ca07e6 [105/166] media: cxusb: add analog mode support for Medion MD95700

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


coccinelle warnings: (new ones prefixed by >>)

>> drivers/media/usb/dvb-usb/cxusb-analog.c:1498:41-42: WARNING: Use ARRAY_SIZE

vim +1498 drivers/media/usb/dvb-usb/cxusb-analog.c

  1457	
  1458	int cxusb_medion_analog_init(struct dvb_usb_device *dvbdev)
  1459	{
  1460		struct cxusb_medion_dev *cxdev = dvbdev->priv;
  1461		u8 tuner_analog_msg_data[] = { 0x9c, 0x60, 0x85, 0x54 };
  1462		struct i2c_msg tuner_analog_msg = { .addr = 0x61, .flags = 0,
  1463						    .buf = tuner_analog_msg_data,
  1464						    .len =
  1465						    sizeof(tuner_analog_msg_data) };
  1466		struct v4l2_subdev_format subfmt;
  1467		int ret;
  1468	
  1469		/* switch tuner to analog mode so IF demod will become accessible */
  1470		ret = i2c_transfer(&dvbdev->i2c_adap, &tuner_analog_msg, 1);
  1471		if (ret != 1)
  1472			dev_warn(&dvbdev->udev->dev,
  1473				 "tuner analog switch failed (%d)\n", ret);
  1474	
  1475		/*
  1476		 * cx25840 might have lost power during mode switching so we need
  1477		 * to set it again
  1478		 */
  1479		ret = v4l2_subdev_call(cxdev->cx25840, core, reset, 0);
  1480		if (ret != 0)
  1481			dev_warn(&dvbdev->udev->dev,
  1482				 "cx25840 reset failed (%d)\n", ret);
  1483	
  1484		ret = v4l2_subdev_call(cxdev->cx25840, video, s_routing,
  1485				       CX25840_COMPOSITE1, 0, 0);
  1486		if (ret != 0)
  1487			dev_warn(&dvbdev->udev->dev,
  1488				 "cx25840 initial input setting failed (%d)\n", ret);
  1489	
  1490		/* composite */
  1491		cxdev->input = 1;
  1492		cxdev->videodev->tvnorms = V4L2_STD_ALL;
  1493		cxdev->norm = V4L2_STD_PAL;
  1494	
  1495		/* TODO: setup audio samples insertion */
  1496	
  1497		ret = v4l2_subdev_call(cxdev->cx25840, core, s_io_pin_config,
> 1498				       sizeof(cxusub_medion_pin_config) /
  1499				       sizeof(cxusub_medion_pin_config[0]),
  1500				       cxusub_medion_pin_config);
  1501		if (ret != 0)
  1502			dev_warn(&dvbdev->udev->dev,
  1503				"cx25840 pin config failed (%d)\n", ret);
  1504	
  1505		/* make sure that we aren't in radio mode */
  1506		v4l2_subdev_call(cxdev->tda9887, video, s_std, cxdev->norm);
  1507		v4l2_subdev_call(cxdev->tuner, video, s_std, cxdev->norm);
  1508		v4l2_subdev_call(cxdev->cx25840, video, s_std, cxdev->norm);
  1509	
  1510		memset(&subfmt, 0, sizeof(subfmt));
  1511		subfmt.which = V4L2_SUBDEV_FORMAT_ACTIVE;
  1512		subfmt.format.width = cxdev->width;
  1513		subfmt.format.height = cxdev->height;
  1514		subfmt.format.code = MEDIA_BUS_FMT_FIXED;
  1515		subfmt.format.field = V4L2_FIELD_SEQ_TB;
  1516		subfmt.format.colorspace = V4L2_COLORSPACE_SMPTE170M;
  1517	
  1518		ret = v4l2_subdev_call(cxdev->cx25840, pad, set_fmt, NULL, &subfmt);
  1519		if (ret != 0)
  1520			dev_warn(&dvbdev->udev->dev,
  1521				 "cx25840 format set failed (%d)\n", ret);
  1522	
  1523		if (ret == 0) {
  1524			cxdev->width = subfmt.format.width;
  1525			cxdev->height = subfmt.format.height;
  1526		}
  1527	
  1528		return 0;
  1529	}
  1530	

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



[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