[linux-next:master 8840/10202] drivers/staging/media/imx/imx7-media-csi.c:1082 imx7_csi_set_fmt() error: uninitialized symbol 'cc'.

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   550f4769c7c4a84e3966f20887c6e249c5f2afc4
commit: 05f634040c0d05f59f2dcd39722157cb3b57c85b [8840/10202] media: staging/imx7: add imx7 CSI subdev driver

New smatch warnings:
drivers/staging/media/imx/imx7-media-csi.c:1082 imx7_csi_set_fmt() error: uninitialized symbol 'cc'.

Old smatch warnings:
drivers/staging/media/imx/imx7-media-csi.c:1076 imx7_csi_set_fmt() error: uninitialized symbol 'outcc'.

# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=05f634040c0d05f59f2dcd39722157cb3b57c85b
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update linux-next
git checkout 05f634040c0d05f59f2dcd39722157cb3b57c85b
vim +/cc +1082 drivers/staging/media/imx/imx7-media-csi.c

05f63404 Rui Miguel Silva 2019-02-06  1029  
05f63404 Rui Miguel Silva 2019-02-06  1030  static int imx7_csi_set_fmt(struct v4l2_subdev *sd,
05f63404 Rui Miguel Silva 2019-02-06  1031  			    struct v4l2_subdev_pad_config *cfg,
05f63404 Rui Miguel Silva 2019-02-06  1032  			    struct v4l2_subdev_format *sdformat)
05f63404 Rui Miguel Silva 2019-02-06  1033  {
05f63404 Rui Miguel Silva 2019-02-06  1034  	struct imx7_csi *csi = v4l2_get_subdevdata(sd);
05f63404 Rui Miguel Silva 2019-02-06  1035  	struct imx_media_video_dev *vdev = csi->vdev;
05f63404 Rui Miguel Silva 2019-02-06  1036  	const struct imx_media_pixfmt *outcc;
05f63404 Rui Miguel Silva 2019-02-06  1037  	struct v4l2_mbus_framefmt *outfmt;
05f63404 Rui Miguel Silva 2019-02-06  1038  	struct v4l2_pix_format vdev_fmt;
05f63404 Rui Miguel Silva 2019-02-06  1039  	const struct imx_media_pixfmt *cc;
05f63404 Rui Miguel Silva 2019-02-06  1040  	struct v4l2_mbus_framefmt *fmt;
05f63404 Rui Miguel Silva 2019-02-06  1041  	struct v4l2_subdev_format format;
05f63404 Rui Miguel Silva 2019-02-06  1042  	int ret = 0;
05f63404 Rui Miguel Silva 2019-02-06  1043  
05f63404 Rui Miguel Silva 2019-02-06  1044  	if (sdformat->pad >= IMX7_CSI_PADS_NUM)
05f63404 Rui Miguel Silva 2019-02-06  1045  		return -EINVAL;
05f63404 Rui Miguel Silva 2019-02-06  1046  
05f63404 Rui Miguel Silva 2019-02-06  1047  	mutex_lock(&csi->lock);
05f63404 Rui Miguel Silva 2019-02-06  1048  
05f63404 Rui Miguel Silva 2019-02-06  1049  	if (csi->is_streaming) {
05f63404 Rui Miguel Silva 2019-02-06  1050  		ret = -EBUSY;
05f63404 Rui Miguel Silva 2019-02-06  1051  		goto out_unlock;
05f63404 Rui Miguel Silva 2019-02-06  1052  	}
05f63404 Rui Miguel Silva 2019-02-06  1053  
05f63404 Rui Miguel Silva 2019-02-06  1054  	imx7_csi_try_fmt(csi, cfg, sdformat, &cc);
05f63404 Rui Miguel Silva 2019-02-06  1055  
05f63404 Rui Miguel Silva 2019-02-06  1056  	fmt = imx7_csi_get_format(csi, cfg, sdformat->pad, sdformat->which);
05f63404 Rui Miguel Silva 2019-02-06  1057  	if (!fmt) {
05f63404 Rui Miguel Silva 2019-02-06  1058  		ret = -EINVAL;
05f63404 Rui Miguel Silva 2019-02-06  1059  		goto out_unlock;
05f63404 Rui Miguel Silva 2019-02-06  1060  	}
05f63404 Rui Miguel Silva 2019-02-06  1061  
05f63404 Rui Miguel Silva 2019-02-06  1062  	*fmt = sdformat->format;
05f63404 Rui Miguel Silva 2019-02-06  1063  
05f63404 Rui Miguel Silva 2019-02-06  1064  	if (sdformat->pad == IMX7_CSI_PAD_SINK) {
05f63404 Rui Miguel Silva 2019-02-06  1065  		/* propagate format to source pads */
05f63404 Rui Miguel Silva 2019-02-06  1066  		format.pad = IMX7_CSI_PAD_SRC;
05f63404 Rui Miguel Silva 2019-02-06  1067  		format.which = sdformat->which;
05f63404 Rui Miguel Silva 2019-02-06  1068  		format.format = sdformat->format;
05f63404 Rui Miguel Silva 2019-02-06  1069  		imx7_csi_try_fmt(csi, cfg, &format, &outcc);
05f63404 Rui Miguel Silva 2019-02-06  1070  
05f63404 Rui Miguel Silva 2019-02-06  1071  		outfmt = imx7_csi_get_format(csi, cfg, IMX7_CSI_PAD_SRC,
05f63404 Rui Miguel Silva 2019-02-06  1072  					     sdformat->which);
05f63404 Rui Miguel Silva 2019-02-06  1073  		*outfmt = format.format;
05f63404 Rui Miguel Silva 2019-02-06  1074  
05f63404 Rui Miguel Silva 2019-02-06  1075  		if (sdformat->which == V4L2_SUBDEV_FORMAT_ACTIVE)
05f63404 Rui Miguel Silva 2019-02-06  1076  			csi->cc[IMX7_CSI_PAD_SRC] = outcc;
05f63404 Rui Miguel Silva 2019-02-06  1077  	}
05f63404 Rui Miguel Silva 2019-02-06  1078  
05f63404 Rui Miguel Silva 2019-02-06  1079  	if (sdformat->which == V4L2_SUBDEV_FORMAT_TRY)
05f63404 Rui Miguel Silva 2019-02-06  1080  		goto out_unlock;
05f63404 Rui Miguel Silva 2019-02-06  1081  
05f63404 Rui Miguel Silva 2019-02-06 @1082  	csi->cc[sdformat->pad] = cc;
05f63404 Rui Miguel Silva 2019-02-06  1083  
05f63404 Rui Miguel Silva 2019-02-06  1084  	/* propagate output pad format to capture device */
05f63404 Rui Miguel Silva 2019-02-06  1085  	imx_media_mbus_fmt_to_pix_fmt(&vdev_fmt,
05f63404 Rui Miguel Silva 2019-02-06  1086  				      &csi->format_mbus[IMX7_CSI_PAD_SRC],
05f63404 Rui Miguel Silva 2019-02-06  1087  				      csi->cc[IMX7_CSI_PAD_SRC]);
05f63404 Rui Miguel Silva 2019-02-06  1088  	mutex_unlock(&csi->lock);
05f63404 Rui Miguel Silva 2019-02-06  1089  	imx_media_capture_device_set_format(vdev, &vdev_fmt);
05f63404 Rui Miguel Silva 2019-02-06  1090  
05f63404 Rui Miguel Silva 2019-02-06  1091  	return 0;
05f63404 Rui Miguel Silva 2019-02-06  1092  
05f63404 Rui Miguel Silva 2019-02-06  1093  out_unlock:
05f63404 Rui Miguel Silva 2019-02-06  1094  	mutex_unlock(&csi->lock);
05f63404 Rui Miguel Silva 2019-02-06  1095  
05f63404 Rui Miguel Silva 2019-02-06  1096  	return ret;
05f63404 Rui Miguel Silva 2019-02-06  1097  }
05f63404 Rui Miguel Silva 2019-02-06  1098  

---
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