aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-10 08:19:14 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-11 13:32:17 -0400
commitc0decac19da3906d9b66291e57b7759489e1170f (patch)
tree0eeb1f7d2c5464e0c87e0c788fd8fb581662c621 /drivers/media/platform
parentb730c40813a95ebc35757790a990794f55e2b61c (diff)
media: use strscpy() instead of strlcpy()
The implementation of strscpy() is more robust and safer. That's now the recommended way to copy NUL terminated strings. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Reviewed-by: Kees Cook <keescook@chromium.org> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r--drivers/media/platform/am437x/am437x-vpfe.c6
-rw-r--r--drivers/media/platform/atmel/atmel-isc.c2
-rw-r--r--drivers/media/platform/atmel/atmel-isi.c10
-rw-r--r--drivers/media/platform/coda/coda-common.c8
-rw-r--r--drivers/media/platform/davinci/vpbe_display.c2
-rw-r--r--drivers/media/platform/davinci/vpfe_capture.c6
-rw-r--r--drivers/media/platform/davinci/vpif_capture.c6
-rw-r--r--drivers/media/platform/davinci/vpif_display.c6
-rw-r--r--drivers/media/platform/exynos-gsc/gsc-core.c2
-rw-r--r--drivers/media/platform/exynos-gsc/gsc-m2m.c4
-rw-r--r--drivers/media/platform/exynos4-is/common.c4
-rw-r--r--drivers/media/platform/exynos4-is/fimc-capture.c2
-rw-r--r--drivers/media/platform/exynos4-is/fimc-is-i2c.c2
-rw-r--r--drivers/media/platform/exynos4-is/fimc-isp-video.c2
-rw-r--r--drivers/media/platform/exynos4-is/fimc-lite.c6
-rw-r--r--drivers/media/platform/exynos4-is/media-dev.c8
-rw-r--r--drivers/media/platform/m2m-deinterlace.c8
-rw-r--r--drivers/media/platform/marvell-ccic/mcam-core.c6
-rw-r--r--drivers/media/platform/marvell-ccic/mmp-driver.c2
-rw-r--r--drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c4
-rw-r--r--drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c6
-rw-r--r--drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c6
-rw-r--r--drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c6
-rw-r--r--drivers/media/platform/mx2_emmaprp.c2
-rw-r--r--drivers/media/platform/omap/omap_vout.c10
-rw-r--r--drivers/media/platform/omap3isp/isp.c2
-rw-r--r--drivers/media/platform/omap3isp/ispccdc.c2
-rw-r--r--drivers/media/platform/omap3isp/ispccp2.c2
-rw-r--r--drivers/media/platform/omap3isp/ispcsi2.c2
-rw-r--r--drivers/media/platform/omap3isp/isppreview.c2
-rw-r--r--drivers/media/platform/omap3isp/ispresizer.c2
-rw-r--r--drivers/media/platform/omap3isp/ispvideo.c8
-rw-r--r--drivers/media/platform/pxa_camera.c8
-rw-r--r--drivers/media/platform/qcom/camss/camss-video.c8
-rw-r--r--drivers/media/platform/qcom/camss/camss.c2
-rw-r--r--drivers/media/platform/qcom/venus/vdec.c8
-rw-r--r--drivers/media/platform/qcom/venus/venc.c8
-rw-r--r--drivers/media/platform/rcar-vin/rcar-core.c4
-rw-r--r--drivers/media/platform/rcar-vin/rcar-v4l2.c8
-rw-r--r--drivers/media/platform/rcar_drif.c4
-rw-r--r--drivers/media/platform/rcar_fdp1.c6
-rw-r--r--drivers/media/platform/rcar_jpu.c10
-rw-r--r--drivers/media/platform/renesas-ceu.c6
-rw-r--r--drivers/media/platform/rockchip/rga/rga.c6
-rw-r--r--drivers/media/platform/s3c-camif/camif-capture.c10
-rw-r--r--drivers/media/platform/s3c-camif/camif-core.c4
-rw-r--r--drivers/media/platform/s5p-jpeg/jpeg-core.c10
-rw-r--r--drivers/media/platform/s5p-mfc/s5p_mfc_dec.c6
-rw-r--r--drivers/media/platform/s5p-mfc/s5p_mfc_enc.c6
-rw-r--r--drivers/media/platform/sh_veu.c9
-rw-r--r--drivers/media/platform/sh_vou.c10
-rw-r--r--drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c6
-rw-r--r--drivers/media/platform/soc_camera/soc_camera.c6
-rw-r--r--drivers/media/platform/soc_camera/soc_camera_platform.c2
-rw-r--r--drivers/media/platform/sti/bdisp/bdisp-v4l2.c4
-rw-r--r--drivers/media/platform/sti/delta/delta-v4l2.c4
-rw-r--r--drivers/media/platform/sti/hva/hva-v4l2.c4
-rw-r--r--drivers/media/platform/stm32/stm32-dcmi.c10
-rw-r--r--drivers/media/platform/ti-vpe/cal.c6
-rw-r--r--drivers/media/platform/via-camera.c4
-rw-r--r--drivers/media/platform/vicodec/vicodec-core.c6
-rw-r--r--drivers/media/platform/vim2m.c2
-rw-r--r--drivers/media/platform/vimc/vimc-capture.c6
-rw-r--r--drivers/media/platform/vimc/vimc-common.c2
-rw-r--r--drivers/media/platform/vimc/vimc-core.c4
-rw-r--r--drivers/media/platform/vivid/vivid-osd.c2
-rw-r--r--drivers/media/platform/vivid/vivid-radio-common.c4
-rw-r--r--drivers/media/platform/vivid/vivid-radio-rx.c2
-rw-r--r--drivers/media/platform/vivid/vivid-radio-tx.c2
-rw-r--r--drivers/media/platform/vivid/vivid-rds-gen.c4
-rw-r--r--drivers/media/platform/vivid/vivid-sdr-cap.c4
-rw-r--r--drivers/media/platform/vivid/vivid-vid-cap.c2
-rw-r--r--drivers/media/platform/vsp1/vsp1_drv.c2
-rw-r--r--drivers/media/platform/vsp1/vsp1_histo.c4
-rw-r--r--drivers/media/platform/vsp1/vsp1_video.c4
-rw-r--r--drivers/media/platform/xilinx/xilinx-dma.c6
-rw-r--r--drivers/media/platform/xilinx/xilinx-tpg.c2
-rw-r--r--drivers/media/platform/xilinx/xilinx-vipp.c2
78 files changed, 193 insertions, 192 deletions
diff --git a/drivers/media/platform/am437x/am437x-vpfe.c b/drivers/media/platform/am437x/am437x-vpfe.c
index b05738a95e55..28590cf3770b 100644
--- a/drivers/media/platform/am437x/am437x-vpfe.c
+++ b/drivers/media/platform/am437x/am437x-vpfe.c
@@ -1408,8 +1408,8 @@ static int vpfe_querycap(struct file *file, void *priv,
1408 1408
1409 vpfe_dbg(2, vpfe, "vpfe_querycap\n"); 1409 vpfe_dbg(2, vpfe, "vpfe_querycap\n");
1410 1410
1411 strlcpy(cap->driver, VPFE_MODULE_NAME, sizeof(cap->driver)); 1411 strscpy(cap->driver, VPFE_MODULE_NAME, sizeof(cap->driver));
1412 strlcpy(cap->card, "TI AM437x VPFE", sizeof(cap->card)); 1412 strscpy(cap->card, "TI AM437x VPFE", sizeof(cap->card));
1413 snprintf(cap->bus_info, sizeof(cap->bus_info), 1413 snprintf(cap->bus_info, sizeof(cap->bus_info),
1414 "platform:%s", vpfe->v4l2_dev.name); 1414 "platform:%s", vpfe->v4l2_dev.name);
1415 cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING | 1415 cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
@@ -2386,7 +2386,7 @@ static int vpfe_probe_complete(struct vpfe_device *vpfe)
2386 INIT_LIST_HEAD(&vpfe->dma_queue); 2386 INIT_LIST_HEAD(&vpfe->dma_queue);
2387 2387
2388 vdev = &vpfe->video_dev; 2388 vdev = &vpfe->video_dev;
2389 strlcpy(vdev->name, VPFE_MODULE_NAME, sizeof(vdev->name)); 2389 strscpy(vdev->name, VPFE_MODULE_NAME, sizeof(vdev->name));
2390 vdev->release = video_device_release_empty; 2390 vdev->release = video_device_release_empty;
2391 vdev->fops = &vpfe_fops; 2391 vdev->fops = &vpfe_fops;
2392 vdev->ioctl_ops = &vpfe_ioctl_ops; 2392 vdev->ioctl_ops = &vpfe_ioctl_ops;
diff --git a/drivers/media/platform/atmel/atmel-isc.c b/drivers/media/platform/atmel/atmel-isc.c
index d89e14524d42..776a92d7387f 100644
--- a/drivers/media/platform/atmel/atmel-isc.c
+++ b/drivers/media/platform/atmel/atmel-isc.c
@@ -1951,7 +1951,7 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier)
1951 INIT_WORK(&isc->awb_work, isc_awb_work); 1951 INIT_WORK(&isc->awb_work, isc_awb_work);
1952 1952
1953 /* Register video device */ 1953 /* Register video device */
1954 strlcpy(vdev->name, ATMEL_ISC_NAME, sizeof(vdev->name)); 1954 strscpy(vdev->name, ATMEL_ISC_NAME, sizeof(vdev->name));
1955 vdev->release = video_device_release_empty; 1955 vdev->release = video_device_release_empty;
1956 vdev->fops = &isc_fops; 1956 vdev->fops = &isc_fops;
1957 vdev->ioctl_ops = &isc_ioctl_ops; 1957 vdev->ioctl_ops = &isc_ioctl_ops;
diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c
index e8db4df1e7c4..26874575d381 100644
--- a/drivers/media/platform/atmel/atmel-isi.c
+++ b/drivers/media/platform/atmel/atmel-isi.c
@@ -655,9 +655,9 @@ static int isi_enum_fmt_vid_cap(struct file *file, void *priv,
655static int isi_querycap(struct file *file, void *priv, 655static int isi_querycap(struct file *file, void *priv,
656 struct v4l2_capability *cap) 656 struct v4l2_capability *cap)
657{ 657{
658 strlcpy(cap->driver, "atmel-isi", sizeof(cap->driver)); 658 strscpy(cap->driver, "atmel-isi", sizeof(cap->driver));
659 strlcpy(cap->card, "Atmel Image Sensor Interface", sizeof(cap->card)); 659 strscpy(cap->card, "Atmel Image Sensor Interface", sizeof(cap->card));
660 strlcpy(cap->bus_info, "platform:isi", sizeof(cap->bus_info)); 660 strscpy(cap->bus_info, "platform:isi", sizeof(cap->bus_info));
661 return 0; 661 return 0;
662} 662}
663 663
@@ -668,7 +668,7 @@ static int isi_enum_input(struct file *file, void *priv,
668 return -EINVAL; 668 return -EINVAL;
669 669
670 i->type = V4L2_INPUT_TYPE_CAMERA; 670 i->type = V4L2_INPUT_TYPE_CAMERA;
671 strlcpy(i->name, "Camera", sizeof(i->name)); 671 strscpy(i->name, "Camera", sizeof(i->name));
672 return 0; 672 return 0;
673} 673}
674 674
@@ -1202,7 +1202,7 @@ static int atmel_isi_probe(struct platform_device *pdev)
1202 isi->vdev->fops = &isi_fops; 1202 isi->vdev->fops = &isi_fops;
1203 isi->vdev->v4l2_dev = &isi->v4l2_dev; 1203 isi->vdev->v4l2_dev = &isi->v4l2_dev;
1204 isi->vdev->queue = &isi->queue; 1204 isi->vdev->queue = &isi->queue;
1205 strlcpy(isi->vdev->name, KBUILD_MODNAME, sizeof(isi->vdev->name)); 1205 strscpy(isi->vdev->name, KBUILD_MODNAME, sizeof(isi->vdev->name));
1206 isi->vdev->release = video_device_release; 1206 isi->vdev->release = video_device_release;
1207 isi->vdev->ioctl_ops = &isi_ioctl_ops; 1207 isi->vdev->ioctl_ops = &isi_ioctl_ops;
1208 isi->vdev->lock = &isi->lock; 1208 isi->vdev->lock = &isi->lock;
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
index 726b3b93a486..0bffa1e02e58 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -390,10 +390,10 @@ static int coda_querycap(struct file *file, void *priv,
390{ 390{
391 struct coda_ctx *ctx = fh_to_ctx(priv); 391 struct coda_ctx *ctx = fh_to_ctx(priv);
392 392
393 strlcpy(cap->driver, CODA_NAME, sizeof(cap->driver)); 393 strscpy(cap->driver, CODA_NAME, sizeof(cap->driver));
394 strlcpy(cap->card, coda_product_name(ctx->dev->devtype->product), 394 strscpy(cap->card, coda_product_name(ctx->dev->devtype->product),
395 sizeof(cap->card)); 395 sizeof(cap->card));
396 strlcpy(cap->bus_info, "platform:" CODA_NAME, sizeof(cap->bus_info)); 396 strscpy(cap->bus_info, "platform:" CODA_NAME, sizeof(cap->bus_info));
397 cap->device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING; 397 cap->device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
398 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; 398 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
399 399
@@ -2408,7 +2408,7 @@ static int coda_register_device(struct coda_dev *dev, int i)
2408 if (i >= dev->devtype->num_vdevs) 2408 if (i >= dev->devtype->num_vdevs)
2409 return -EINVAL; 2409 return -EINVAL;
2410 2410
2411 strlcpy(vfd->name, dev->devtype->vdevs[i]->name, sizeof(vfd->name)); 2411 strscpy(vfd->name, dev->devtype->vdevs[i]->name, sizeof(vfd->name));
2412 vfd->fops = &coda_fops; 2412 vfd->fops = &coda_fops;
2413 vfd->ioctl_ops = &coda_ioctl_ops; 2413 vfd->ioctl_ops = &coda_ioctl_ops;
2414 vfd->release = video_device_release_empty, 2414 vfd->release = video_device_release_empty,
diff --git a/drivers/media/platform/davinci/vpbe_display.c b/drivers/media/platform/davinci/vpbe_display.c
index b0eb3d899eb4..a96c9337ae58 100644
--- a/drivers/media/platform/davinci/vpbe_display.c
+++ b/drivers/media/platform/davinci/vpbe_display.c
@@ -647,7 +647,7 @@ static int vpbe_display_querycap(struct file *file, void *priv,
647 dev_name(vpbe_dev->pdev)); 647 dev_name(vpbe_dev->pdev));
648 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", 648 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
649 dev_name(vpbe_dev->pdev)); 649 dev_name(vpbe_dev->pdev));
650 strlcpy(cap->card, vpbe_dev->cfg->module_name, sizeof(cap->card)); 650 strscpy(cap->card, vpbe_dev->cfg->module_name, sizeof(cap->card));
651 651
652 return 0; 652 return 0;
653} 653}
diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c
index 8613358ed245..ea3ddd5a42bd 100644
--- a/drivers/media/platform/davinci/vpfe_capture.c
+++ b/drivers/media/platform/davinci/vpfe_capture.c
@@ -889,9 +889,9 @@ static int vpfe_querycap(struct file *file, void *priv,
889 889
890 cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING; 890 cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
891 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; 891 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
892 strlcpy(cap->driver, CAPTURE_DRV_NAME, sizeof(cap->driver)); 892 strscpy(cap->driver, CAPTURE_DRV_NAME, sizeof(cap->driver));
893 strlcpy(cap->bus_info, "VPFE", sizeof(cap->bus_info)); 893 strscpy(cap->bus_info, "VPFE", sizeof(cap->bus_info));
894 strlcpy(cap->card, vpfe_dev->cfg->card_name, sizeof(cap->card)); 894 strscpy(cap->card, vpfe_dev->cfg->card_name, sizeof(cap->card));
895 return 0; 895 return 0;
896} 896}
897 897
diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
index a96f53ce8088..f0c2508a6e2e 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -1094,10 +1094,10 @@ static int vpif_querycap(struct file *file, void *priv,
1094 1094
1095 cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING; 1095 cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
1096 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; 1096 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
1097 strlcpy(cap->driver, VPIF_DRIVER_NAME, sizeof(cap->driver)); 1097 strscpy(cap->driver, VPIF_DRIVER_NAME, sizeof(cap->driver));
1098 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", 1098 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
1099 dev_name(vpif_dev)); 1099 dev_name(vpif_dev));
1100 strlcpy(cap->card, config->card_name, sizeof(cap->card)); 1100 strscpy(cap->card, config->card_name, sizeof(cap->card));
1101 1101
1102 return 0; 1102 return 0;
1103} 1103}
@@ -1463,7 +1463,7 @@ static int vpif_probe_complete(void)
1463 1463
1464 /* Initialize the video_device structure */ 1464 /* Initialize the video_device structure */
1465 vdev = &ch->video_dev; 1465 vdev = &ch->video_dev;
1466 strlcpy(vdev->name, VPIF_DRIVER_NAME, sizeof(vdev->name)); 1466 strscpy(vdev->name, VPIF_DRIVER_NAME, sizeof(vdev->name));
1467 vdev->release = video_device_release_empty; 1467 vdev->release = video_device_release_empty;
1468 vdev->fops = &vpif_fops; 1468 vdev->fops = &vpif_fops;
1469 vdev->ioctl_ops = &vpif_ioctl_ops; 1469 vdev->ioctl_ops = &vpif_ioctl_ops;
diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
index 0f324055cc9f..fec4341eb93e 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -586,10 +586,10 @@ static int vpif_querycap(struct file *file, void *priv,
586 586
587 cap->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING; 587 cap->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
588 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; 588 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
589 strlcpy(cap->driver, VPIF_DRIVER_NAME, sizeof(cap->driver)); 589 strscpy(cap->driver, VPIF_DRIVER_NAME, sizeof(cap->driver));
590 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", 590 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
591 dev_name(vpif_dev)); 591 dev_name(vpif_dev));
592 strlcpy(cap->card, config->card_name, sizeof(cap->card)); 592 strscpy(cap->card, config->card_name, sizeof(cap->card));
593 593
594 return 0; 594 return 0;
595} 595}
@@ -1209,7 +1209,7 @@ static int vpif_probe_complete(void)
1209 1209
1210 /* Initialize the video_device structure */ 1210 /* Initialize the video_device structure */
1211 vdev = &ch->video_dev; 1211 vdev = &ch->video_dev;
1212 strlcpy(vdev->name, VPIF_DRIVER_NAME, sizeof(vdev->name)); 1212 strscpy(vdev->name, VPIF_DRIVER_NAME, sizeof(vdev->name));
1213 vdev->release = video_device_release_empty; 1213 vdev->release = video_device_release_empty;
1214 vdev->fops = &vpif_fops; 1214 vdev->fops = &vpif_fops;
1215 vdev->ioctl_ops = &vpif_ioctl_ops; 1215 vdev->ioctl_ops = &vpif_ioctl_ops;
diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c
index 17854a379243..838c5c53de37 100644
--- a/drivers/media/platform/exynos-gsc/gsc-core.c
+++ b/drivers/media/platform/exynos-gsc/gsc-core.c
@@ -339,7 +339,7 @@ int gsc_enum_fmt_mplane(struct v4l2_fmtdesc *f)
339 if (!fmt) 339 if (!fmt)
340 return -EINVAL; 340 return -EINVAL;
341 341
342 strlcpy(f->description, fmt->name, sizeof(f->description)); 342 strscpy(f->description, fmt->name, sizeof(f->description));
343 f->pixelformat = fmt->pixelformat; 343 f->pixelformat = fmt->pixelformat;
344 344
345 return 0; 345 return 0;
diff --git a/drivers/media/platform/exynos-gsc/gsc-m2m.c b/drivers/media/platform/exynos-gsc/gsc-m2m.c
index c9d2f6c5311a..cc5d690818e1 100644
--- a/drivers/media/platform/exynos-gsc/gsc-m2m.c
+++ b/drivers/media/platform/exynos-gsc/gsc-m2m.c
@@ -294,8 +294,8 @@ static int gsc_m2m_querycap(struct file *file, void *fh,
294 struct gsc_ctx *ctx = fh_to_ctx(fh); 294 struct gsc_ctx *ctx = fh_to_ctx(fh);
295 struct gsc_dev *gsc = ctx->gsc_dev; 295 struct gsc_dev *gsc = ctx->gsc_dev;
296 296
297 strlcpy(cap->driver, GSC_MODULE_NAME, sizeof(cap->driver)); 297 strscpy(cap->driver, GSC_MODULE_NAME, sizeof(cap->driver));
298 strlcpy(cap->card, GSC_MODULE_NAME " gscaler", sizeof(cap->card)); 298 strscpy(cap->card, GSC_MODULE_NAME " gscaler", sizeof(cap->card));
299 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", 299 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
300 dev_name(&gsc->pdev->dev)); 300 dev_name(&gsc->pdev->dev));
301 cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M_MPLANE; 301 cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M_MPLANE;
diff --git a/drivers/media/platform/exynos4-is/common.c b/drivers/media/platform/exynos4-is/common.c
index b90f5bb15517..76f557548dfc 100644
--- a/drivers/media/platform/exynos4-is/common.c
+++ b/drivers/media/platform/exynos4-is/common.c
@@ -40,8 +40,8 @@ EXPORT_SYMBOL(fimc_find_remote_sensor);
40void __fimc_vidioc_querycap(struct device *dev, struct v4l2_capability *cap, 40void __fimc_vidioc_querycap(struct device *dev, struct v4l2_capability *cap,
41 unsigned int caps) 41 unsigned int caps)
42{ 42{
43 strlcpy(cap->driver, dev->driver->name, sizeof(cap->driver)); 43 strscpy(cap->driver, dev->driver->name, sizeof(cap->driver));
44 strlcpy(cap->card, dev->driver->name, sizeof(cap->card)); 44 strscpy(cap->card, dev->driver->name, sizeof(cap->card));
45 snprintf(cap->bus_info, sizeof(cap->bus_info), 45 snprintf(cap->bus_info, sizeof(cap->bus_info),
46 "platform:%s", dev_name(dev)); 46 "platform:%s", dev_name(dev));
47 cap->device_caps = caps; 47 cap->device_caps = caps;
diff --git a/drivers/media/platform/exynos4-is/fimc-capture.c b/drivers/media/platform/exynos4-is/fimc-capture.c
index a3cdac188190..f56220e549bb 100644
--- a/drivers/media/platform/exynos4-is/fimc-capture.c
+++ b/drivers/media/platform/exynos4-is/fimc-capture.c
@@ -1087,7 +1087,7 @@ static int fimc_cap_enum_input(struct file *file, void *priv,
1087 fimc_md_graph_unlock(ve); 1087 fimc_md_graph_unlock(ve);
1088 1088
1089 if (sd) 1089 if (sd)
1090 strlcpy(i->name, sd->name, sizeof(i->name)); 1090 strscpy(i->name, sd->name, sizeof(i->name));
1091 1091
1092 return 0; 1092 return 0;
1093} 1093}
diff --git a/drivers/media/platform/exynos4-is/fimc-is-i2c.c b/drivers/media/platform/exynos4-is/fimc-is-i2c.c
index 70dd4852b2b9..be937caf7645 100644
--- a/drivers/media/platform/exynos4-is/fimc-is-i2c.c
+++ b/drivers/media/platform/exynos4-is/fimc-is-i2c.c
@@ -57,7 +57,7 @@ static int fimc_is_i2c_probe(struct platform_device *pdev)
57 i2c_adap = &isp_i2c->adapter; 57 i2c_adap = &isp_i2c->adapter;
58 i2c_adap->dev.of_node = node; 58 i2c_adap->dev.of_node = node;
59 i2c_adap->dev.parent = &pdev->dev; 59 i2c_adap->dev.parent = &pdev->dev;
60 strlcpy(i2c_adap->name, "exynos4x12-isp-i2c", sizeof(i2c_adap->name)); 60 strscpy(i2c_adap->name, "exynos4x12-isp-i2c", sizeof(i2c_adap->name));
61 i2c_adap->owner = THIS_MODULE; 61 i2c_adap->owner = THIS_MODULE;
62 i2c_adap->algo = &fimc_is_i2c_algorithm; 62 i2c_adap->algo = &fimc_is_i2c_algorithm;
63 i2c_adap->class = I2C_CLASS_SPD; 63 i2c_adap->class = I2C_CLASS_SPD;
diff --git a/drivers/media/platform/exynos4-is/fimc-isp-video.c b/drivers/media/platform/exynos4-is/fimc-isp-video.c
index a920164f53f1..de6bd28f7e31 100644
--- a/drivers/media/platform/exynos4-is/fimc-isp-video.c
+++ b/drivers/media/platform/exynos4-is/fimc-isp-video.c
@@ -365,7 +365,7 @@ static int isp_video_enum_fmt_mplane(struct file *file, void *priv,
365 if (WARN_ON(fmt == NULL)) 365 if (WARN_ON(fmt == NULL))
366 return -EINVAL; 366 return -EINVAL;
367 367
368 strlcpy(f->description, fmt->name, sizeof(f->description)); 368 strscpy(f->description, fmt->name, sizeof(f->description));
369 f->pixelformat = fmt->fourcc; 369 f->pixelformat = fmt->fourcc;
370 370
371 return 0; 371 return 0;
diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c
index 70d5f5586a5d..96f0a8a0dcae 100644
--- a/drivers/media/platform/exynos4-is/fimc-lite.c
+++ b/drivers/media/platform/exynos4-is/fimc-lite.c
@@ -654,8 +654,8 @@ static int fimc_lite_querycap(struct file *file, void *priv,
654{ 654{
655 struct fimc_lite *fimc = video_drvdata(file); 655 struct fimc_lite *fimc = video_drvdata(file);
656 656
657 strlcpy(cap->driver, FIMC_LITE_DRV_NAME, sizeof(cap->driver)); 657 strscpy(cap->driver, FIMC_LITE_DRV_NAME, sizeof(cap->driver));
658 strlcpy(cap->card, FIMC_LITE_DRV_NAME, sizeof(cap->card)); 658 strscpy(cap->card, FIMC_LITE_DRV_NAME, sizeof(cap->card));
659 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", 659 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
660 dev_name(&fimc->pdev->dev)); 660 dev_name(&fimc->pdev->dev));
661 661
@@ -673,7 +673,7 @@ static int fimc_lite_enum_fmt_mplane(struct file *file, void *priv,
673 return -EINVAL; 673 return -EINVAL;
674 674
675 fmt = &fimc_lite_formats[f->index]; 675 fmt = &fimc_lite_formats[f->index];
676 strlcpy(f->description, fmt->name, sizeof(f->description)); 676 strscpy(f->description, fmt->name, sizeof(f->description));
677 f->pixelformat = fmt->fourcc; 677 f->pixelformat = fmt->fourcc;
678 678
679 return 0; 679 return 0;
diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c
index deb499f76412..18a393f51a26 100644
--- a/drivers/media/platform/exynos4-is/media-dev.c
+++ b/drivers/media/platform/exynos4-is/media-dev.c
@@ -1204,9 +1204,9 @@ static ssize_t fimc_md_sysfs_show(struct device *dev,
1204 struct fimc_md *fmd = dev_get_drvdata(dev); 1204 struct fimc_md *fmd = dev_get_drvdata(dev);
1205 1205
1206 if (fmd->user_subdev_api) 1206 if (fmd->user_subdev_api)
1207 return strlcpy(buf, "Sub-device API (sub-dev)\n", PAGE_SIZE); 1207 return strscpy(buf, "Sub-device API (sub-dev)\n", PAGE_SIZE);
1208 1208
1209 return strlcpy(buf, "V4L2 video node only API (vid-dev)\n", PAGE_SIZE); 1209 return strscpy(buf, "V4L2 video node only API (vid-dev)\n", PAGE_SIZE);
1210} 1210}
1211 1211
1212static ssize_t fimc_md_sysfs_store(struct device *dev, 1212static ssize_t fimc_md_sysfs_store(struct device *dev,
@@ -1426,7 +1426,7 @@ static int fimc_md_probe(struct platform_device *pdev)
1426 INIT_LIST_HEAD(&fmd->pipelines); 1426 INIT_LIST_HEAD(&fmd->pipelines);
1427 fmd->pdev = pdev; 1427 fmd->pdev = pdev;
1428 1428
1429 strlcpy(fmd->media_dev.model, "SAMSUNG S5P FIMC", 1429 strscpy(fmd->media_dev.model, "SAMSUNG S5P FIMC",
1430 sizeof(fmd->media_dev.model)); 1430 sizeof(fmd->media_dev.model));
1431 fmd->media_dev.ops = &fimc_md_ops; 1431 fmd->media_dev.ops = &fimc_md_ops;
1432 fmd->media_dev.dev = dev; 1432 fmd->media_dev.dev = dev;
@@ -1434,7 +1434,7 @@ static int fimc_md_probe(struct platform_device *pdev)
1434 v4l2_dev = &fmd->v4l2_dev; 1434 v4l2_dev = &fmd->v4l2_dev;
1435 v4l2_dev->mdev = &fmd->media_dev; 1435 v4l2_dev->mdev = &fmd->media_dev;
1436 v4l2_dev->notify = fimc_sensor_notify; 1436 v4l2_dev->notify = fimc_sensor_notify;
1437 strlcpy(v4l2_dev->name, "s5p-fimc-md", sizeof(v4l2_dev->name)); 1437 strscpy(v4l2_dev->name, "s5p-fimc-md", sizeof(v4l2_dev->name));
1438 1438
1439 fmd->use_isp = fimc_md_is_isp_available(dev->of_node); 1439 fmd->use_isp = fimc_md_is_isp_available(dev->of_node);
1440 fmd->user_subdev_api = true; 1440 fmd->user_subdev_api = true;
diff --git a/drivers/media/platform/m2m-deinterlace.c b/drivers/media/platform/m2m-deinterlace.c
index 5f84d2aa47ab..c62e598ee7d0 100644
--- a/drivers/media/platform/m2m-deinterlace.c
+++ b/drivers/media/platform/m2m-deinterlace.c
@@ -438,9 +438,9 @@ static void deinterlace_device_run(void *priv)
438static int vidioc_querycap(struct file *file, void *priv, 438static int vidioc_querycap(struct file *file, void *priv,
439 struct v4l2_capability *cap) 439 struct v4l2_capability *cap)
440{ 440{
441 strlcpy(cap->driver, MEM2MEM_NAME, sizeof(cap->driver)); 441 strscpy(cap->driver, MEM2MEM_NAME, sizeof(cap->driver));
442 strlcpy(cap->card, MEM2MEM_NAME, sizeof(cap->card)); 442 strscpy(cap->card, MEM2MEM_NAME, sizeof(cap->card));
443 strlcpy(cap->bus_info, MEM2MEM_NAME, sizeof(cap->card)); 443 strscpy(cap->bus_info, MEM2MEM_NAME, sizeof(cap->card));
444 /* 444 /*
445 * This is only a mem-to-mem video device. The capture and output 445 * This is only a mem-to-mem video device. The capture and output
446 * device capability flags are left only for backward compatibility 446 * device capability flags are left only for backward compatibility
@@ -474,7 +474,7 @@ static int enum_fmt(struct v4l2_fmtdesc *f, u32 type)
474 if (i < NUM_FORMATS) { 474 if (i < NUM_FORMATS) {
475 /* Format found */ 475 /* Format found */
476 fmt = &formats[i]; 476 fmt = &formats[i];
477 strlcpy(f->description, fmt->name, sizeof(f->description)); 477 strscpy(f->description, fmt->name, sizeof(f->description));
478 f->pixelformat = fmt->fourcc; 478 f->pixelformat = fmt->fourcc;
479 return 0; 479 return 0;
480 } 480 }
diff --git a/drivers/media/platform/marvell-ccic/mcam-core.c b/drivers/media/platform/marvell-ccic/mcam-core.c
index dfdbd4354b74..c47011194710 100644
--- a/drivers/media/platform/marvell-ccic/mcam-core.c
+++ b/drivers/media/platform/marvell-ccic/mcam-core.c
@@ -1305,7 +1305,7 @@ static int mcam_vidioc_querycap(struct file *file, void *priv,
1305 1305
1306 strcpy(cap->driver, "marvell_ccic"); 1306 strcpy(cap->driver, "marvell_ccic");
1307 strcpy(cap->card, "marvell_ccic"); 1307 strcpy(cap->card, "marvell_ccic");
1308 strlcpy(cap->bus_info, cam->bus_info, sizeof(cap->bus_info)); 1308 strscpy(cap->bus_info, cam->bus_info, sizeof(cap->bus_info));
1309 cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | 1309 cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |
1310 V4L2_CAP_READWRITE | V4L2_CAP_STREAMING; 1310 V4L2_CAP_READWRITE | V4L2_CAP_STREAMING;
1311 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; 1311 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
@@ -1318,8 +1318,8 @@ static int mcam_vidioc_enum_fmt_vid_cap(struct file *filp,
1318{ 1318{
1319 if (fmt->index >= N_MCAM_FMTS) 1319 if (fmt->index >= N_MCAM_FMTS)
1320 return -EINVAL; 1320 return -EINVAL;
1321 strlcpy(fmt->description, mcam_formats[fmt->index].desc, 1321 strscpy(fmt->description, mcam_formats[fmt->index].desc,
1322 sizeof(fmt->description)); 1322 sizeof(fmt->description));
1323 fmt->pixelformat = mcam_formats[fmt->index].pixelformat; 1323 fmt->pixelformat = mcam_formats[fmt->index].pixelformat;
1324 return 0; 1324 return 0;
1325} 1325}
diff --git a/drivers/media/platform/marvell-ccic/mmp-driver.c b/drivers/media/platform/marvell-ccic/mmp-driver.c
index 6d9f0abb2660..41968cd388ac 100644
--- a/drivers/media/platform/marvell-ccic/mmp-driver.c
+++ b/drivers/media/platform/marvell-ccic/mmp-driver.c
@@ -371,7 +371,7 @@ static int mmpcam_probe(struct platform_device *pdev)
371 mcam->lane = pdata->lane; 371 mcam->lane = pdata->lane;
372 mcam->chip_id = MCAM_ARMADA610; 372 mcam->chip_id = MCAM_ARMADA610;
373 mcam->buffer_mode = B_DMA_sg; 373 mcam->buffer_mode = B_DMA_sg;
374 strlcpy(mcam->bus_info, "platform:mmp-camera", sizeof(mcam->bus_info)); 374 strscpy(mcam->bus_info, "platform:mmp-camera", sizeof(mcam->bus_info));
375 spin_lock_init(&mcam->dev_lock); 375 spin_lock_init(&mcam->dev_lock);
376 /* 376 /*
377 * Get our I/O memory. 377 * Get our I/O memory.
diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
index 4f24da8afecc..2a5d5002c27e 100644
--- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
+++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
@@ -94,8 +94,8 @@ static int mtk_jpeg_querycap(struct file *file, void *priv,
94{ 94{
95 struct mtk_jpeg_dev *jpeg = video_drvdata(file); 95 struct mtk_jpeg_dev *jpeg = video_drvdata(file);
96 96
97 strlcpy(cap->driver, MTK_JPEG_NAME " decoder", sizeof(cap->driver)); 97 strscpy(cap->driver, MTK_JPEG_NAME " decoder", sizeof(cap->driver));
98 strlcpy(cap->card, MTK_JPEG_NAME " decoder", sizeof(cap->card)); 98 strscpy(cap->card, MTK_JPEG_NAME " decoder", sizeof(cap->card));
99 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", 99 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
100 dev_name(jpeg->dev)); 100 dev_name(jpeg->dev));
101 101
diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c b/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
index ceffc31cc6eb..51a13466261e 100644
--- a/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
+++ b/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
@@ -619,9 +619,9 @@ static int mtk_mdp_m2m_querycap(struct file *file, void *fh,
619 struct mtk_mdp_ctx *ctx = fh_to_ctx(fh); 619 struct mtk_mdp_ctx *ctx = fh_to_ctx(fh);
620 struct mtk_mdp_dev *mdp = ctx->mdp_dev; 620 struct mtk_mdp_dev *mdp = ctx->mdp_dev;
621 621
622 strlcpy(cap->driver, MTK_MDP_MODULE_NAME, sizeof(cap->driver)); 622 strscpy(cap->driver, MTK_MDP_MODULE_NAME, sizeof(cap->driver));
623 strlcpy(cap->card, mdp->pdev->name, sizeof(cap->card)); 623 strscpy(cap->card, mdp->pdev->name, sizeof(cap->card));
624 strlcpy(cap->bus_info, "platform:mt8173", sizeof(cap->bus_info)); 624 strscpy(cap->bus_info, "platform:mt8173", sizeof(cap->bus_info));
625 625
626 return 0; 626 return 0;
627} 627}
diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
index 0c8a8b4c4e1c..ba619647bc10 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
@@ -613,9 +613,9 @@ static int vidioc_vdec_dqbuf(struct file *file, void *priv,
613static int vidioc_vdec_querycap(struct file *file, void *priv, 613static int vidioc_vdec_querycap(struct file *file, void *priv,
614 struct v4l2_capability *cap) 614 struct v4l2_capability *cap)
615{ 615{
616 strlcpy(cap->driver, MTK_VCODEC_DEC_NAME, sizeof(cap->driver)); 616 strscpy(cap->driver, MTK_VCODEC_DEC_NAME, sizeof(cap->driver));
617 strlcpy(cap->bus_info, MTK_PLATFORM_STR, sizeof(cap->bus_info)); 617 strscpy(cap->bus_info, MTK_PLATFORM_STR, sizeof(cap->bus_info));
618 strlcpy(cap->card, MTK_PLATFORM_STR, sizeof(cap->card)); 618 strscpy(cap->card, MTK_PLATFORM_STR, sizeof(cap->card));
619 619
620 return 0; 620 return 0;
621} 621}
diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
index 6ad408514a99..54631ad1c71e 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
@@ -222,9 +222,9 @@ static int vidioc_enum_fmt_vid_out_mplane(struct file *file, void *prov,
222static int vidioc_venc_querycap(struct file *file, void *priv, 222static int vidioc_venc_querycap(struct file *file, void *priv,
223 struct v4l2_capability *cap) 223 struct v4l2_capability *cap)
224{ 224{
225 strlcpy(cap->driver, MTK_VCODEC_ENC_NAME, sizeof(cap->driver)); 225 strscpy(cap->driver, MTK_VCODEC_ENC_NAME, sizeof(cap->driver));
226 strlcpy(cap->bus_info, MTK_PLATFORM_STR, sizeof(cap->bus_info)); 226 strscpy(cap->bus_info, MTK_PLATFORM_STR, sizeof(cap->bus_info));
227 strlcpy(cap->card, MTK_PLATFORM_STR, sizeof(cap->card)); 227 strscpy(cap->card, MTK_PLATFORM_STR, sizeof(cap->card));
228 228
229 return 0; 229 return 0;
230} 230}
diff --git a/drivers/media/platform/mx2_emmaprp.c b/drivers/media/platform/mx2_emmaprp.c
index 64195c4ddeaf..27b078cf98e3 100644
--- a/drivers/media/platform/mx2_emmaprp.c
+++ b/drivers/media/platform/mx2_emmaprp.c
@@ -413,7 +413,7 @@ static int enum_fmt(struct v4l2_fmtdesc *f, u32 type)
413 if (i < NUM_FORMATS) { 413 if (i < NUM_FORMATS) {
414 /* Format found */ 414 /* Format found */
415 fmt = &formats[i]; 415 fmt = &formats[i];
416 strlcpy(f->description, fmt->name, sizeof(f->description) - 1); 416 strscpy(f->description, fmt->name, sizeof(f->description) - 1);
417 f->pixelformat = fmt->fourcc; 417 f->pixelformat = fmt->fourcc;
418 return 0; 418 return 0;
419 } 419 }
diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c
index 5700b7818621..f447ae3bb465 100644
--- a/drivers/media/platform/omap/omap_vout.c
+++ b/drivers/media/platform/omap/omap_vout.c
@@ -1041,8 +1041,8 @@ static int vidioc_querycap(struct file *file, void *fh,
1041{ 1041{
1042 struct omap_vout_device *vout = fh; 1042 struct omap_vout_device *vout = fh;
1043 1043
1044 strlcpy(cap->driver, VOUT_NAME, sizeof(cap->driver)); 1044 strscpy(cap->driver, VOUT_NAME, sizeof(cap->driver));
1045 strlcpy(cap->card, vout->vfd->name, sizeof(cap->card)); 1045 strscpy(cap->card, vout->vfd->name, sizeof(cap->card));
1046 cap->bus_info[0] = '\0'; 1046 cap->bus_info[0] = '\0';
1047 cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_OUTPUT | 1047 cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_OUTPUT |
1048 V4L2_CAP_VIDEO_OUTPUT_OVERLAY; 1048 V4L2_CAP_VIDEO_OUTPUT_OVERLAY;
@@ -1060,8 +1060,8 @@ static int vidioc_enum_fmt_vid_out(struct file *file, void *fh,
1060 return -EINVAL; 1060 return -EINVAL;
1061 1061
1062 fmt->flags = omap_formats[index].flags; 1062 fmt->flags = omap_formats[index].flags;
1063 strlcpy(fmt->description, omap_formats[index].description, 1063 strscpy(fmt->description, omap_formats[index].description,
1064 sizeof(fmt->description)); 1064 sizeof(fmt->description));
1065 fmt->pixelformat = omap_formats[index].pixelformat; 1065 fmt->pixelformat = omap_formats[index].pixelformat;
1066 1066
1067 return 0; 1067 return 0;
@@ -1868,7 +1868,7 @@ static int __init omap_vout_setup_video_data(struct omap_vout_device *vout)
1868 vfd->release = video_device_release; 1868 vfd->release = video_device_release;
1869 vfd->ioctl_ops = &vout_ioctl_ops; 1869 vfd->ioctl_ops = &vout_ioctl_ops;
1870 1870
1871 strlcpy(vfd->name, VOUT_NAME, sizeof(vfd->name)); 1871 strscpy(vfd->name, VOUT_NAME, sizeof(vfd->name));
1872 1872
1873 vfd->fops = &omap_vout_fops; 1873 vfd->fops = &omap_vout_fops;
1874 vfd->v4l2_dev = &vout->vid_dev->v4l2_dev; 1874 vfd->v4l2_dev = &vout->vid_dev->v4l2_dev;
diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
index 842e2235047d..93f032a39470 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -1677,7 +1677,7 @@ static int isp_register_entities(struct isp_device *isp)
1677 int ret; 1677 int ret;
1678 1678
1679 isp->media_dev.dev = isp->dev; 1679 isp->media_dev.dev = isp->dev;
1680 strlcpy(isp->media_dev.model, "TI OMAP3 ISP", 1680 strscpy(isp->media_dev.model, "TI OMAP3 ISP",
1681 sizeof(isp->media_dev.model)); 1681 sizeof(isp->media_dev.model));
1682 isp->media_dev.hw_revision = isp->revision; 1682 isp->media_dev.hw_revision = isp->revision;
1683 isp->media_dev.ops = &isp_media_ops; 1683 isp->media_dev.ops = &isp_media_ops;
diff --git a/drivers/media/platform/omap3isp/ispccdc.c b/drivers/media/platform/omap3isp/ispccdc.c
index 77b73e27a274..14a1c24037c4 100644
--- a/drivers/media/platform/omap3isp/ispccdc.c
+++ b/drivers/media/platform/omap3isp/ispccdc.c
@@ -2641,7 +2641,7 @@ static int ccdc_init_entities(struct isp_ccdc_device *ccdc)
2641 2641
2642 v4l2_subdev_init(sd, &ccdc_v4l2_ops); 2642 v4l2_subdev_init(sd, &ccdc_v4l2_ops);
2643 sd->internal_ops = &ccdc_v4l2_internal_ops; 2643 sd->internal_ops = &ccdc_v4l2_internal_ops;
2644 strlcpy(sd->name, "OMAP3 ISP CCDC", sizeof(sd->name)); 2644 strscpy(sd->name, "OMAP3 ISP CCDC", sizeof(sd->name));
2645 sd->grp_id = 1 << 16; /* group ID for isp subdevs */ 2645 sd->grp_id = 1 << 16; /* group ID for isp subdevs */
2646 v4l2_set_subdevdata(sd, ccdc); 2646 v4l2_set_subdevdata(sd, ccdc);
2647 sd->flags |= V4L2_SUBDEV_FL_HAS_EVENTS | V4L2_SUBDEV_FL_HAS_DEVNODE; 2647 sd->flags |= V4L2_SUBDEV_FL_HAS_EVENTS | V4L2_SUBDEV_FL_HAS_DEVNODE;
diff --git a/drivers/media/platform/omap3isp/ispccp2.c b/drivers/media/platform/omap3isp/ispccp2.c
index e062939d0d05..2dea423ffc0e 100644
--- a/drivers/media/platform/omap3isp/ispccp2.c
+++ b/drivers/media/platform/omap3isp/ispccp2.c
@@ -1070,7 +1070,7 @@ static int ccp2_init_entities(struct isp_ccp2_device *ccp2)
1070 1070
1071 v4l2_subdev_init(sd, &ccp2_sd_ops); 1071 v4l2_subdev_init(sd, &ccp2_sd_ops);
1072 sd->internal_ops = &ccp2_sd_internal_ops; 1072 sd->internal_ops = &ccp2_sd_internal_ops;
1073 strlcpy(sd->name, "OMAP3 ISP CCP2", sizeof(sd->name)); 1073 strscpy(sd->name, "OMAP3 ISP CCP2", sizeof(sd->name));
1074 sd->grp_id = 1 << 16; /* group ID for isp subdevs */ 1074 sd->grp_id = 1 << 16; /* group ID for isp subdevs */
1075 v4l2_set_subdevdata(sd, ccp2); 1075 v4l2_set_subdevdata(sd, ccp2);
1076 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 1076 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
diff --git a/drivers/media/platform/omap3isp/ispcsi2.c b/drivers/media/platform/omap3isp/ispcsi2.c
index a4d3d030e81e..9c180f607bcb 100644
--- a/drivers/media/platform/omap3isp/ispcsi2.c
+++ b/drivers/media/platform/omap3isp/ispcsi2.c
@@ -1234,7 +1234,7 @@ static int csi2_init_entities(struct isp_csi2_device *csi2)
1234 1234
1235 v4l2_subdev_init(sd, &csi2_ops); 1235 v4l2_subdev_init(sd, &csi2_ops);
1236 sd->internal_ops = &csi2_internal_ops; 1236 sd->internal_ops = &csi2_internal_ops;
1237 strlcpy(sd->name, "OMAP3 ISP CSI2a", sizeof(sd->name)); 1237 strscpy(sd->name, "OMAP3 ISP CSI2a", sizeof(sd->name));
1238 1238
1239 sd->grp_id = 1 << 16; /* group ID for isp subdevs */ 1239 sd->grp_id = 1 << 16; /* group ID for isp subdevs */
1240 v4l2_set_subdevdata(sd, csi2); 1240 v4l2_set_subdevdata(sd, csi2);
diff --git a/drivers/media/platform/omap3isp/isppreview.c b/drivers/media/platform/omap3isp/isppreview.c
index 3195f7c8b8b7..6ea6aeafd751 100644
--- a/drivers/media/platform/omap3isp/isppreview.c
+++ b/drivers/media/platform/omap3isp/isppreview.c
@@ -2267,7 +2267,7 @@ static int preview_init_entities(struct isp_prev_device *prev)
2267 2267
2268 v4l2_subdev_init(sd, &preview_v4l2_ops); 2268 v4l2_subdev_init(sd, &preview_v4l2_ops);
2269 sd->internal_ops = &preview_v4l2_internal_ops; 2269 sd->internal_ops = &preview_v4l2_internal_ops;
2270 strlcpy(sd->name, "OMAP3 ISP preview", sizeof(sd->name)); 2270 strscpy(sd->name, "OMAP3 ISP preview", sizeof(sd->name));
2271 sd->grp_id = 1 << 16; /* group ID for isp subdevs */ 2271 sd->grp_id = 1 << 16; /* group ID for isp subdevs */
2272 v4l2_set_subdevdata(sd, prev); 2272 v4l2_set_subdevdata(sd, prev);
2273 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 2273 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
diff --git a/drivers/media/platform/omap3isp/ispresizer.c b/drivers/media/platform/omap3isp/ispresizer.c
index 0b6a87508584..b281cae036b3 100644
--- a/drivers/media/platform/omap3isp/ispresizer.c
+++ b/drivers/media/platform/omap3isp/ispresizer.c
@@ -1723,7 +1723,7 @@ static int resizer_init_entities(struct isp_res_device *res)
1723 1723
1724 v4l2_subdev_init(sd, &resizer_v4l2_ops); 1724 v4l2_subdev_init(sd, &resizer_v4l2_ops);
1725 sd->internal_ops = &resizer_v4l2_internal_ops; 1725 sd->internal_ops = &resizer_v4l2_internal_ops;
1726 strlcpy(sd->name, "OMAP3 ISP resizer", sizeof(sd->name)); 1726 strscpy(sd->name, "OMAP3 ISP resizer", sizeof(sd->name));
1727 sd->grp_id = 1 << 16; /* group ID for isp subdevs */ 1727 sd->grp_id = 1 << 16; /* group ID for isp subdevs */
1728 v4l2_set_subdevdata(sd, res); 1728 v4l2_set_subdevdata(sd, res);
1729 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 1729 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
diff --git a/drivers/media/platform/omap3isp/ispvideo.c b/drivers/media/platform/omap3isp/ispvideo.c
index 9d228eac24ea..5658f6a326f7 100644
--- a/drivers/media/platform/omap3isp/ispvideo.c
+++ b/drivers/media/platform/omap3isp/ispvideo.c
@@ -654,9 +654,9 @@ isp_video_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
654{ 654{
655 struct isp_video *video = video_drvdata(file); 655 struct isp_video *video = video_drvdata(file);
656 656
657 strlcpy(cap->driver, ISP_VIDEO_DRIVER_NAME, sizeof(cap->driver)); 657 strscpy(cap->driver, ISP_VIDEO_DRIVER_NAME, sizeof(cap->driver));
658 strlcpy(cap->card, video->video.name, sizeof(cap->card)); 658 strscpy(cap->card, video->video.name, sizeof(cap->card));
659 strlcpy(cap->bus_info, "media", sizeof(cap->bus_info)); 659 strscpy(cap->bus_info, "media", sizeof(cap->bus_info));
660 660
661 cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT 661 cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT
662 | V4L2_CAP_STREAMING | V4L2_CAP_DEVICE_CAPS; 662 | V4L2_CAP_STREAMING | V4L2_CAP_DEVICE_CAPS;
@@ -1251,7 +1251,7 @@ isp_video_enum_input(struct file *file, void *fh, struct v4l2_input *input)
1251 if (input->index > 0) 1251 if (input->index > 0)
1252 return -EINVAL; 1252 return -EINVAL;
1253 1253
1254 strlcpy(input->name, "camera", sizeof(input->name)); 1254 strscpy(input->name, "camera", sizeof(input->name));
1255 input->type = V4L2_INPUT_TYPE_CAMERA; 1255 input->type = V4L2_INPUT_TYPE_CAMERA;
1256 1256
1257 return 0; 1257 return 0;
diff --git a/drivers/media/platform/pxa_camera.c b/drivers/media/platform/pxa_camera.c
index b6e9e93bde7a..3288d22de2a0 100644
--- a/drivers/media/platform/pxa_camera.c
+++ b/drivers/media/platform/pxa_camera.c
@@ -1994,9 +1994,9 @@ static int pxac_vidioc_s_fmt_vid_cap(struct file *filp, void *priv,
1994static int pxac_vidioc_querycap(struct file *file, void *priv, 1994static int pxac_vidioc_querycap(struct file *file, void *priv,
1995 struct v4l2_capability *cap) 1995 struct v4l2_capability *cap)
1996{ 1996{
1997 strlcpy(cap->bus_info, "platform:pxa-camera", sizeof(cap->bus_info)); 1997 strscpy(cap->bus_info, "platform:pxa-camera", sizeof(cap->bus_info));
1998 strlcpy(cap->driver, PXA_CAM_DRV_NAME, sizeof(cap->driver)); 1998 strscpy(cap->driver, PXA_CAM_DRV_NAME, sizeof(cap->driver));
1999 strlcpy(cap->card, pxa_cam_driver_description, sizeof(cap->card)); 1999 strscpy(cap->card, pxa_cam_driver_description, sizeof(cap->card));
2000 cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING; 2000 cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
2001 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; 2001 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
2002 2002
@@ -2010,7 +2010,7 @@ static int pxac_vidioc_enum_input(struct file *file, void *priv,
2010 return -EINVAL; 2010 return -EINVAL;
2011 2011
2012 i->type = V4L2_INPUT_TYPE_CAMERA; 2012 i->type = V4L2_INPUT_TYPE_CAMERA;
2013 strlcpy(i->name, "Camera", sizeof(i->name)); 2013 strscpy(i->name, "Camera", sizeof(i->name));
2014 2014
2015 return 0; 2015 return 0;
2016} 2016}
diff --git a/drivers/media/platform/qcom/camss/camss-video.c b/drivers/media/platform/qcom/camss/camss-video.c
index c9bb0d023db4..58aebe7114cd 100644
--- a/drivers/media/platform/qcom/camss/camss-video.c
+++ b/drivers/media/platform/qcom/camss/camss-video.c
@@ -521,8 +521,8 @@ static int video_querycap(struct file *file, void *fh,
521{ 521{
522 struct camss_video *video = video_drvdata(file); 522 struct camss_video *video = video_drvdata(file);
523 523
524 strlcpy(cap->driver, "qcom-camss", sizeof(cap->driver)); 524 strscpy(cap->driver, "qcom-camss", sizeof(cap->driver));
525 strlcpy(cap->card, "Qualcomm Camera Subsystem", sizeof(cap->card)); 525 strscpy(cap->card, "Qualcomm Camera Subsystem", sizeof(cap->card));
526 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", 526 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
527 dev_name(video->camss->dev)); 527 dev_name(video->camss->dev));
528 528
@@ -683,7 +683,7 @@ static int video_enum_input(struct file *file, void *fh,
683 if (input->index > 0) 683 if (input->index > 0)
684 return -EINVAL; 684 return -EINVAL;
685 685
686 strlcpy(input->name, "camera", sizeof(input->name)); 686 strscpy(input->name, "camera", sizeof(input->name));
687 input->type = V4L2_INPUT_TYPE_CAMERA; 687 input->type = V4L2_INPUT_TYPE_CAMERA;
688 688
689 return 0; 689 return 0;
@@ -919,7 +919,7 @@ int msm_video_register(struct camss_video *video, struct v4l2_device *v4l2_dev,
919 vdev->vfl_dir = VFL_DIR_RX; 919 vdev->vfl_dir = VFL_DIR_RX;
920 vdev->queue = &video->vb2_q; 920 vdev->queue = &video->vb2_q;
921 vdev->lock = &video->lock; 921 vdev->lock = &video->lock;
922 strlcpy(vdev->name, name, sizeof(vdev->name)); 922 strscpy(vdev->name, name, sizeof(vdev->name));
923 923
924 ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1); 924 ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
925 if (ret < 0) { 925 if (ret < 0) {
diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
index 669615fff6a0..a838a7e560e3 100644
--- a/drivers/media/platform/qcom/camss/camss.c
+++ b/drivers/media/platform/qcom/camss/camss.c
@@ -876,7 +876,7 @@ static int camss_probe(struct platform_device *pdev)
876 return ret; 876 return ret;
877 877
878 camss->media_dev.dev = camss->dev; 878 camss->media_dev.dev = camss->dev;
879 strlcpy(camss->media_dev.model, "Qualcomm Camera Subsystem", 879 strscpy(camss->media_dev.model, "Qualcomm Camera Subsystem",
880 sizeof(camss->media_dev.model)); 880 sizeof(camss->media_dev.model));
881 camss->media_dev.ops = &camss_media_ops; 881 camss->media_dev.ops = &camss_media_ops;
882 media_device_init(&camss->media_dev); 882 media_device_init(&camss->media_dev);
diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index dfbbbf0f746f..991e1583b92a 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -341,9 +341,9 @@ vdec_g_selection(struct file *file, void *fh, struct v4l2_selection *s)
341static int 341static int
342vdec_querycap(struct file *file, void *fh, struct v4l2_capability *cap) 342vdec_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
343{ 343{
344 strlcpy(cap->driver, "qcom-venus", sizeof(cap->driver)); 344 strscpy(cap->driver, "qcom-venus", sizeof(cap->driver));
345 strlcpy(cap->card, "Qualcomm Venus video decoder", sizeof(cap->card)); 345 strscpy(cap->card, "Qualcomm Venus video decoder", sizeof(cap->card));
346 strlcpy(cap->bus_info, "platform:qcom-venus", sizeof(cap->bus_info)); 346 strscpy(cap->bus_info, "platform:qcom-venus", sizeof(cap->bus_info));
347 347
348 return 0; 348 return 0;
349} 349}
@@ -1153,7 +1153,7 @@ static int vdec_probe(struct platform_device *pdev)
1153 if (!vdev) 1153 if (!vdev)
1154 return -ENOMEM; 1154 return -ENOMEM;
1155 1155
1156 strlcpy(vdev->name, "qcom-venus-decoder", sizeof(vdev->name)); 1156 strscpy(vdev->name, "qcom-venus-decoder", sizeof(vdev->name));
1157 vdev->release = video_device_release; 1157 vdev->release = video_device_release;
1158 vdev->fops = &vdec_fops; 1158 vdev->fops = &vdec_fops;
1159 vdev->ioctl_ops = &vdec_ioctl_ops; 1159 vdev->ioctl_ops = &vdec_ioctl_ops;
diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
index 41249d1443fa..ce85962b6adc 100644
--- a/drivers/media/platform/qcom/venus/venc.c
+++ b/drivers/media/platform/qcom/venus/venc.c
@@ -273,9 +273,9 @@ static int venc_v4l2_to_hfi(int id, int value)
273static int 273static int
274venc_querycap(struct file *file, void *fh, struct v4l2_capability *cap) 274venc_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
275{ 275{
276 strlcpy(cap->driver, "qcom-venus", sizeof(cap->driver)); 276 strscpy(cap->driver, "qcom-venus", sizeof(cap->driver));
277 strlcpy(cap->card, "Qualcomm Venus video encoder", sizeof(cap->card)); 277 strscpy(cap->card, "Qualcomm Venus video encoder", sizeof(cap->card));
278 strlcpy(cap->bus_info, "platform:qcom-venus", sizeof(cap->bus_info)); 278 strscpy(cap->bus_info, "platform:qcom-venus", sizeof(cap->bus_info));
279 279
280 return 0; 280 return 0;
281} 281}
@@ -1257,7 +1257,7 @@ static int venc_probe(struct platform_device *pdev)
1257 if (!vdev) 1257 if (!vdev)
1258 return -ENOMEM; 1258 return -ENOMEM;
1259 1259
1260 strlcpy(vdev->name, "qcom-venus-encoder", sizeof(vdev->name)); 1260 strscpy(vdev->name, "qcom-venus-encoder", sizeof(vdev->name));
1261 vdev->release = video_device_release; 1261 vdev->release = video_device_release;
1262 vdev->fops = &venc_fops; 1262 vdev->fops = &venc_fops;
1263 vdev->ioctl_ops = &venc_ioctl_ops; 1263 vdev->ioctl_ops = &venc_ioctl_ops;
diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b/drivers/media/platform/rcar-vin/rcar-core.c
index ce09799976ef..5dd16af3625c 100644
--- a/drivers/media/platform/rcar-vin/rcar-core.c
+++ b/drivers/media/platform/rcar-vin/rcar-core.c
@@ -268,8 +268,8 @@ static int rvin_group_init(struct rvin_group *group, struct rvin_dev *vin)
268 match = of_match_node(vin->dev->driver->of_match_table, 268 match = of_match_node(vin->dev->driver->of_match_table,
269 vin->dev->of_node); 269 vin->dev->of_node);
270 270
271 strlcpy(mdev->driver_name, KBUILD_MODNAME, sizeof(mdev->driver_name)); 271 strscpy(mdev->driver_name, KBUILD_MODNAME, sizeof(mdev->driver_name));
272 strlcpy(mdev->model, match->compatible, sizeof(mdev->model)); 272 strscpy(mdev->model, match->compatible, sizeof(mdev->model));
273 snprintf(mdev->bus_info, sizeof(mdev->bus_info), "platform:%s", 273 snprintf(mdev->bus_info, sizeof(mdev->bus_info), "platform:%s",
274 dev_name(mdev->dev)); 274 dev_name(mdev->dev));
275 275
diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 5a54779cfc27..dc77682b4785 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -238,8 +238,8 @@ static int rvin_querycap(struct file *file, void *priv,
238{ 238{
239 struct rvin_dev *vin = video_drvdata(file); 239 struct rvin_dev *vin = video_drvdata(file);
240 240
241 strlcpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver)); 241 strscpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
242 strlcpy(cap->card, "R_Car_VIN", sizeof(cap->card)); 242 strscpy(cap->card, "R_Car_VIN", sizeof(cap->card));
243 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", 243 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
244 dev_name(vin->dev)); 244 dev_name(vin->dev));
245 return 0; 245 return 0;
@@ -440,7 +440,7 @@ static int rvin_enum_input(struct file *file, void *priv,
440 i->std = vin->vdev.tvnorms; 440 i->std = vin->vdev.tvnorms;
441 } 441 }
442 442
443 strlcpy(i->name, "Camera", sizeof(i->name)); 443 strscpy(i->name, "Camera", sizeof(i->name));
444 444
445 return 0; 445 return 0;
446} 446}
@@ -714,7 +714,7 @@ static int rvin_mc_enum_input(struct file *file, void *priv,
714 return -EINVAL; 714 return -EINVAL;
715 715
716 i->type = V4L2_INPUT_TYPE_CAMERA; 716 i->type = V4L2_INPUT_TYPE_CAMERA;
717 strlcpy(i->name, "Camera", sizeof(i->name)); 717 strscpy(i->name, "Camera", sizeof(i->name));
718 718
719 return 0; 719 return 0;
720} 720}
diff --git a/drivers/media/platform/rcar_drif.c b/drivers/media/platform/rcar_drif.c
index 81413ab52475..9fa108b23cb3 100644
--- a/drivers/media/platform/rcar_drif.c
+++ b/drivers/media/platform/rcar_drif.c
@@ -870,8 +870,8 @@ static int rcar_drif_querycap(struct file *file, void *fh,
870{ 870{
871 struct rcar_drif_sdr *sdr = video_drvdata(file); 871 struct rcar_drif_sdr *sdr = video_drvdata(file);
872 872
873 strlcpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver)); 873 strscpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
874 strlcpy(cap->card, sdr->vdev->name, sizeof(cap->card)); 874 strscpy(cap->card, sdr->vdev->name, sizeof(cap->card));
875 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", 875 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
876 sdr->vdev->name); 876 sdr->vdev->name);
877 877
diff --git a/drivers/media/platform/rcar_fdp1.c b/drivers/media/platform/rcar_fdp1.c
index 2a15b7cca338..6bda1eee9170 100644
--- a/drivers/media/platform/rcar_fdp1.c
+++ b/drivers/media/platform/rcar_fdp1.c
@@ -1359,8 +1359,8 @@ static void device_frame_end(struct fdp1_dev *fdp1,
1359static int fdp1_vidioc_querycap(struct file *file, void *priv, 1359static int fdp1_vidioc_querycap(struct file *file, void *priv,
1360 struct v4l2_capability *cap) 1360 struct v4l2_capability *cap)
1361{ 1361{
1362 strlcpy(cap->driver, DRIVER_NAME, sizeof(cap->driver)); 1362 strscpy(cap->driver, DRIVER_NAME, sizeof(cap->driver));
1363 strlcpy(cap->card, DRIVER_NAME, sizeof(cap->card)); 1363 strscpy(cap->card, DRIVER_NAME, sizeof(cap->card));
1364 snprintf(cap->bus_info, sizeof(cap->bus_info), 1364 snprintf(cap->bus_info, sizeof(cap->bus_info),
1365 "platform:%s", DRIVER_NAME); 1365 "platform:%s", DRIVER_NAME);
1366 return 0; 1366 return 0;
@@ -2339,7 +2339,7 @@ static int fdp1_probe(struct platform_device *pdev)
2339 vfd->lock = &fdp1->dev_mutex; 2339 vfd->lock = &fdp1->dev_mutex;
2340 vfd->v4l2_dev = &fdp1->v4l2_dev; 2340 vfd->v4l2_dev = &fdp1->v4l2_dev;
2341 video_set_drvdata(vfd, fdp1); 2341 video_set_drvdata(vfd, fdp1);
2342 strlcpy(vfd->name, fdp1_videodev.name, sizeof(vfd->name)); 2342 strscpy(vfd->name, fdp1_videodev.name, sizeof(vfd->name));
2343 2343
2344 ret = video_register_device(vfd, VFL_TYPE_GRABBER, 0); 2344 ret = video_register_device(vfd, VFL_TYPE_GRABBER, 0);
2345 if (ret) { 2345 if (ret) {
diff --git a/drivers/media/platform/rcar_jpu.c b/drivers/media/platform/rcar_jpu.c
index e5c882423f57..1dfd2eb65920 100644
--- a/drivers/media/platform/rcar_jpu.c
+++ b/drivers/media/platform/rcar_jpu.c
@@ -664,11 +664,11 @@ static int jpu_querycap(struct file *file, void *priv,
664 struct jpu_ctx *ctx = fh_to_ctx(priv); 664 struct jpu_ctx *ctx = fh_to_ctx(priv);
665 665
666 if (ctx->encoder) 666 if (ctx->encoder)
667 strlcpy(cap->card, DRV_NAME " encoder", sizeof(cap->card)); 667 strscpy(cap->card, DRV_NAME " encoder", sizeof(cap->card));
668 else 668 else
669 strlcpy(cap->card, DRV_NAME " decoder", sizeof(cap->card)); 669 strscpy(cap->card, DRV_NAME " decoder", sizeof(cap->card));
670 670
671 strlcpy(cap->driver, DRV_NAME, sizeof(cap->driver)); 671 strscpy(cap->driver, DRV_NAME, sizeof(cap->driver));
672 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", 672 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
673 dev_name(ctx->jpu->dev)); 673 dev_name(ctx->jpu->dev));
674 cap->device_caps |= V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M_MPLANE; 674 cap->device_caps |= V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M_MPLANE;
@@ -1654,7 +1654,7 @@ static int jpu_probe(struct platform_device *pdev)
1654 for (i = 0; i < JPU_MAX_QUALITY; i++) 1654 for (i = 0; i < JPU_MAX_QUALITY; i++)
1655 jpu_generate_hdr(i, (unsigned char *)jpeg_hdrs[i]); 1655 jpu_generate_hdr(i, (unsigned char *)jpeg_hdrs[i]);
1656 1656
1657 strlcpy(jpu->vfd_encoder.name, DRV_NAME, sizeof(jpu->vfd_encoder.name)); 1657 strscpy(jpu->vfd_encoder.name, DRV_NAME, sizeof(jpu->vfd_encoder.name));
1658 jpu->vfd_encoder.fops = &jpu_fops; 1658 jpu->vfd_encoder.fops = &jpu_fops;
1659 jpu->vfd_encoder.ioctl_ops = &jpu_ioctl_ops; 1659 jpu->vfd_encoder.ioctl_ops = &jpu_ioctl_ops;
1660 jpu->vfd_encoder.minor = -1; 1660 jpu->vfd_encoder.minor = -1;
@@ -1671,7 +1671,7 @@ static int jpu_probe(struct platform_device *pdev)
1671 1671
1672 video_set_drvdata(&jpu->vfd_encoder, jpu); 1672 video_set_drvdata(&jpu->vfd_encoder, jpu);
1673 1673
1674 strlcpy(jpu->vfd_decoder.name, DRV_NAME, sizeof(jpu->vfd_decoder.name)); 1674 strscpy(jpu->vfd_decoder.name, DRV_NAME, sizeof(jpu->vfd_decoder.name));
1675 jpu->vfd_decoder.fops = &jpu_fops; 1675 jpu->vfd_decoder.fops = &jpu_fops;
1676 jpu->vfd_decoder.ioctl_ops = &jpu_ioctl_ops; 1676 jpu->vfd_decoder.ioctl_ops = &jpu_ioctl_ops;
1677 jpu->vfd_decoder.minor = -1; 1677 jpu->vfd_decoder.minor = -1;
diff --git a/drivers/media/platform/renesas-ceu.c b/drivers/media/platform/renesas-ceu.c
index ad782901cd7a..b7ae820a2ef6 100644
--- a/drivers/media/platform/renesas-ceu.c
+++ b/drivers/media/platform/renesas-ceu.c
@@ -1137,8 +1137,8 @@ static int ceu_querycap(struct file *file, void *priv,
1137{ 1137{
1138 struct ceu_device *ceudev = video_drvdata(file); 1138 struct ceu_device *ceudev = video_drvdata(file);
1139 1139
1140 strlcpy(cap->card, "Renesas CEU", sizeof(cap->card)); 1140 strscpy(cap->card, "Renesas CEU", sizeof(cap->card));
1141 strlcpy(cap->driver, DRIVER_NAME, sizeof(cap->driver)); 1141 strscpy(cap->driver, DRIVER_NAME, sizeof(cap->driver));
1142 snprintf(cap->bus_info, sizeof(cap->bus_info), 1142 snprintf(cap->bus_info, sizeof(cap->bus_info),
1143 "platform:renesas-ceu-%s", dev_name(ceudev->dev)); 1143 "platform:renesas-ceu-%s", dev_name(ceudev->dev));
1144 1144
@@ -1440,7 +1440,7 @@ static int ceu_notify_complete(struct v4l2_async_notifier *notifier)
1440 return ret; 1440 return ret;
1441 1441
1442 /* Register the video device. */ 1442 /* Register the video device. */
1443 strlcpy(vdev->name, DRIVER_NAME, sizeof(vdev->name)); 1443 strscpy(vdev->name, DRIVER_NAME, sizeof(vdev->name));
1444 vdev->v4l2_dev = v4l2_dev; 1444 vdev->v4l2_dev = v4l2_dev;
1445 vdev->lock = &ceudev->mlock; 1445 vdev->lock = &ceudev->mlock;
1446 vdev->queue = &ceudev->vb2_vq; 1446 vdev->queue = &ceudev->vb2_vq;
diff --git a/drivers/media/platform/rockchip/rga/rga.c b/drivers/media/platform/rockchip/rga/rga.c
index ab5a6f95044a..9cc9db083870 100644
--- a/drivers/media/platform/rockchip/rga/rga.c
+++ b/drivers/media/platform/rockchip/rga/rga.c
@@ -447,9 +447,9 @@ static const struct v4l2_file_operations rga_fops = {
447static int 447static int
448vidioc_querycap(struct file *file, void *priv, struct v4l2_capability *cap) 448vidioc_querycap(struct file *file, void *priv, struct v4l2_capability *cap)
449{ 449{
450 strlcpy(cap->driver, RGA_NAME, sizeof(cap->driver)); 450 strscpy(cap->driver, RGA_NAME, sizeof(cap->driver));
451 strlcpy(cap->card, "rockchip-rga", sizeof(cap->card)); 451 strscpy(cap->card, "rockchip-rga", sizeof(cap->card));
452 strlcpy(cap->bus_info, "platform:rga", sizeof(cap->bus_info)); 452 strscpy(cap->bus_info, "platform:rga", sizeof(cap->bus_info));
453 453
454 return 0; 454 return 0;
455} 455}
diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c
index c02dce8b4c6c..23b008d1a47b 100644
--- a/drivers/media/platform/s3c-camif/camif-capture.c
+++ b/drivers/media/platform/s3c-camif/camif-capture.c
@@ -640,8 +640,8 @@ static int s3c_camif_vidioc_querycap(struct file *file, void *priv,
640{ 640{
641 struct camif_vp *vp = video_drvdata(file); 641 struct camif_vp *vp = video_drvdata(file);
642 642
643 strlcpy(cap->driver, S3C_CAMIF_DRIVER_NAME, sizeof(cap->driver)); 643 strscpy(cap->driver, S3C_CAMIF_DRIVER_NAME, sizeof(cap->driver));
644 strlcpy(cap->card, S3C_CAMIF_DRIVER_NAME, sizeof(cap->card)); 644 strscpy(cap->card, S3C_CAMIF_DRIVER_NAME, sizeof(cap->card));
645 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s.%d", 645 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s.%d",
646 dev_name(vp->camif->dev), vp->id); 646 dev_name(vp->camif->dev), vp->id);
647 647
@@ -661,7 +661,7 @@ static int s3c_camif_vidioc_enum_input(struct file *file, void *priv,
661 return -EINVAL; 661 return -EINVAL;
662 662
663 input->type = V4L2_INPUT_TYPE_CAMERA; 663 input->type = V4L2_INPUT_TYPE_CAMERA;
664 strlcpy(input->name, sensor->name, sizeof(input->name)); 664 strscpy(input->name, sensor->name, sizeof(input->name));
665 return 0; 665 return 0;
666} 666}
667 667
@@ -688,7 +688,7 @@ static int s3c_camif_vidioc_enum_fmt(struct file *file, void *priv,
688 if (!fmt) 688 if (!fmt)
689 return -EINVAL; 689 return -EINVAL;
690 690
691 strlcpy(f->description, fmt->name, sizeof(f->description)); 691 strscpy(f->description, fmt->name, sizeof(f->description));
692 f->pixelformat = fmt->fourcc; 692 f->pixelformat = fmt->fourcc;
693 693
694 pr_debug("fmt(%d): %s\n", f->index, f->description); 694 pr_debug("fmt(%d): %s\n", f->index, f->description);
@@ -1555,7 +1555,7 @@ int s3c_camif_create_subdev(struct camif_dev *camif)
1555 1555
1556 v4l2_subdev_init(sd, &s3c_camif_subdev_ops); 1556 v4l2_subdev_init(sd, &s3c_camif_subdev_ops);
1557 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 1557 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
1558 strlcpy(sd->name, "S3C-CAMIF", sizeof(sd->name)); 1558 strscpy(sd->name, "S3C-CAMIF", sizeof(sd->name));
1559 1559
1560 camif->pads[CAMIF_SD_PAD_SINK].flags = MEDIA_PAD_FL_SINK; 1560 camif->pads[CAMIF_SD_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
1561 camif->pads[CAMIF_SD_PAD_SOURCE_C].flags = MEDIA_PAD_FL_SOURCE; 1561 camif->pads[CAMIF_SD_PAD_SOURCE_C].flags = MEDIA_PAD_FL_SOURCE;
diff --git a/drivers/media/platform/s3c-camif/camif-core.c b/drivers/media/platform/s3c-camif/camif-core.c
index 79bc0ef6bb41..31759f16458e 100644
--- a/drivers/media/platform/s3c-camif/camif-core.c
+++ b/drivers/media/platform/s3c-camif/camif-core.c
@@ -316,12 +316,12 @@ static int camif_media_dev_init(struct camif_dev *camif)
316 memset(md, 0, sizeof(*md)); 316 memset(md, 0, sizeof(*md));
317 snprintf(md->model, sizeof(md->model), "SAMSUNG S3C%s CAMIF", 317 snprintf(md->model, sizeof(md->model), "SAMSUNG S3C%s CAMIF",
318 ip_rev == S3C6410_CAMIF_IP_REV ? "6410" : "244X"); 318 ip_rev == S3C6410_CAMIF_IP_REV ? "6410" : "244X");
319 strlcpy(md->bus_info, "platform", sizeof(md->bus_info)); 319 strscpy(md->bus_info, "platform", sizeof(md->bus_info));
320 md->hw_revision = ip_rev; 320 md->hw_revision = ip_rev;
321 321
322 md->dev = camif->dev; 322 md->dev = camif->dev;
323 323
324 strlcpy(v4l2_dev->name, "s3c-camif", sizeof(v4l2_dev->name)); 324 strscpy(v4l2_dev->name, "s3c-camif", sizeof(v4l2_dev->name));
325 v4l2_dev->mdev = md; 325 v4l2_dev->mdev = md;
326 326
327 media_device_init(md); 327 media_device_init(md);
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 04fd2e0493c0..3f9000b70385 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -1276,14 +1276,14 @@ static int s5p_jpeg_querycap(struct file *file, void *priv,
1276 struct s5p_jpeg_ctx *ctx = fh_to_ctx(priv); 1276 struct s5p_jpeg_ctx *ctx = fh_to_ctx(priv);
1277 1277
1278 if (ctx->mode == S5P_JPEG_ENCODE) { 1278 if (ctx->mode == S5P_JPEG_ENCODE) {
1279 strlcpy(cap->driver, S5P_JPEG_M2M_NAME, 1279 strscpy(cap->driver, S5P_JPEG_M2M_NAME,
1280 sizeof(cap->driver)); 1280 sizeof(cap->driver));
1281 strlcpy(cap->card, S5P_JPEG_M2M_NAME " encoder", 1281 strscpy(cap->card, S5P_JPEG_M2M_NAME " encoder",
1282 sizeof(cap->card)); 1282 sizeof(cap->card));
1283 } else { 1283 } else {
1284 strlcpy(cap->driver, S5P_JPEG_M2M_NAME, 1284 strscpy(cap->driver, S5P_JPEG_M2M_NAME,
1285 sizeof(cap->driver)); 1285 sizeof(cap->driver));
1286 strlcpy(cap->card, S5P_JPEG_M2M_NAME " decoder", 1286 strscpy(cap->card, S5P_JPEG_M2M_NAME " decoder",
1287 sizeof(cap->card)); 1287 sizeof(cap->card));
1288 } 1288 }
1289 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", 1289 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
@@ -1314,7 +1314,7 @@ static int enum_fmt(struct s5p_jpeg_fmt *sjpeg_formats, int n,
1314 if (i >= n) 1314 if (i >= n)
1315 return -EINVAL; 1315 return -EINVAL;
1316 1316
1317 strlcpy(f->description, sjpeg_formats[i].name, sizeof(f->description)); 1317 strscpy(f->description, sjpeg_formats[i].name, sizeof(f->description));
1318 f->pixelformat = sjpeg_formats[i].fourcc; 1318 f->pixelformat = sjpeg_formats[i].fourcc;
1319 1319
1320 return 0; 1320 return 0;
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
index 6a3cc4f86c5d..670ca869babb 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
@@ -271,8 +271,8 @@ static int vidioc_querycap(struct file *file, void *priv,
271{ 271{
272 struct s5p_mfc_dev *dev = video_drvdata(file); 272 struct s5p_mfc_dev *dev = video_drvdata(file);
273 273
274 strlcpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver)); 274 strscpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver));
275 strlcpy(cap->card, dev->vfd_dec->name, sizeof(cap->card)); 275 strscpy(cap->card, dev->vfd_dec->name, sizeof(cap->card));
276 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", 276 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
277 dev_name(&dev->plat_dev->dev)); 277 dev_name(&dev->plat_dev->dev));
278 /* 278 /*
@@ -308,7 +308,7 @@ static int vidioc_enum_fmt(struct file *file, struct v4l2_fmtdesc *f,
308 if (i == ARRAY_SIZE(formats)) 308 if (i == ARRAY_SIZE(formats))
309 return -EINVAL; 309 return -EINVAL;
310 fmt = &formats[i]; 310 fmt = &formats[i];
311 strlcpy(f->description, fmt->name, sizeof(f->description)); 311 strscpy(f->description, fmt->name, sizeof(f->description));
312 f->pixelformat = fmt->fourcc; 312 f->pixelformat = fmt->fourcc;
313 return 0; 313 return 0;
314} 314}
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
index 3ad4f5073002..7037d48bdc2c 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
@@ -1313,8 +1313,8 @@ static int vidioc_querycap(struct file *file, void *priv,
1313{ 1313{
1314 struct s5p_mfc_dev *dev = video_drvdata(file); 1314 struct s5p_mfc_dev *dev = video_drvdata(file);
1315 1315
1316 strlcpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver)); 1316 strscpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver));
1317 strlcpy(cap->card, dev->vfd_enc->name, sizeof(cap->card)); 1317 strscpy(cap->card, dev->vfd_enc->name, sizeof(cap->card));
1318 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", 1318 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
1319 dev_name(&dev->plat_dev->dev)); 1319 dev_name(&dev->plat_dev->dev));
1320 /* 1320 /*
@@ -1344,7 +1344,7 @@ static int vidioc_enum_fmt(struct file *file, struct v4l2_fmtdesc *f,
1344 1344
1345 if (j == f->index) { 1345 if (j == f->index) {
1346 fmt = &formats[i]; 1346 fmt = &formats[i];
1347 strlcpy(f->description, fmt->name, 1347 strscpy(f->description, fmt->name,
1348 sizeof(f->description)); 1348 sizeof(f->description));
1349 f->pixelformat = fmt->fourcc; 1349 f->pixelformat = fmt->fourcc;
1350 return 0; 1350 return 0;
diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c
index 1d274c64de09..09ae64a0004c 100644
--- a/drivers/media/platform/sh_veu.c
+++ b/drivers/media/platform/sh_veu.c
@@ -345,9 +345,9 @@ static int sh_veu_context_init(struct sh_veu_dev *veu)
345static int sh_veu_querycap(struct file *file, void *priv, 345static int sh_veu_querycap(struct file *file, void *priv,
346 struct v4l2_capability *cap) 346 struct v4l2_capability *cap)
347{ 347{
348 strlcpy(cap->driver, "sh-veu", sizeof(cap->driver)); 348 strscpy(cap->driver, "sh-veu", sizeof(cap->driver));
349 strlcpy(cap->card, "sh-mobile VEU", sizeof(cap->card)); 349 strscpy(cap->card, "sh-mobile VEU", sizeof(cap->card));
350 strlcpy(cap->bus_info, "platform:sh-veu", sizeof(cap->bus_info)); 350 strscpy(cap->bus_info, "platform:sh-veu", sizeof(cap->bus_info));
351 cap->device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING; 351 cap->device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
352 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; 352 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
353 353
@@ -359,7 +359,8 @@ static int sh_veu_enum_fmt(struct v4l2_fmtdesc *f, const int *fmt, int fmt_num)
359 if (f->index >= fmt_num) 359 if (f->index >= fmt_num)
360 return -EINVAL; 360 return -EINVAL;
361 361
362 strlcpy(f->description, sh_veu_fmt[fmt[f->index]].name, sizeof(f->description)); 362 strscpy(f->description, sh_veu_fmt[fmt[f->index]].name,
363 sizeof(f->description));
363 f->pixelformat = sh_veu_fmt[fmt[f->index]].fourcc; 364 f->pixelformat = sh_veu_fmt[fmt[f->index]].fourcc;
364 return 0; 365 return 0;
365} 366}
diff --git a/drivers/media/platform/sh_vou.c b/drivers/media/platform/sh_vou.c
index 6135e13e24d4..cee58b125548 100644
--- a/drivers/media/platform/sh_vou.c
+++ b/drivers/media/platform/sh_vou.c
@@ -378,9 +378,9 @@ static int sh_vou_querycap(struct file *file, void *priv,
378 378
379 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); 379 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__);
380 380
381 strlcpy(cap->card, "SuperH VOU", sizeof(cap->card)); 381 strscpy(cap->card, "SuperH VOU", sizeof(cap->card));
382 strlcpy(cap->driver, "sh-vou", sizeof(cap->driver)); 382 strscpy(cap->driver, "sh-vou", sizeof(cap->driver));
383 strlcpy(cap->bus_info, "platform:sh-vou", sizeof(cap->bus_info)); 383 strscpy(cap->bus_info, "platform:sh-vou", sizeof(cap->bus_info));
384 cap->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_READWRITE | 384 cap->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_READWRITE |
385 V4L2_CAP_STREAMING; 385 V4L2_CAP_STREAMING;
386 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; 386 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
@@ -399,7 +399,7 @@ static int sh_vou_enum_fmt_vid_out(struct file *file, void *priv,
399 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); 399 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__);
400 400
401 fmt->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; 401 fmt->type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
402 strlcpy(fmt->description, vou_fmt[fmt->index].desc, 402 strscpy(fmt->description, vou_fmt[fmt->index].desc,
403 sizeof(fmt->description)); 403 sizeof(fmt->description));
404 fmt->pixelformat = vou_fmt[fmt->index].pfmt; 404 fmt->pixelformat = vou_fmt[fmt->index].pfmt;
405 405
@@ -790,7 +790,7 @@ static int sh_vou_enum_output(struct file *file, void *fh,
790 790
791 if (a->index) 791 if (a->index)
792 return -EINVAL; 792 return -EINVAL;
793 strlcpy(a->name, "Video Out", sizeof(a->name)); 793 strscpy(a->name, "Video Out", sizeof(a->name));
794 a->type = V4L2_OUTPUT_TYPE_ANALOG; 794 a->type = V4L2_OUTPUT_TYPE_ANALOG;
795 a->std = vou_dev->vdev.tvnorms; 795 a->std = vou_dev->vdev.tvnorms;
796 return 0; 796 return 0;
diff --git a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
index 0a2c0daaffef..6803f744e307 100644
--- a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
+++ b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
@@ -1564,9 +1564,9 @@ static __poll_t sh_mobile_ceu_poll(struct file *file, poll_table *pt)
1564static int sh_mobile_ceu_querycap(struct soc_camera_host *ici, 1564static int sh_mobile_ceu_querycap(struct soc_camera_host *ici,
1565 struct v4l2_capability *cap) 1565 struct v4l2_capability *cap)
1566{ 1566{
1567 strlcpy(cap->card, "SuperH_Mobile_CEU", sizeof(cap->card)); 1567 strscpy(cap->card, "SuperH_Mobile_CEU", sizeof(cap->card));
1568 strlcpy(cap->driver, "sh_mobile_ceu", sizeof(cap->driver)); 1568 strscpy(cap->driver, "sh_mobile_ceu", sizeof(cap->driver));
1569 strlcpy(cap->bus_info, "platform:sh_mobile_ceu", sizeof(cap->bus_info)); 1569 strscpy(cap->bus_info, "platform:sh_mobile_ceu", sizeof(cap->bus_info));
1570 cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING; 1570 cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
1571 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; 1571 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
1572 1572
diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
index 66d613629167..1a00b1fa7990 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -874,7 +874,7 @@ static int soc_camera_enum_fmt_vid_cap(struct file *file, void *priv,
874 format = icd->user_formats[f->index].host_fmt; 874 format = icd->user_formats[f->index].host_fmt;
875 875
876 if (format->name) 876 if (format->name)
877 strlcpy(f->description, format->name, sizeof(f->description)); 877 strscpy(f->description, format->name, sizeof(f->description));
878 f->pixelformat = format->fourcc; 878 f->pixelformat = format->fourcc;
879 return 0; 879 return 0;
880} 880}
@@ -910,7 +910,7 @@ static int soc_camera_querycap(struct file *file, void *priv,
910 910
911 WARN_ON(priv != file->private_data); 911 WARN_ON(priv != file->private_data);
912 912
913 strlcpy(cap->driver, ici->drv_name, sizeof(cap->driver)); 913 strscpy(cap->driver, ici->drv_name, sizeof(cap->driver));
914 return ici->ops->querycap(ici, cap); 914 return ici->ops->querycap(ici, cap);
915} 915}
916 916
@@ -2026,7 +2026,7 @@ static int video_dev_create(struct soc_camera_device *icd)
2026 if (!vdev) 2026 if (!vdev)
2027 return -ENOMEM; 2027 return -ENOMEM;
2028 2028
2029 strlcpy(vdev->name, ici->drv_name, sizeof(vdev->name)); 2029 strscpy(vdev->name, ici->drv_name, sizeof(vdev->name));
2030 2030
2031 vdev->v4l2_dev = &ici->v4l2_dev; 2031 vdev->v4l2_dev = &ici->v4l2_dev;
2032 vdev->fops = &soc_camera_fops; 2032 vdev->fops = &soc_camera_fops;
diff --git a/drivers/media/platform/soc_camera/soc_camera_platform.c b/drivers/media/platform/soc_camera/soc_camera_platform.c
index 6745a6e3f464..79fbe1fea95f 100644
--- a/drivers/media/platform/soc_camera/soc_camera_platform.c
+++ b/drivers/media/platform/soc_camera/soc_camera_platform.c
@@ -156,7 +156,7 @@ static int soc_camera_platform_probe(struct platform_device *pdev)
156 156
157 v4l2_subdev_init(&priv->subdev, &platform_subdev_ops); 157 v4l2_subdev_init(&priv->subdev, &platform_subdev_ops);
158 v4l2_set_subdevdata(&priv->subdev, p); 158 v4l2_set_subdevdata(&priv->subdev, p);
159 strlcpy(priv->subdev.name, dev_name(&pdev->dev), 159 strscpy(priv->subdev.name, dev_name(&pdev->dev),
160 sizeof(priv->subdev.name)); 160 sizeof(priv->subdev.name));
161 161
162 return v4l2_device_register_subdev(&ici->v4l2_dev, &priv->subdev); 162 return v4l2_device_register_subdev(&ici->v4l2_dev, &priv->subdev);
diff --git a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
index 66b64096f5de..79f7db1a9d18 100644
--- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
+++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
@@ -688,8 +688,8 @@ static int bdisp_querycap(struct file *file, void *fh,
688 struct bdisp_ctx *ctx = fh_to_ctx(fh); 688 struct bdisp_ctx *ctx = fh_to_ctx(fh);
689 struct bdisp_dev *bdisp = ctx->bdisp_dev; 689 struct bdisp_dev *bdisp = ctx->bdisp_dev;
690 690
691 strlcpy(cap->driver, bdisp->pdev->name, sizeof(cap->driver)); 691 strscpy(cap->driver, bdisp->pdev->name, sizeof(cap->driver));
692 strlcpy(cap->card, bdisp->pdev->name, sizeof(cap->card)); 692 strscpy(cap->card, bdisp->pdev->name, sizeof(cap->card));
693 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s%d", 693 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s%d",
694 BDISP_NAME, bdisp->id); 694 BDISP_NAME, bdisp->id);
695 695
diff --git a/drivers/media/platform/sti/delta/delta-v4l2.c b/drivers/media/platform/sti/delta/delta-v4l2.c
index 0b42acd4e3a6..91369fb3ffaa 100644
--- a/drivers/media/platform/sti/delta/delta-v4l2.c
+++ b/drivers/media/platform/sti/delta/delta-v4l2.c
@@ -385,8 +385,8 @@ static int delta_querycap(struct file *file, void *priv,
385 struct delta_ctx *ctx = to_ctx(file->private_data); 385 struct delta_ctx *ctx = to_ctx(file->private_data);
386 struct delta_dev *delta = ctx->dev; 386 struct delta_dev *delta = ctx->dev;
387 387
388 strlcpy(cap->driver, DELTA_NAME, sizeof(cap->driver)); 388 strscpy(cap->driver, DELTA_NAME, sizeof(cap->driver));
389 strlcpy(cap->card, delta->vdev->name, sizeof(cap->card)); 389 strscpy(cap->card, delta->vdev->name, sizeof(cap->card));
390 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", 390 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
391 delta->pdev->name); 391 delta->pdev->name);
392 392
diff --git a/drivers/media/platform/sti/hva/hva-v4l2.c b/drivers/media/platform/sti/hva/hva-v4l2.c
index 5a807c7c5e79..c42623dccfd6 100644
--- a/drivers/media/platform/sti/hva/hva-v4l2.c
+++ b/drivers/media/platform/sti/hva/hva-v4l2.c
@@ -257,8 +257,8 @@ static int hva_querycap(struct file *file, void *priv,
257 struct hva_ctx *ctx = fh_to_ctx(file->private_data); 257 struct hva_ctx *ctx = fh_to_ctx(file->private_data);
258 struct hva_dev *hva = ctx_to_hdev(ctx); 258 struct hva_dev *hva = ctx_to_hdev(ctx);
259 259
260 strlcpy(cap->driver, HVA_NAME, sizeof(cap->driver)); 260 strscpy(cap->driver, HVA_NAME, sizeof(cap->driver));
261 strlcpy(cap->card, hva->vdev->name, sizeof(cap->card)); 261 strscpy(cap->card, hva->vdev->name, sizeof(cap->card));
262 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", 262 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
263 hva->pdev->name); 263 hva->pdev->name);
264 264
diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c
index 721564176d8c..ba3e2eee1d92 100644
--- a/drivers/media/platform/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/stm32/stm32-dcmi.c
@@ -1147,10 +1147,10 @@ static int dcmi_s_selection(struct file *file, void *priv,
1147static int dcmi_querycap(struct file *file, void *priv, 1147static int dcmi_querycap(struct file *file, void *priv,
1148 struct v4l2_capability *cap) 1148 struct v4l2_capability *cap)
1149{ 1149{
1150 strlcpy(cap->driver, DRV_NAME, sizeof(cap->driver)); 1150 strscpy(cap->driver, DRV_NAME, sizeof(cap->driver));
1151 strlcpy(cap->card, "STM32 Camera Memory Interface", 1151 strscpy(cap->card, "STM32 Camera Memory Interface",
1152 sizeof(cap->card)); 1152 sizeof(cap->card));
1153 strlcpy(cap->bus_info, "platform:dcmi", sizeof(cap->bus_info)); 1153 strscpy(cap->bus_info, "platform:dcmi", sizeof(cap->bus_info));
1154 return 0; 1154 return 0;
1155} 1155}
1156 1156
@@ -1161,7 +1161,7 @@ static int dcmi_enum_input(struct file *file, void *priv,
1161 return -EINVAL; 1161 return -EINVAL;
1162 1162
1163 i->type = V4L2_INPUT_TYPE_CAMERA; 1163 i->type = V4L2_INPUT_TYPE_CAMERA;
1164 strlcpy(i->name, "Camera", sizeof(i->name)); 1164 strscpy(i->name, "Camera", sizeof(i->name));
1165 return 0; 1165 return 0;
1166} 1166}
1167 1167
@@ -1736,7 +1736,7 @@ static int dcmi_probe(struct platform_device *pdev)
1736 dcmi->vdev->fops = &dcmi_fops; 1736 dcmi->vdev->fops = &dcmi_fops;
1737 dcmi->vdev->v4l2_dev = &dcmi->v4l2_dev; 1737 dcmi->vdev->v4l2_dev = &dcmi->v4l2_dev;
1738 dcmi->vdev->queue = &dcmi->queue; 1738 dcmi->vdev->queue = &dcmi->queue;
1739 strlcpy(dcmi->vdev->name, KBUILD_MODNAME, sizeof(dcmi->vdev->name)); 1739 strscpy(dcmi->vdev->name, KBUILD_MODNAME, sizeof(dcmi->vdev->name));
1740 dcmi->vdev->release = video_device_release; 1740 dcmi->vdev->release = video_device_release;
1741 dcmi->vdev->ioctl_ops = &dcmi_ioctl_ops; 1741 dcmi->vdev->ioctl_ops = &dcmi_ioctl_ops;
1742 dcmi->vdev->lock = &dcmi->lock; 1742 dcmi->vdev->lock = &dcmi->lock;
diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c
index d1febe5baa6d..c9f54fbcdfe4 100644
--- a/drivers/media/platform/ti-vpe/cal.c
+++ b/drivers/media/platform/ti-vpe/cal.c
@@ -912,8 +912,8 @@ static int cal_querycap(struct file *file, void *priv,
912{ 912{
913 struct cal_ctx *ctx = video_drvdata(file); 913 struct cal_ctx *ctx = video_drvdata(file);
914 914
915 strlcpy(cap->driver, CAL_MODULE_NAME, sizeof(cap->driver)); 915 strscpy(cap->driver, CAL_MODULE_NAME, sizeof(cap->driver));
916 strlcpy(cap->card, CAL_MODULE_NAME, sizeof(cap->card)); 916 strscpy(cap->card, CAL_MODULE_NAME, sizeof(cap->card));
917 917
918 snprintf(cap->bus_info, sizeof(cap->bus_info), 918 snprintf(cap->bus_info, sizeof(cap->bus_info),
919 "platform:%s", ctx->v4l2_dev.name); 919 "platform:%s", ctx->v4l2_dev.name);
@@ -1818,7 +1818,7 @@ static int cal_probe(struct platform_device *pdev)
1818 return -ENOMEM; 1818 return -ENOMEM;
1819 1819
1820 /* set pseudo v4l2 device name so we can use v4l2_printk */ 1820 /* set pseudo v4l2 device name so we can use v4l2_printk */
1821 strlcpy(dev->v4l2_dev.name, CAL_MODULE_NAME, 1821 strscpy(dev->v4l2_dev.name, CAL_MODULE_NAME,
1822 sizeof(dev->v4l2_dev.name)); 1822 sizeof(dev->v4l2_dev.name));
1823 1823
1824 /* save pdev pointer */ 1824 /* save pdev pointer */
diff --git a/drivers/media/platform/via-camera.c b/drivers/media/platform/via-camera.c
index c8bb82fe0b9d..554870e48750 100644
--- a/drivers/media/platform/via-camera.c
+++ b/drivers/media/platform/via-camera.c
@@ -860,8 +860,8 @@ static int viacam_enum_fmt_vid_cap(struct file *filp, void *priv,
860{ 860{
861 if (fmt->index >= N_VIA_FMTS) 861 if (fmt->index >= N_VIA_FMTS)
862 return -EINVAL; 862 return -EINVAL;
863 strlcpy(fmt->description, via_formats[fmt->index].desc, 863 strscpy(fmt->description, via_formats[fmt->index].desc,
864 sizeof(fmt->description)); 864 sizeof(fmt->description));
865 fmt->pixelformat = via_formats[fmt->index].pixelformat; 865 fmt->pixelformat = via_formats[fmt->index].pixelformat;
866 return 0; 866 return 0;
867} 867}
diff --git a/drivers/media/platform/vicodec/vicodec-core.c b/drivers/media/platform/vicodec/vicodec-core.c
index 11385d44e500..a044475d0469 100644
--- a/drivers/media/platform/vicodec/vicodec-core.c
+++ b/drivers/media/platform/vicodec/vicodec-core.c
@@ -1287,7 +1287,7 @@ static int vicodec_probe(struct platform_device *pdev)
1287 1287
1288#ifdef CONFIG_MEDIA_CONTROLLER 1288#ifdef CONFIG_MEDIA_CONTROLLER
1289 dev->mdev.dev = &pdev->dev; 1289 dev->mdev.dev = &pdev->dev;
1290 strlcpy(dev->mdev.model, "vicodec", sizeof(dev->mdev.model)); 1290 strscpy(dev->mdev.model, "vicodec", sizeof(dev->mdev.model));
1291 media_device_init(&dev->mdev); 1291 media_device_init(&dev->mdev);
1292 dev->v4l2_dev.mdev = &dev->mdev; 1292 dev->v4l2_dev.mdev = &dev->mdev;
1293#endif 1293#endif
@@ -1315,7 +1315,7 @@ static int vicodec_probe(struct platform_device *pdev)
1315 vfd = &dev->enc_vfd; 1315 vfd = &dev->enc_vfd;
1316 vfd->lock = &dev->enc_mutex; 1316 vfd->lock = &dev->enc_mutex;
1317 vfd->v4l2_dev = &dev->v4l2_dev; 1317 vfd->v4l2_dev = &dev->v4l2_dev;
1318 strlcpy(vfd->name, "vicodec-enc", sizeof(vfd->name)); 1318 strscpy(vfd->name, "vicodec-enc", sizeof(vfd->name));
1319 v4l2_disable_ioctl(vfd, VIDIOC_DECODER_CMD); 1319 v4l2_disable_ioctl(vfd, VIDIOC_DECODER_CMD);
1320 v4l2_disable_ioctl(vfd, VIDIOC_TRY_DECODER_CMD); 1320 v4l2_disable_ioctl(vfd, VIDIOC_TRY_DECODER_CMD);
1321 video_set_drvdata(vfd, dev); 1321 video_set_drvdata(vfd, dev);
@@ -1332,7 +1332,7 @@ static int vicodec_probe(struct platform_device *pdev)
1332 vfd = &dev->dec_vfd; 1332 vfd = &dev->dec_vfd;
1333 vfd->lock = &dev->dec_mutex; 1333 vfd->lock = &dev->dec_mutex;
1334 vfd->v4l2_dev = &dev->v4l2_dev; 1334 vfd->v4l2_dev = &dev->v4l2_dev;
1335 strlcpy(vfd->name, "vicodec-dec", sizeof(vfd->name)); 1335 strscpy(vfd->name, "vicodec-dec", sizeof(vfd->name));
1336 v4l2_disable_ioctl(vfd, VIDIOC_ENCODER_CMD); 1336 v4l2_disable_ioctl(vfd, VIDIOC_ENCODER_CMD);
1337 v4l2_disable_ioctl(vfd, VIDIOC_TRY_ENCODER_CMD); 1337 v4l2_disable_ioctl(vfd, VIDIOC_TRY_ENCODER_CMD);
1338 video_set_drvdata(vfd, dev); 1338 video_set_drvdata(vfd, dev);
diff --git a/drivers/media/platform/vim2m.c b/drivers/media/platform/vim2m.c
index 462099a141e4..60c522ee2e03 100644
--- a/drivers/media/platform/vim2m.c
+++ b/drivers/media/platform/vim2m.c
@@ -1038,7 +1038,7 @@ static int vim2m_probe(struct platform_device *pdev)
1038 1038
1039#ifdef CONFIG_MEDIA_CONTROLLER 1039#ifdef CONFIG_MEDIA_CONTROLLER
1040 dev->mdev.dev = &pdev->dev; 1040 dev->mdev.dev = &pdev->dev;
1041 strlcpy(dev->mdev.model, "vim2m", sizeof(dev->mdev.model)); 1041 strscpy(dev->mdev.model, "vim2m", sizeof(dev->mdev.model));
1042 media_device_init(&dev->mdev); 1042 media_device_init(&dev->mdev);
1043 dev->v4l2_dev.mdev = &dev->mdev; 1043 dev->v4l2_dev.mdev = &dev->mdev;
1044 1044
diff --git a/drivers/media/platform/vimc/vimc-capture.c b/drivers/media/platform/vimc/vimc-capture.c
index ec68feaac378..3f7e9ed56633 100644
--- a/drivers/media/platform/vimc/vimc-capture.c
+++ b/drivers/media/platform/vimc/vimc-capture.c
@@ -71,8 +71,8 @@ static int vimc_cap_querycap(struct file *file, void *priv,
71{ 71{
72 struct vimc_cap_device *vcap = video_drvdata(file); 72 struct vimc_cap_device *vcap = video_drvdata(file);
73 73
74 strlcpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver)); 74 strscpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
75 strlcpy(cap->card, KBUILD_MODNAME, sizeof(cap->card)); 75 strscpy(cap->card, KBUILD_MODNAME, sizeof(cap->card));
76 snprintf(cap->bus_info, sizeof(cap->bus_info), 76 snprintf(cap->bus_info, sizeof(cap->bus_info),
77 "platform:%s", vcap->vdev.v4l2_dev->name); 77 "platform:%s", vcap->vdev.v4l2_dev->name);
78 78
@@ -476,7 +476,7 @@ static int vimc_cap_comp_bind(struct device *comp, struct device *master,
476 vdev->queue = q; 476 vdev->queue = q;
477 vdev->v4l2_dev = v4l2_dev; 477 vdev->v4l2_dev = v4l2_dev;
478 vdev->vfl_dir = VFL_DIR_RX; 478 vdev->vfl_dir = VFL_DIR_RX;
479 strlcpy(vdev->name, pdata->entity_name, sizeof(vdev->name)); 479 strscpy(vdev->name, pdata->entity_name, sizeof(vdev->name));
480 video_set_drvdata(vdev, &vcap->ved); 480 video_set_drvdata(vdev, &vcap->ved);
481 481
482 /* Register the video_device with the v4l2 and the media framework */ 482 /* Register the video_device with the v4l2 and the media framework */
diff --git a/drivers/media/platform/vimc/vimc-common.c b/drivers/media/platform/vimc/vimc-common.c
index 617415c224fe..dee1b9dfc4f6 100644
--- a/drivers/media/platform/vimc/vimc-common.c
+++ b/drivers/media/platform/vimc/vimc-common.c
@@ -430,7 +430,7 @@ int vimc_ent_sd_register(struct vimc_ent_device *ved,
430 sd->entity.function = function; 430 sd->entity.function = function;
431 sd->entity.ops = &vimc_ent_sd_mops; 431 sd->entity.ops = &vimc_ent_sd_mops;
432 sd->owner = THIS_MODULE; 432 sd->owner = THIS_MODULE;
433 strlcpy(sd->name, name, sizeof(sd->name)); 433 strscpy(sd->name, name, sizeof(sd->name));
434 v4l2_set_subdevdata(sd, ved); 434 v4l2_set_subdevdata(sd, ved);
435 435
436 /* Expose this subdev to user space */ 436 /* Expose this subdev to user space */
diff --git a/drivers/media/platform/vimc/vimc-core.c b/drivers/media/platform/vimc/vimc-core.c
index 9246f265de31..ce809d2e3d53 100644
--- a/drivers/media/platform/vimc/vimc-core.c
+++ b/drivers/media/platform/vimc/vimc-core.c
@@ -259,7 +259,7 @@ static struct component_match *vimc_add_subdevs(struct vimc_device *vimc)
259 dev_dbg(&vimc->pdev.dev, "new pdev for %s\n", 259 dev_dbg(&vimc->pdev.dev, "new pdev for %s\n",
260 vimc->pipe_cfg->ents[i].drv); 260 vimc->pipe_cfg->ents[i].drv);
261 261
262 strlcpy(pdata.entity_name, vimc->pipe_cfg->ents[i].name, 262 strscpy(pdata.entity_name, vimc->pipe_cfg->ents[i].name,
263 sizeof(pdata.entity_name)); 263 sizeof(pdata.entity_name));
264 264
265 vimc->subdevs[i] = platform_device_register_data(&vimc->pdev.dev, 265 vimc->subdevs[i] = platform_device_register_data(&vimc->pdev.dev,
@@ -317,7 +317,7 @@ static int vimc_probe(struct platform_device *pdev)
317 vimc->v4l2_dev.mdev = &vimc->mdev; 317 vimc->v4l2_dev.mdev = &vimc->mdev;
318 318
319 /* Initialize media device */ 319 /* Initialize media device */
320 strlcpy(vimc->mdev.model, VIMC_MDEV_MODEL_NAME, 320 strscpy(vimc->mdev.model, VIMC_MDEV_MODEL_NAME,
321 sizeof(vimc->mdev.model)); 321 sizeof(vimc->mdev.model));
322 vimc->mdev.dev = &pdev->dev; 322 vimc->mdev.dev = &pdev->dev;
323 media_device_init(&vimc->mdev); 323 media_device_init(&vimc->mdev);
diff --git a/drivers/media/platform/vivid/vivid-osd.c b/drivers/media/platform/vivid/vivid-osd.c
index bbbc1b6938a5..1a89593b0c86 100644
--- a/drivers/media/platform/vivid/vivid-osd.c
+++ b/drivers/media/platform/vivid/vivid-osd.c
@@ -110,7 +110,7 @@ static int vivid_fb_get_fix(struct vivid_dev *dev, struct fb_fix_screeninfo *fix
110{ 110{
111 dprintk(dev, 1, "vivid_fb_get_fix\n"); 111 dprintk(dev, 1, "vivid_fb_get_fix\n");
112 memset(fix, 0, sizeof(struct fb_fix_screeninfo)); 112 memset(fix, 0, sizeof(struct fb_fix_screeninfo));
113 strlcpy(fix->id, "vioverlay fb", sizeof(fix->id)); 113 strscpy(fix->id, "vioverlay fb", sizeof(fix->id));
114 fix->smem_start = dev->video_pbase; 114 fix->smem_start = dev->video_pbase;
115 fix->smem_len = dev->video_buffer_size; 115 fix->smem_len = dev->video_buffer_size;
116 fix->type = FB_TYPE_PACKED_PIXELS; 116 fix->type = FB_TYPE_PACKED_PIXELS;
diff --git a/drivers/media/platform/vivid/vivid-radio-common.c b/drivers/media/platform/vivid/vivid-radio-common.c
index 7c8efe38ff5b..138c7bce68b1 100644
--- a/drivers/media/platform/vivid/vivid-radio-common.c
+++ b/drivers/media/platform/vivid/vivid-radio-common.c
@@ -76,10 +76,10 @@ void vivid_radio_rds_init(struct vivid_dev *dev)
76 rds->ta = dev->radio_tx_rds_ta->cur.val; 76 rds->ta = dev->radio_tx_rds_ta->cur.val;
77 rds->tp = dev->radio_tx_rds_tp->cur.val; 77 rds->tp = dev->radio_tx_rds_tp->cur.val;
78 rds->ms = dev->radio_tx_rds_ms->cur.val; 78 rds->ms = dev->radio_tx_rds_ms->cur.val;
79 strlcpy(rds->psname, 79 strscpy(rds->psname,
80 dev->radio_tx_rds_psname->p_cur.p_char, 80 dev->radio_tx_rds_psname->p_cur.p_char,
81 sizeof(rds->psname)); 81 sizeof(rds->psname));
82 strlcpy(rds->radiotext, 82 strscpy(rds->radiotext,
83 dev->radio_tx_rds_radiotext->p_cur.p_char + alt * 64, 83 dev->radio_tx_rds_radiotext->p_cur.p_char + alt * 64,
84 sizeof(rds->radiotext)); 84 sizeof(rds->radiotext));
85 v4l2_ctrl_unlock(dev->radio_tx_rds_pi); 85 v4l2_ctrl_unlock(dev->radio_tx_rds_pi);
diff --git a/drivers/media/platform/vivid/vivid-radio-rx.c b/drivers/media/platform/vivid/vivid-radio-rx.c
index 1f86d7d4f72f..232cab508f48 100644
--- a/drivers/media/platform/vivid/vivid-radio-rx.c
+++ b/drivers/media/platform/vivid/vivid-radio-rx.c
@@ -223,7 +223,7 @@ int vivid_radio_rx_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
223 if (vt->index > 0) 223 if (vt->index > 0)
224 return -EINVAL; 224 return -EINVAL;
225 225
226 strlcpy(vt->name, "AM/FM/SW Receiver", sizeof(vt->name)); 226 strscpy(vt->name, "AM/FM/SW Receiver", sizeof(vt->name));
227 vt->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO | 227 vt->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO |
228 V4L2_TUNER_CAP_FREQ_BANDS | V4L2_TUNER_CAP_RDS | 228 V4L2_TUNER_CAP_FREQ_BANDS | V4L2_TUNER_CAP_RDS |
229 (dev->radio_rx_rds_controls ? 229 (dev->radio_rx_rds_controls ?
diff --git a/drivers/media/platform/vivid/vivid-radio-tx.c b/drivers/media/platform/vivid/vivid-radio-tx.c
index 1a3749ba5e7e..049d40b948bb 100644
--- a/drivers/media/platform/vivid/vivid-radio-tx.c
+++ b/drivers/media/platform/vivid/vivid-radio-tx.c
@@ -103,7 +103,7 @@ int vidioc_g_modulator(struct file *file, void *fh, struct v4l2_modulator *a)
103 if (a->index > 0) 103 if (a->index > 0)
104 return -EINVAL; 104 return -EINVAL;
105 105
106 strlcpy(a->name, "AM/FM/SW Transmitter", sizeof(a->name)); 106 strscpy(a->name, "AM/FM/SW Transmitter", sizeof(a->name));
107 a->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO | 107 a->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO |
108 V4L2_TUNER_CAP_FREQ_BANDS | V4L2_TUNER_CAP_RDS | 108 V4L2_TUNER_CAP_FREQ_BANDS | V4L2_TUNER_CAP_RDS |
109 (dev->radio_tx_rds_controls ? 109 (dev->radio_tx_rds_controls ?
diff --git a/drivers/media/platform/vivid/vivid-rds-gen.c b/drivers/media/platform/vivid/vivid-rds-gen.c
index 39ca9a56448c..b5b104ee64c9 100644
--- a/drivers/media/platform/vivid/vivid-rds-gen.c
+++ b/drivers/media/platform/vivid/vivid-rds-gen.c
@@ -147,11 +147,11 @@ void vivid_rds_gen_fill(struct vivid_rds_gen *rds, unsigned freq,
147 snprintf(rds->psname, sizeof(rds->psname), "%6d.%1d", 147 snprintf(rds->psname, sizeof(rds->psname), "%6d.%1d",
148 freq / 16, ((freq & 0xf) * 10) / 16); 148 freq / 16, ((freq & 0xf) * 10) / 16);
149 if (alt) 149 if (alt)
150 strlcpy(rds->radiotext, 150 strscpy(rds->radiotext,
151 " The Radio Data System can switch between different Radio Texts ", 151 " The Radio Data System can switch between different Radio Texts ",
152 sizeof(rds->radiotext)); 152 sizeof(rds->radiotext));
153 else 153 else
154 strlcpy(rds->radiotext, 154 strscpy(rds->radiotext,
155 "An example of Radio Text as transmitted by the Radio Data System", 155 "An example of Radio Text as transmitted by the Radio Data System",
156 sizeof(rds->radiotext)); 156 sizeof(rds->radiotext));
157} 157}
diff --git a/drivers/media/platform/vivid/vivid-sdr-cap.c b/drivers/media/platform/vivid/vivid-sdr-cap.c
index cfb7cb4d37a8..200b789a3f21 100644
--- a/drivers/media/platform/vivid/vivid-sdr-cap.c
+++ b/drivers/media/platform/vivid/vivid-sdr-cap.c
@@ -396,7 +396,7 @@ int vivid_sdr_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
396{ 396{
397 switch (vt->index) { 397 switch (vt->index) {
398 case 0: 398 case 0:
399 strlcpy(vt->name, "ADC", sizeof(vt->name)); 399 strscpy(vt->name, "ADC", sizeof(vt->name));
400 vt->type = V4L2_TUNER_ADC; 400 vt->type = V4L2_TUNER_ADC;
401 vt->capability = 401 vt->capability =
402 V4L2_TUNER_CAP_1HZ | V4L2_TUNER_CAP_FREQ_BANDS; 402 V4L2_TUNER_CAP_1HZ | V4L2_TUNER_CAP_FREQ_BANDS;
@@ -404,7 +404,7 @@ int vivid_sdr_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
404 vt->rangehigh = bands_adc[2].rangehigh; 404 vt->rangehigh = bands_adc[2].rangehigh;
405 return 0; 405 return 0;
406 case 1: 406 case 1:
407 strlcpy(vt->name, "RF", sizeof(vt->name)); 407 strscpy(vt->name, "RF", sizeof(vt->name));
408 vt->type = V4L2_TUNER_RF; 408 vt->type = V4L2_TUNER_RF;
409 vt->capability = 409 vt->capability =
410 V4L2_TUNER_CAP_1HZ | V4L2_TUNER_CAP_FREQ_BANDS; 410 V4L2_TUNER_CAP_1HZ | V4L2_TUNER_CAP_FREQ_BANDS;
diff --git a/drivers/media/platform/vivid/vivid-vid-cap.c b/drivers/media/platform/vivid/vivid-vid-cap.c
index 1599159f2574..f2c37e959bea 100644
--- a/drivers/media/platform/vivid/vivid-vid-cap.c
+++ b/drivers/media/platform/vivid/vivid-vid-cap.c
@@ -1505,7 +1505,7 @@ int vivid_video_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
1505 break; 1505 break;
1506 } 1506 }
1507 } 1507 }
1508 strlcpy(vt->name, "TV Tuner", sizeof(vt->name)); 1508 strscpy(vt->name, "TV Tuner", sizeof(vt->name));
1509 return 0; 1509 return 0;
1510} 1510}
1511 1511
diff --git a/drivers/media/platform/vsp1/vsp1_drv.c b/drivers/media/platform/vsp1/vsp1_drv.c
index b6619c9c18bb..8c9d9d6e5632 100644
--- a/drivers/media/platform/vsp1/vsp1_drv.c
+++ b/drivers/media/platform/vsp1/vsp1_drv.c
@@ -242,7 +242,7 @@ static int vsp1_create_entities(struct vsp1_device *vsp1)
242 242
243 mdev->dev = vsp1->dev; 243 mdev->dev = vsp1->dev;
244 mdev->hw_revision = vsp1->version; 244 mdev->hw_revision = vsp1->version;
245 strlcpy(mdev->model, vsp1->info->model, sizeof(mdev->model)); 245 strscpy(mdev->model, vsp1->info->model, sizeof(mdev->model));
246 snprintf(mdev->bus_info, sizeof(mdev->bus_info), "platform:%s", 246 snprintf(mdev->bus_info, sizeof(mdev->bus_info), "platform:%s",
247 dev_name(mdev->dev)); 247 dev_name(mdev->dev));
248 media_device_init(mdev); 248 media_device_init(mdev);
diff --git a/drivers/media/platform/vsp1/vsp1_histo.c b/drivers/media/platform/vsp1/vsp1_histo.c
index 5e15c8ff88d9..8b01e99acd20 100644
--- a/drivers/media/platform/vsp1/vsp1_histo.c
+++ b/drivers/media/platform/vsp1/vsp1_histo.c
@@ -429,8 +429,8 @@ static int histo_v4l2_querycap(struct file *file, void *fh,
429 cap->device_caps = V4L2_CAP_META_CAPTURE 429 cap->device_caps = V4L2_CAP_META_CAPTURE
430 | V4L2_CAP_STREAMING; 430 | V4L2_CAP_STREAMING;
431 431
432 strlcpy(cap->driver, "vsp1", sizeof(cap->driver)); 432 strscpy(cap->driver, "vsp1", sizeof(cap->driver));
433 strlcpy(cap->card, histo->video.name, sizeof(cap->card)); 433 strscpy(cap->card, histo->video.name, sizeof(cap->card));
434 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", 434 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
435 dev_name(histo->entity.vsp1->dev)); 435 dev_name(histo->entity.vsp1->dev));
436 436
diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c
index 81d47a09d7bc..aa54322dad71 100644
--- a/drivers/media/platform/vsp1/vsp1_video.c
+++ b/drivers/media/platform/vsp1/vsp1_video.c
@@ -976,8 +976,8 @@ vsp1_video_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
976 cap->device_caps = V4L2_CAP_VIDEO_OUTPUT_MPLANE 976 cap->device_caps = V4L2_CAP_VIDEO_OUTPUT_MPLANE
977 | V4L2_CAP_STREAMING; 977 | V4L2_CAP_STREAMING;
978 978
979 strlcpy(cap->driver, "vsp1", sizeof(cap->driver)); 979 strscpy(cap->driver, "vsp1", sizeof(cap->driver));
980 strlcpy(cap->card, video->video.name, sizeof(cap->card)); 980 strscpy(cap->card, video->video.name, sizeof(cap->card));
981 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", 981 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
982 dev_name(video->vsp1->dev)); 982 dev_name(video->vsp1->dev));
983 983
diff --git a/drivers/media/platform/xilinx/xilinx-dma.c b/drivers/media/platform/xilinx/xilinx-dma.c
index d041f94be832..5d3f627516b2 100644
--- a/drivers/media/platform/xilinx/xilinx-dma.c
+++ b/drivers/media/platform/xilinx/xilinx-dma.c
@@ -504,8 +504,8 @@ xvip_dma_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
504 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS 504 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS
505 | dma->xdev->v4l2_caps; 505 | dma->xdev->v4l2_caps;
506 506
507 strlcpy(cap->driver, "xilinx-vipp", sizeof(cap->driver)); 507 strscpy(cap->driver, "xilinx-vipp", sizeof(cap->driver));
508 strlcpy(cap->card, dma->video.name, sizeof(cap->card)); 508 strscpy(cap->card, dma->video.name, sizeof(cap->card));
509 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s:%u", 509 snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s:%u",
510 dma->xdev->dev->of_node->name, dma->port); 510 dma->xdev->dev->of_node->name, dma->port);
511 511
@@ -527,7 +527,7 @@ xvip_dma_enum_format(struct file *file, void *fh, struct v4l2_fmtdesc *f)
527 return -EINVAL; 527 return -EINVAL;
528 528
529 f->pixelformat = dma->format.pixelformat; 529 f->pixelformat = dma->format.pixelformat;
530 strlcpy(f->description, dma->fmtinfo->description, 530 strscpy(f->description, dma->fmtinfo->description,
531 sizeof(f->description)); 531 sizeof(f->description));
532 532
533 return 0; 533 return 0;
diff --git a/drivers/media/platform/xilinx/xilinx-tpg.c b/drivers/media/platform/xilinx/xilinx-tpg.c
index 9c49d1d10bee..851d20dcd550 100644
--- a/drivers/media/platform/xilinx/xilinx-tpg.c
+++ b/drivers/media/platform/xilinx/xilinx-tpg.c
@@ -833,7 +833,7 @@ static int xtpg_probe(struct platform_device *pdev)
833 v4l2_subdev_init(subdev, &xtpg_ops); 833 v4l2_subdev_init(subdev, &xtpg_ops);
834 subdev->dev = &pdev->dev; 834 subdev->dev = &pdev->dev;
835 subdev->internal_ops = &xtpg_internal_ops; 835 subdev->internal_ops = &xtpg_internal_ops;
836 strlcpy(subdev->name, dev_name(&pdev->dev), sizeof(subdev->name)); 836 strscpy(subdev->name, dev_name(&pdev->dev), sizeof(subdev->name));
837 v4l2_set_subdevdata(subdev, xtpg); 837 v4l2_set_subdevdata(subdev, xtpg);
838 subdev->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 838 subdev->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
839 subdev->entity.ops = &xtpg_media_ops; 839 subdev->entity.ops = &xtpg_media_ops;
diff --git a/drivers/media/platform/xilinx/xilinx-vipp.c b/drivers/media/platform/xilinx/xilinx-vipp.c
index 6d95ec1e9a6b..5148df007c6e 100644
--- a/drivers/media/platform/xilinx/xilinx-vipp.c
+++ b/drivers/media/platform/xilinx/xilinx-vipp.c
@@ -578,7 +578,7 @@ static int xvip_composite_v4l2_init(struct xvip_composite_device *xdev)
578 int ret; 578 int ret;
579 579
580 xdev->media_dev.dev = xdev->dev; 580 xdev->media_dev.dev = xdev->dev;
581 strlcpy(xdev->media_dev.model, "Xilinx Video Composite Device", 581 strscpy(xdev->media_dev.model, "Xilinx Video Composite Device",
582 sizeof(xdev->media_dev.model)); 582 sizeof(xdev->media_dev.model));
583 xdev->media_dev.hw_revision = 0; 583 xdev->media_dev.hw_revision = 0;
584 584