]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
media: exynos4-is: remove redundant check on type
authorColin Ian King <colin.king@canonical.com>
Wed, 13 Feb 2019 13:25:59 +0000 (08:25 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 18 Feb 2019 20:32:41 +0000 (15:32 -0500)
The check to see if type is V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE is redundant
as this has been already checked at the start of the function and if
it's not that value then -ENOSYS is returned. Hence the sprintf can be
replaced by a simpler string copy.

Detected by CoverityScan, CID#1309450 ("Logically dead code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/exynos4-is/fimc-isp-video.c

index de6bd28f7e313d20332bd3fa24f87c4b422cf189..bb35a2017f21c797fcdf62a521bd5d9de8689a16 100644 (file)
@@ -606,9 +606,7 @@ int fimc_isp_video_device_register(struct fimc_isp *isp,
 
        vdev = &iv->ve.vdev;
        memset(vdev, 0, sizeof(*vdev));
-       snprintf(vdev->name, sizeof(vdev->name), "fimc-is-isp.%s",
-                       type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE ?
-                       "capture" : "output");
+       strscpy(vdev->name, "fimc-is-isp.capture", sizeof(vdev->name));
        vdev->queue = q;
        vdev->fops = &isp_video_fops;
        vdev->ioctl_ops = &isp_video_ioctl_ops;