media: use strscpy() instead of strlcpy()
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 10 Sep 2018 12:19:14 +0000 (08:19 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 11 Sep 2018 17:32:17 +0000 (13:32 -0400)
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>
260 files changed:
drivers/media/cec/cec-api.c
drivers/media/cec/cec-core.c
drivers/media/common/b2c2/flexcop-i2c.c
drivers/media/common/cx2341x.c
drivers/media/common/saa7146/saa7146_fops.c
drivers/media/common/saa7146/saa7146_video.c
drivers/media/common/siano/smscoreapi.c
drivers/media/common/siano/smsir.c
drivers/media/dvb-core/dvb_vb2.c
drivers/media/dvb-core/dvbdev.c
drivers/media/dvb-frontends/cx24123.c
drivers/media/dvb-frontends/cxd2820r_core.c
drivers/media/dvb-frontends/dibx000_common.c
drivers/media/dvb-frontends/lgdt330x.c
drivers/media/dvb-frontends/m88ds3103.c
drivers/media/dvb-frontends/rtl2832_sdr.c
drivers/media/dvb-frontends/s5h1420.c
drivers/media/dvb-frontends/tc90522.c
drivers/media/dvb-frontends/ts2020.c
drivers/media/dvb-frontends/zd1301_demod.c
drivers/media/i2c/cs53l32a.c
drivers/media/i2c/imx274.c
drivers/media/i2c/m5mols/m5mols_core.c
drivers/media/i2c/max2175.c
drivers/media/i2c/msp3400-driver.c
drivers/media/i2c/noon010pc30.c
drivers/media/i2c/ov9650.c
drivers/media/i2c/s5c73m3/s5c73m3-core.c
drivers/media/i2c/s5k4ecgx.c
drivers/media/i2c/s5k6aa.c
drivers/media/i2c/saa7115.c
drivers/media/i2c/saa7127.c
drivers/media/i2c/tvaudio.c
drivers/media/i2c/video-i2c.c
drivers/media/media-device.c
drivers/media/pci/bt8xx/bttv-driver.c
drivers/media/pci/bt8xx/bttv-i2c.c
drivers/media/pci/bt8xx/bttv-input.c
drivers/media/pci/bt8xx/dvb-bt8xx.c
drivers/media/pci/cobalt/cobalt-alsa-main.c
drivers/media/pci/cobalt/cobalt-alsa-pcm.c
drivers/media/pci/cobalt/cobalt-v4l2.c
drivers/media/pci/cx18/cx18-alsa-main.c
drivers/media/pci/cx18/cx18-alsa-pcm.c
drivers/media/pci/cx18/cx18-cards.c
drivers/media/pci/cx18/cx18-driver.c
drivers/media/pci/cx18/cx18-i2c.c
drivers/media/pci/cx18/cx18-ioctl.c
drivers/media/pci/cx23885/cx23885-417.c
drivers/media/pci/cx23885/cx23885-dvb.c
drivers/media/pci/cx23885/cx23885-i2c.c
drivers/media/pci/cx23885/cx23885-ioctl.c
drivers/media/pci/cx23885/cx23885-video.c
drivers/media/pci/cx25821/cx25821-i2c.c
drivers/media/pci/cx25821/cx25821-video.c
drivers/media/pci/cx88/cx88-blackbird.c
drivers/media/pci/cx88/cx88-i2c.c
drivers/media/pci/cx88/cx88-input.c
drivers/media/pci/cx88/cx88-video.c
drivers/media/pci/cx88/cx88-vp3054-i2c.c
drivers/media/pci/dt3155/dt3155.c
drivers/media/pci/intel/ipu3/ipu3-cio2.c
drivers/media/pci/ivtv/ivtv-alsa-main.c
drivers/media/pci/ivtv/ivtv-alsa-pcm.c
drivers/media/pci/ivtv/ivtv-cards.c
drivers/media/pci/ivtv/ivtv-i2c.c
drivers/media/pci/ivtv/ivtv-ioctl.c
drivers/media/pci/ivtv/ivtvfb.c
drivers/media/pci/pt3/pt3.c
drivers/media/pci/saa7134/saa7134-empress.c
drivers/media/pci/saa7134/saa7134-go7007.c
drivers/media/pci/saa7134/saa7134-input.c
drivers/media/pci/saa7134/saa7134-video.c
drivers/media/pci/saa7146/mxb.c
drivers/media/pci/saa7164/saa7164-dvb.c
drivers/media/pci/saa7164/saa7164-encoder.c
drivers/media/pci/saa7164/saa7164-i2c.c
drivers/media/pci/saa7164/saa7164-vbi.c
drivers/media/pci/smipcie/smipcie-main.c
drivers/media/pci/solo6x10/solo6x10-v4l2.c
drivers/media/pci/ttpci/av7110.c
drivers/media/pci/ttpci/budget-core.c
drivers/media/pci/tw68/tw68-video.c
drivers/media/pci/tw686x/tw686x-audio.c
drivers/media/pci/tw686x/tw686x-video.c
drivers/media/platform/am437x/am437x-vpfe.c
drivers/media/platform/atmel/atmel-isc.c
drivers/media/platform/atmel/atmel-isi.c
drivers/media/platform/coda/coda-common.c
drivers/media/platform/davinci/vpbe_display.c
drivers/media/platform/davinci/vpfe_capture.c
drivers/media/platform/davinci/vpif_capture.c
drivers/media/platform/davinci/vpif_display.c
drivers/media/platform/exynos-gsc/gsc-core.c
drivers/media/platform/exynos-gsc/gsc-m2m.c
drivers/media/platform/exynos4-is/common.c
drivers/media/platform/exynos4-is/fimc-capture.c
drivers/media/platform/exynos4-is/fimc-is-i2c.c
drivers/media/platform/exynos4-is/fimc-isp-video.c
drivers/media/platform/exynos4-is/fimc-lite.c
drivers/media/platform/exynos4-is/media-dev.c
drivers/media/platform/m2m-deinterlace.c
drivers/media/platform/marvell-ccic/mcam-core.c
drivers/media/platform/marvell-ccic/mmp-driver.c
drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
drivers/media/platform/mx2_emmaprp.c
drivers/media/platform/omap/omap_vout.c
drivers/media/platform/omap3isp/isp.c
drivers/media/platform/omap3isp/ispccdc.c
drivers/media/platform/omap3isp/ispccp2.c
drivers/media/platform/omap3isp/ispcsi2.c
drivers/media/platform/omap3isp/isppreview.c
drivers/media/platform/omap3isp/ispresizer.c
drivers/media/platform/omap3isp/ispvideo.c
drivers/media/platform/pxa_camera.c
drivers/media/platform/qcom/camss/camss-video.c
drivers/media/platform/qcom/camss/camss.c
drivers/media/platform/qcom/venus/vdec.c
drivers/media/platform/qcom/venus/venc.c
drivers/media/platform/rcar-vin/rcar-core.c
drivers/media/platform/rcar-vin/rcar-v4l2.c
drivers/media/platform/rcar_drif.c
drivers/media/platform/rcar_fdp1.c
drivers/media/platform/rcar_jpu.c
drivers/media/platform/renesas-ceu.c
drivers/media/platform/rockchip/rga/rga.c
drivers/media/platform/s3c-camif/camif-capture.c
drivers/media/platform/s3c-camif/camif-core.c
drivers/media/platform/s5p-jpeg/jpeg-core.c
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
drivers/media/platform/sh_veu.c
drivers/media/platform/sh_vou.c
drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
drivers/media/platform/soc_camera/soc_camera.c
drivers/media/platform/soc_camera/soc_camera_platform.c
drivers/media/platform/sti/bdisp/bdisp-v4l2.c
drivers/media/platform/sti/delta/delta-v4l2.c
drivers/media/platform/sti/hva/hva-v4l2.c
drivers/media/platform/stm32/stm32-dcmi.c
drivers/media/platform/ti-vpe/cal.c
drivers/media/platform/via-camera.c
drivers/media/platform/vicodec/vicodec-core.c
drivers/media/platform/vim2m.c
drivers/media/platform/vimc/vimc-capture.c
drivers/media/platform/vimc/vimc-common.c
drivers/media/platform/vimc/vimc-core.c
drivers/media/platform/vivid/vivid-osd.c
drivers/media/platform/vivid/vivid-radio-common.c
drivers/media/platform/vivid/vivid-radio-rx.c
drivers/media/platform/vivid/vivid-radio-tx.c
drivers/media/platform/vivid/vivid-rds-gen.c
drivers/media/platform/vivid/vivid-sdr-cap.c
drivers/media/platform/vivid/vivid-vid-cap.c
drivers/media/platform/vsp1/vsp1_drv.c
drivers/media/platform/vsp1/vsp1_histo.c
drivers/media/platform/vsp1/vsp1_video.c
drivers/media/platform/xilinx/xilinx-dma.c
drivers/media/platform/xilinx/xilinx-tpg.c
drivers/media/platform/xilinx/xilinx-vipp.c
drivers/media/radio/dsbr100.c
drivers/media/radio/radio-cadet.c
drivers/media/radio/radio-isa.c
drivers/media/radio/radio-keene.c
drivers/media/radio/radio-ma901.c
drivers/media/radio/radio-maxiradio.c
drivers/media/radio/radio-miropcm20.c
drivers/media/radio/radio-mr800.c
drivers/media/radio/radio-raremono.c
drivers/media/radio/radio-sf16fmi.c
drivers/media/radio/radio-sf16fmr2.c
drivers/media/radio/radio-shark.c
drivers/media/radio/radio-shark2.c
drivers/media/radio/radio-si476x.c
drivers/media/radio/radio-tea5764.c
drivers/media/radio/radio-tea5777.c
drivers/media/radio/radio-timb.c
drivers/media/radio/radio-wl1273.c
drivers/media/radio/si470x/radio-si470x-i2c.c
drivers/media/radio/si470x/radio-si470x-usb.c
drivers/media/radio/si4713/radio-platform-si4713.c
drivers/media/radio/si4713/radio-usb-si4713.c
drivers/media/radio/tea575x.c
drivers/media/radio/tef6862.c
drivers/media/radio/wl128x/fmdrv_v4l2.c
drivers/media/rc/ati_remote.c
drivers/media/rc/mceusb.c
drivers/media/rc/streamzap.c
drivers/media/tuners/e4000.c
drivers/media/tuners/fc2580.c
drivers/media/tuners/msi001.c
drivers/media/tuners/mt20xx.c
drivers/media/tuners/tuner-simple.c
drivers/media/usb/airspy/airspy.c
drivers/media/usb/au0828/au0828-i2c.c
drivers/media/usb/au0828/au0828-video.c
drivers/media/usb/cx231xx/cx231xx-417.c
drivers/media/usb/cx231xx/cx231xx-input.c
drivers/media/usb/cx231xx/cx231xx-video.c
drivers/media/usb/dvb-usb-v2/af9035.c
drivers/media/usb/dvb-usb-v2/anysee.c
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
drivers/media/usb/dvb-usb-v2/gl861.c
drivers/media/usb/dvb-usb-v2/lmedm04.c
drivers/media/usb/dvb-usb-v2/rtl28xxu.c
drivers/media/usb/dvb-usb-v2/zd1301.c
drivers/media/usb/dvb-usb/cxusb.c
drivers/media/usb/dvb-usb/dib0700_devices.c
drivers/media/usb/dvb-usb/dvb-usb-i2c.c
drivers/media/usb/dvb-usb/dw2102.c
drivers/media/usb/dvb-usb/technisat-usb2.c
drivers/media/usb/em28xx/em28xx-video.c
drivers/media/usb/go7007/go7007-driver.c
drivers/media/usb/go7007/go7007-v4l2.c
drivers/media/usb/go7007/snd-go7007.c
drivers/media/usb/gspca/gspca.c
drivers/media/usb/gspca/sn9c20x.c
drivers/media/usb/hackrf/hackrf.c
drivers/media/usb/hdpvr/hdpvr-video.c
drivers/media/usb/msi2500/msi2500.c
drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
drivers/media/usb/pwc/pwc-v4l.c
drivers/media/usb/s2255/s2255drv.c
drivers/media/usb/stk1160/stk1160-v4l.c
drivers/media/usb/tm6000/tm6000-i2c.c
drivers/media/usb/tm6000/tm6000-video.c
drivers/media/usb/usbtv/usbtv-audio.c
drivers/media/usb/usbtv/usbtv-video.c
drivers/media/usb/usbvision/usbvision-video.c
drivers/media/usb/uvc/uvc_ctrl.c
drivers/media/usb/uvc/uvc_driver.c
drivers/media/usb/uvc/uvc_entity.c
drivers/media/usb/uvc/uvc_metadata.c
drivers/media/usb/uvc/uvc_v4l2.c
drivers/media/usb/zr364xx/zr364xx.c
drivers/media/v4l2-core/v4l2-common.c
drivers/media/v4l2-core/v4l2-ctrls.c
drivers/media/v4l2-core/v4l2-device.c
drivers/media/v4l2-core/v4l2-flash-led-class.c
drivers/media/v4l2-core/v4l2-ioctl.c
drivers/media/v4l2-core/v4l2-subdev.c
drivers/staging/media/bcm2048/radio-bcm2048.c
drivers/staging/media/davinci_vpfe/dm365_ipipe.c
drivers/staging/media/davinci_vpfe/dm365_ipipeif.c
drivers/staging/media/davinci_vpfe/dm365_isif.c
drivers/staging/media/davinci_vpfe/dm365_resizer.c
drivers/staging/media/davinci_vpfe/vpfe_video.c
drivers/staging/media/imx/imx-media-capture.c
drivers/staging/media/imx/imx-media-dev.c
drivers/staging/media/omap4iss/iss.c
drivers/staging/media/omap4iss/iss_ipipe.c
drivers/staging/media/omap4iss/iss_ipipeif.c
drivers/staging/media/omap4iss/iss_resizer.c
drivers/staging/media/omap4iss/iss_video.c
drivers/staging/media/zoran/zoran_card.c
drivers/staging/media/zoran/zoran_driver.c

index b6536bbad530c6b2bed6af16a9a4b1a41b32726a..27ae9e138b8e9bf96576e84e4ce700094c2dcc08 100644 (file)
@@ -77,9 +77,9 @@ static long cec_adap_g_caps(struct cec_adapter *adap,
 {
        struct cec_caps caps = {};
 
-       strlcpy(caps.driver, adap->devnode.dev.parent->driver->name,
+       strscpy(caps.driver, adap->devnode.dev.parent->driver->name,
                sizeof(caps.driver));
-       strlcpy(caps.name, adap->name, sizeof(caps.name));
+       strscpy(caps.name, adap->name, sizeof(caps.name));
        caps.available_log_addrs = adap->available_log_addrs;
        caps.capabilities = adap->capabilities;
        caps.version = LINUX_VERSION_CODE;
index b278ab90b38715023ea286c79f35cdfa47c94532..74596f089ec941bfdb871a45a04b342547a06319 100644 (file)
@@ -264,7 +264,7 @@ struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
        adap = kzalloc(sizeof(*adap), GFP_KERNEL);
        if (!adap)
                return ERR_PTR(-ENOMEM);
-       strlcpy(adap->name, name, sizeof(adap->name));
+       strscpy(adap->name, name, sizeof(adap->name));
        adap->phys_addr = CEC_PHYS_ADDR_INVALID;
        adap->cec_pin_is_high = true;
        adap->log_addrs.cec_version = CEC_OP_CEC_VERSION_2_0;
index 6675b605eb6f6b1a4b6d39ac7337ebd6c3550caa..1f1eaa807811b569d3a65566c3860a6d7d5845c7 100644 (file)
@@ -226,12 +226,12 @@ int flexcop_i2c_init(struct flexcop_device *fc)
        fc->fc_i2c_adap[1].port = FC_I2C_PORT_EEPROM;
        fc->fc_i2c_adap[2].port = FC_I2C_PORT_TUNER;
 
-       strlcpy(fc->fc_i2c_adap[0].i2c_adap.name, "B2C2 FlexCop I2C to demod",
-                       sizeof(fc->fc_i2c_adap[0].i2c_adap.name));
-       strlcpy(fc->fc_i2c_adap[1].i2c_adap.name, "B2C2 FlexCop I2C to eeprom",
-                       sizeof(fc->fc_i2c_adap[1].i2c_adap.name));
-       strlcpy(fc->fc_i2c_adap[2].i2c_adap.name, "B2C2 FlexCop I2C to tuner",
-                       sizeof(fc->fc_i2c_adap[2].i2c_adap.name));
+       strscpy(fc->fc_i2c_adap[0].i2c_adap.name, "B2C2 FlexCop I2C to demod",
+               sizeof(fc->fc_i2c_adap[0].i2c_adap.name));
+       strscpy(fc->fc_i2c_adap[1].i2c_adap.name, "B2C2 FlexCop I2C to eeprom",
+               sizeof(fc->fc_i2c_adap[1].i2c_adap.name));
+       strscpy(fc->fc_i2c_adap[2].i2c_adap.name, "B2C2 FlexCop I2C to tuner",
+               sizeof(fc->fc_i2c_adap[2].i2c_adap.name));
 
        i2c_set_adapdata(&fc->fc_i2c_adap[0].i2c_adap, &fc->fc_i2c_adap[0]);
        i2c_set_adapdata(&fc->fc_i2c_adap[1].i2c_adap, &fc->fc_i2c_adap[1]);
index 81dce9a81bd30aa2fbbe83147da8de44630782c5..1dcc39b87bb7bc2dfde80442b10bd77dfaa5b20e 100644 (file)
@@ -569,7 +569,7 @@ static int cx2341x_ctrl_query_fill(struct v4l2_queryctrl *qctrl,
                qctrl->step = step;
                qctrl->default_value = def;
                qctrl->reserved[0] = qctrl->reserved[1] = 0;
-               strlcpy(qctrl->name, name, sizeof(qctrl->name));
+               strscpy(qctrl->name, name, sizeof(qctrl->name));
                return 0;
 
        default:
index d4987fd05d05f5b089e18b482fddf3deca2ac2ad..c790ae264464f33727c91e759ba9727df1665157 100644 (file)
@@ -606,7 +606,7 @@ int saa7146_register_device(struct video_device *vfd, struct saa7146_dev *dev,
        vfd->tvnorms = 0;
        for (i = 0; i < dev->ext_vv_data->num_stds; i++)
                vfd->tvnorms |= dev->ext_vv_data->stds[i].id;
-       strlcpy(vfd->name, name, sizeof(vfd->name));
+       strscpy(vfd->name, name, sizeof(vfd->name));
        video_set_drvdata(vfd, dev);
 
        err = video_register_device(vfd, type, -1);
index 0dfa0c09d646fdcd147437f871b49a995803af87..2a5c4b113f89bd3ef08f4d78129ebc00d0b4713e 100644 (file)
@@ -452,7 +452,7 @@ static int vidioc_querycap(struct file *file, void *fh, struct v4l2_capability *
        struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
 
        strcpy((char *)cap->driver, "saa7146 v4l2");
-       strlcpy((char *)cap->card, dev->ext->name, sizeof(cap->card));
+       strscpy((char *)cap->card, dev->ext->name, sizeof(cap->card));
        sprintf((char *)cap->bus_info, "PCI:%s", pci_name(dev->pci));
        cap->device_caps =
                V4L2_CAP_VIDEO_CAPTURE |
@@ -525,8 +525,8 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *fh, struct v4l2_fmtd
 {
        if (f->index >= ARRAY_SIZE(formats))
                return -EINVAL;
-       strlcpy((char *)f->description, formats[f->index].name,
-                       sizeof(f->description));
+       strscpy((char *)f->description, formats[f->index].name,
+               sizeof(f->description));
        f->pixelformat = formats[f->index].pixelformat;
        return 0;
 }
index 3b02cb570a6ead3e1ac406684703853a4183b059..add9d63619145bf5a9a0c6ef719dedf7a0432643 100644 (file)
@@ -450,7 +450,7 @@ static struct smscore_registry_entry_t *smscore_find_registry(char *devpath)
        entry = kmalloc(sizeof(*entry), GFP_KERNEL);
        if (entry) {
                entry->mode = default_mode;
-               strlcpy(entry->devpath, devpath, sizeof(entry->devpath));
+               strscpy(entry->devpath, devpath, sizeof(entry->devpath));
                list_add(&entry->entry, &g_smscore_registry);
        } else
                pr_err("failed to create smscore_registry.\n");
@@ -735,7 +735,7 @@ int smscore_register_device(struct smsdevice_params_t *params,
        dev->postload_handler = params->postload_handler;
 
        dev->device_flags = params->flags;
-       strlcpy(dev->devpath, params->devpath, sizeof(dev->devpath));
+       strscpy(dev->devpath, params->devpath, sizeof(dev->devpath));
 
        smscore_registry_settype(dev->devpath, params->device_type);
 
index 56db0a9444218b7ef0565d5d422295b8a196c920..a1cfafba9b4c0d02a8cee28109136c78e3518770 100644 (file)
@@ -55,7 +55,7 @@ int sms_ir_init(struct smscore_device_t *coredev)
        snprintf(coredev->ir.name, sizeof(coredev->ir.name),
                 "SMS IR (%s)", sms_get_board(board_id)->name);
 
-       strlcpy(coredev->ir.phys, coredev->devpath, sizeof(coredev->ir.phys));
+       strscpy(coredev->ir.phys, coredev->devpath, sizeof(coredev->ir.phys));
        strlcat(coredev->ir.phys, "/ir0", sizeof(coredev->ir.phys));
 
        dev->device_name = coredev->ir.name;
index b811adf88afa3424d14b6584969928d2b5cdae54..c90b1fd94735f6442a958eaf302e7841e0991309 100644 (file)
@@ -194,7 +194,7 @@ int dvb_vb2_init(struct dvb_vb2_ctx *ctx, const char *name, int nonblocking)
        spin_lock_init(&ctx->slock);
        INIT_LIST_HEAD(&ctx->dvb_q);
 
-       strlcpy(ctx->name, name, DVB_VB2_NAME_MAX);
+       strscpy(ctx->name, name, DVB_VB2_NAME_MAX);
        ctx->nonblocking = nonblocking;
        ctx->state = DVB_VB2_STATE_INIT;
 
index 3c87785703310fb97f342b1e42279b33f466b80f..9a5eed3f6cf6a61f5b4cbef93cc7998700173e6f 100644 (file)
@@ -967,9 +967,9 @@ struct i2c_client *dvb_module_probe(const char *module_name,
                return NULL;
 
        if (name)
-               strlcpy(board_info->type, name, I2C_NAME_SIZE);
+               strscpy(board_info->type, name, I2C_NAME_SIZE);
        else
-               strlcpy(board_info->type, module_name, I2C_NAME_SIZE);
+               strscpy(board_info->type, module_name, I2C_NAME_SIZE);
 
        board_info->addr = addr;
        board_info->platform_data = platform_data;
index e49215020a9372bb092e7acd6eb8b895c7dbee61..83dfae78579d1f5935518bef9122b2b588bbf125 100644 (file)
@@ -1087,7 +1087,7 @@ struct dvb_frontend *cx24123_attach(const struct cx24123_config *config,
        if (config->dont_use_pll)
                cx24123_repeater_mode(state, 1, 0);
 
-       strlcpy(state->tuner_i2c_adapter.name, "CX24123 tuner I2C bus",
+       strscpy(state->tuner_i2c_adapter.name, "CX24123 tuner I2C bus",
                sizeof(state->tuner_i2c_adapter.name));
        state->tuner_i2c_adapter.algo      = &cx24123_tuner_i2c_algo;
        state->tuner_i2c_adapter.algo_data = NULL;
index 3e0d8cbd76da36e680f40661edd9a57de344a60b..0f0acf98d22679e3f2c0f85723653864d881341a 100644 (file)
@@ -540,7 +540,7 @@ struct dvb_frontend *cxd2820r_attach(const struct cxd2820r_config *config,
        pdata.attach_in_use = true;
 
        memset(&board_info, 0, sizeof(board_info));
-       strlcpy(board_info.type, "cxd2820r", I2C_NAME_SIZE);
+       strscpy(board_info.type, "cxd2820r", I2C_NAME_SIZE);
        board_info.addr = config->i2c_address;
        board_info.platform_data = &pdata;
        client = i2c_new_device(adapter, &board_info);
index 70119c79ac2b41900daabc678c28795cea081867..dc80a8442e7af1ef29a6017a837332b3f3313116 100644 (file)
@@ -424,7 +424,7 @@ static int i2c_adapter_init(struct i2c_adapter *i2c_adap,
                                struct i2c_algorithm *algo, const char *name,
                                struct dibx000_i2c_master *mst)
 {
-       strlcpy(i2c_adap->name, name, sizeof(i2c_adap->name));
+       strscpy(i2c_adap->name, name, sizeof(i2c_adap->name));
        i2c_adap->algo = algo;
        i2c_adap->algo_data = NULL;
        i2c_set_adapdata(i2c_adap, mst);
index 10d584ce538d71bf84729a3b2527edc27418de12..96807e1348868a0ca4a9bc4ac08d006619a19b51 100644 (file)
@@ -929,7 +929,7 @@ struct dvb_frontend *lgdt330x_attach(const struct lgdt330x_config *_config,
        struct i2c_board_info board_info = {};
        struct lgdt330x_config config = *_config;
 
-       strlcpy(board_info.type, "lgdt330x", sizeof(board_info.type));
+       strscpy(board_info.type, "lgdt330x", sizeof(board_info.type));
        board_info.addr = demod_address;
        board_info.platform_data = &config;
        client = i2c_new_device(i2c, &board_info);
index dffd2d4bf1c8b96b0735707d449f46a6bb125033..123f2a33738b07f7da057fcd237409e62e8a24cd 100644 (file)
@@ -1284,7 +1284,7 @@ struct dvb_frontend *m88ds3103_attach(const struct m88ds3103_config *cfg,
        pdata.attach_in_use = true;
 
        memset(&board_info, 0, sizeof(board_info));
-       strlcpy(board_info.type, "m88ds3103", I2C_NAME_SIZE);
+       strscpy(board_info.type, "m88ds3103", I2C_NAME_SIZE);
        board_info.addr = cfg->i2c_addr;
        board_info.platform_data = &pdata;
        client = i2c_new_device(i2c, &board_info);
index d448d9d4879c6bcc35786b724e46d91c6f2cc7ea..8ef91b1598e30f4af495f2922c282aa65ca0847e 100644 (file)
@@ -439,8 +439,8 @@ static int rtl2832_sdr_querycap(struct file *file, void *fh,
 
        dev_dbg(&pdev->dev, "\n");
 
-       strlcpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
-       strlcpy(cap->card, dev->vdev.name, sizeof(cap->card));
+       strscpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
+       strscpy(cap->card, dev->vdev.name, sizeof(cap->card));
        usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info));
        cap->device_caps = V4L2_CAP_SDR_CAPTURE | V4L2_CAP_STREAMING |
                        V4L2_CAP_READWRITE | V4L2_CAP_TUNER;
@@ -976,7 +976,7 @@ static int rtl2832_sdr_g_tuner(struct file *file, void *priv,
        dev_dbg(&pdev->dev, "index=%d type=%d\n", v->index, v->type);
 
        if (v->index == 0) {
-               strlcpy(v->name, "ADC: Realtek RTL2832", sizeof(v->name));
+               strscpy(v->name, "ADC: Realtek RTL2832", sizeof(v->name));
                v->type = V4L2_TUNER_ADC;
                v->capability = V4L2_TUNER_CAP_1HZ | V4L2_TUNER_CAP_FREQ_BANDS;
                v->rangelow =   300000;
@@ -986,7 +986,7 @@ static int rtl2832_sdr_g_tuner(struct file *file, void *priv,
                   V4L2_SUBDEV_HAS_OP(dev->v4l2_subdev, tuner, g_tuner)) {
                ret = v4l2_subdev_call(dev->v4l2_subdev, tuner, g_tuner, v);
        } else if (v->index == 1) {
-               strlcpy(v->name, "RF: <unknown>", sizeof(v->name));
+               strscpy(v->name, "RF: <unknown>", sizeof(v->name));
                v->type = V4L2_TUNER_RF;
                v->capability = V4L2_TUNER_CAP_1HZ | V4L2_TUNER_CAP_FREQ_BANDS;
                v->rangelow =    50000000;
@@ -1133,7 +1133,7 @@ static int rtl2832_sdr_enum_fmt_sdr_cap(struct file *file, void *priv,
        if (f->index >= dev->num_formats)
                return -EINVAL;
 
-       strlcpy(f->description, formats[f->index].name, sizeof(f->description));
+       strscpy(f->description, formats[f->index].name, sizeof(f->description));
        f->pixelformat = formats[f->index].pixelformat;
 
        return 0;
index a65cdf8e8cd9a22950543d4749eb17c38d3cfac9..c63b56f7fc1419867b304c33ad63c5f69f7dd4e8 100644 (file)
@@ -912,7 +912,7 @@ struct dvb_frontend *s5h1420_attach(const struct s5h1420_config *config,
        state->frontend.demodulator_priv = state;
 
        /* create tuner i2c adapter */
-       strlcpy(state->tuner_i2c_adapter.name, "S5H1420-PN1010 tuner I2C bus",
+       strscpy(state->tuner_i2c_adapter.name, "S5H1420-PN1010 tuner I2C bus",
                sizeof(state->tuner_i2c_adapter.name));
        state->tuner_i2c_adapter.algo      = &s5h1420_tuner_i2c_algo;
        state->tuner_i2c_adapter.algo_data = NULL;
index 2ad81a438d6a509fd65fe50579dd051d40764fad..849d63dbc279b86602bfc35700b4b6dbfa1aed52 100644 (file)
@@ -781,7 +781,7 @@ static int tc90522_probe(struct i2c_client *client,
        adap->owner = THIS_MODULE;
        adap->algo = &tc90522_tuner_i2c_algo;
        adap->dev.parent = &client->dev;
-       strlcpy(adap->name, "tc90522_sub", sizeof(adap->name));
+       strscpy(adap->name, "tc90522_sub", sizeof(adap->name));
        i2c_set_adapdata(adap, state);
        ret = i2c_add_adapter(adap);
        if (ret < 0)
index 3e3e408786332f7554cfddaed447d5a61268210b..e5cd2cd414f4ea83f7dd9913727b3a12adaca2db 100644 (file)
@@ -525,7 +525,7 @@ struct dvb_frontend *ts2020_attach(struct dvb_frontend *fe,
        pdata.attach_in_use = true;
 
        memset(&board_info, 0, sizeof(board_info));
-       strlcpy(board_info.type, "ts2020", I2C_NAME_SIZE);
+       strscpy(board_info.type, "ts2020", I2C_NAME_SIZE);
        board_info.addr = config->tuner_address;
        board_info.platform_data = &pdata;
        client = i2c_new_device(i2c, &board_info);
index 84a2b25a574a3c6ad43fe780126020410f5a0da5..212f9328cea89ab9415c403f0a0a2319fa18c2aa 100644 (file)
@@ -499,7 +499,8 @@ static int zd1301_demod_probe(struct platform_device *pdev)
                goto err_kfree;
 
        /* Create I2C adapter */
-       strlcpy(dev->adapter.name, "ZyDAS ZD1301 demod", sizeof(dev->adapter.name));
+       strscpy(dev->adapter.name, "ZyDAS ZD1301 demod",
+               sizeof(dev->adapter.name));
        dev->adapter.algo = &zd1301_demod_i2c_algorithm;
        dev->adapter.algo_data = NULL;
        dev->adapter.dev.parent = pdev->dev.parent;
index fd70fe2130a15c5aaea13d3e64defb60472c2b8a..ef4bdbae45315523dc86d9a5003470c72a9012b7 100644 (file)
@@ -149,7 +149,7 @@ static int cs53l32a_probe(struct i2c_client *client,
                return -EIO;
 
        if (!id)
-               strlcpy(client->name, "cs53l32a", sizeof(client->name));
+               strscpy(client->name, "cs53l32a", sizeof(client->name));
 
        v4l_info(client, "chip found @ 0x%x (%s)\n",
                        client->addr << 1, client->adapter->name);
index f8c70f1a34feb09f2fddfba53471e8f9bd0b8409..b82625ff15582ffbe5f681f3b21dafe997cfdc72 100644 (file)
@@ -1895,7 +1895,7 @@ static int imx274_probe(struct i2c_client *client,
        imx274->client = client;
        sd = &imx274->sd;
        v4l2_i2c_subdev_init(sd, client, &imx274_subdev_ops);
-       strlcpy(sd->name, DRIVER_NAME, sizeof(sd->name));
+       strscpy(sd->name, DRIVER_NAME, sizeof(sd->name));
        sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS;
 
        /* initialize subdev media pad */
index 12e79f9e32d53c090a001bc1036398a209cb9de1..155424a43d4c7b903214a025714adaa1a6f4573f 100644 (file)
@@ -987,7 +987,7 @@ static int m5mols_probe(struct i2c_client *client,
 
        sd = &info->sd;
        v4l2_i2c_subdev_init(sd, client, &m5mols_ops);
-       strlcpy(sd->name, MODULE_NAME, sizeof(sd->name));
+       strscpy(sd->name, MODULE_NAME, sizeof(sd->name));
        sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
 
        sd->internal_ops = &m5mols_subdev_internal_ops;
index 008a082cb8ad73f2d433f268013694c5f7f86740..8569a2058b021255e2b02c4969e1f95a0546d8e7 100644 (file)
@@ -1165,7 +1165,7 @@ static int max2175_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
        if (vt->index > 0)
                return -EINVAL;
 
-       strlcpy(vt->name, "RF", sizeof(vt->name));
+       strscpy(vt->name, "RF", sizeof(vt->name));
        vt->type = V4L2_TUNER_RF;
        vt->capability = V4L2_TUNER_CAP_1HZ | V4L2_TUNER_CAP_FREQ_BANDS;
        vt->rangelow = ctx->bands_rf->rangelow;
index 3db966db83eb50c6888549c062fefd05ae591da9..98d20479b65114fbfd102aed6844d83af5f17173 100644 (file)
@@ -688,7 +688,7 @@ static int msp_probe(struct i2c_client *client, const struct i2c_device_id *id)
 #endif
 
        if (!id)
-               strlcpy(client->name, "msp3400", sizeof(client->name));
+               strscpy(client->name, "msp3400", sizeof(client->name));
 
        if (msp_reset(client) == -1) {
                dev_dbg_lvl(&client->dev, 1, msp_debug, "msp3400 not found\n");
index 88c498ad45dfb01aa089090609307ed3ce29673c..4698e40fedd24e9eee994c638559a2b3667d3eeb 100644 (file)
@@ -720,7 +720,7 @@ static int noon010_probe(struct i2c_client *client,
        mutex_init(&info->lock);
        sd = &info->sd;
        v4l2_i2c_subdev_init(sd, client, &noon010_ops);
-       strlcpy(sd->name, MODULE_NAME, sizeof(sd->name));
+       strscpy(sd->name, MODULE_NAME, sizeof(sd->name));
 
        sd->internal_ops = &noon010_subdev_internal_ops;
        sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
index 16f625ffbde046fab0f351b16cea80b9943885b2..3c9e6798d14b6f34031c926f130ad0df98b97d5b 100644 (file)
@@ -1539,7 +1539,7 @@ static int ov965x_probe(struct i2c_client *client,
 
        sd = &ov965x->sd;
        v4l2_i2c_subdev_init(sd, client, &ov965x_subdev_ops);
-       strlcpy(sd->name, DRIVER_NAME, sizeof(sd->name));
+       strscpy(sd->name, DRIVER_NAME, sizeof(sd->name));
 
        sd->internal_ops = &ov965x_sd_internal_ops;
        sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE |
index ce196b60f9170d219de213187aaef1cd26057c12..9ca9b39970736cf91ccedeb093b7870acaf0e3fb 100644 (file)
@@ -1683,7 +1683,7 @@ static int s5c73m3_probe(struct i2c_client *client,
        v4l2_subdev_init(sd, &s5c73m3_subdev_ops);
        sd->owner = client->dev.driver->owner;
        v4l2_set_subdevdata(sd, state);
-       strlcpy(sd->name, "S5C73M3", sizeof(sd->name));
+       strscpy(sd->name, "S5C73M3", sizeof(sd->name));
 
        sd->internal_ops = &s5c73m3_internal_ops;
        sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
index 6ebcf254989a5237869b5d94b065a06fadc04d14..8c0dca6cb20cfaef23bc0decee6e421b18565a37 100644 (file)
@@ -954,7 +954,7 @@ static int s5k4ecgx_probe(struct i2c_client *client,
        sd = &priv->sd;
        /* Registering subdev */
        v4l2_i2c_subdev_init(sd, client, &s5k4ecgx_ops);
-       strlcpy(sd->name, S5K4ECGX_DRIVER_NAME, sizeof(sd->name));
+       strscpy(sd->name, S5K4ECGX_DRIVER_NAME, sizeof(sd->name));
 
        sd->internal_ops = &s5k4ecgx_subdev_internal_ops;
        /* Support v4l2 sub-device user space API */
index 13c10b5e2b451ccedaae039e1d92a9ecc56d9155..52ca033f706908106c05ff0fd1faebc633644a5d 100644 (file)
@@ -1576,7 +1576,7 @@ static int s5k6aa_probe(struct i2c_client *client,
 
        sd = &s5k6aa->sd;
        v4l2_i2c_subdev_init(sd, client, &s5k6aa_subdev_ops);
-       strlcpy(sd->name, DRIVER_NAME, sizeof(sd->name));
+       strscpy(sd->name, DRIVER_NAME, sizeof(sd->name));
 
        sd->internal_ops = &s5k6aa_subdev_internal_ops;
        sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
index b07114b5efb27b9207ddd9395924cb83700e32a1..7bc3b721831e75359aaa8b8c68e8a328432968a7 100644 (file)
@@ -1765,7 +1765,7 @@ static int saa711x_detect_chip(struct i2c_client *client,
                 * the lower nibble is a gm7113c.
                 */
 
-               strlcpy(name, "gm7113c", CHIP_VER_SIZE);
+               strscpy(name, "gm7113c", CHIP_VER_SIZE);
 
                if (!autodetect && strcmp(name, id->name))
                        return -EINVAL;
@@ -1779,7 +1779,7 @@ static int saa711x_detect_chip(struct i2c_client *client,
 
        /* Check if it is a CJC7113 */
        if (!memcmp(name, "1111111111111111", CHIP_VER_SIZE)) {
-               strlcpy(name, "cjc7113", CHIP_VER_SIZE);
+               strscpy(name, "cjc7113", CHIP_VER_SIZE);
 
                if (!autodetect && strcmp(name, id->name))
                        return -EINVAL;
@@ -1825,7 +1825,7 @@ static int saa711x_probe(struct i2c_client *client,
        if (ident < 0)
                return ident;
 
-       strlcpy(client->name, name, sizeof(client->name));
+       strscpy(client->name, name, sizeof(client->name));
 
        state = devm_kzalloc(&client->dev, sizeof(*state), GFP_KERNEL);
        if (state == NULL)
index e58a150cec5ca3be0e63bc177ca4083f3d51d207..a67865b810c0991060ad8becf8bd98a7f86dc04d 100644 (file)
@@ -761,10 +761,10 @@ static int saa7127_probe(struct i2c_client *client,
                        saa7127_write(sd, SAA7129_REG_FADE_KEY_COL2,
                                        read_result);
                        state->ident = SAA7129;
-                       strlcpy(client->name, "saa7129", I2C_NAME_SIZE);
+                       strscpy(client->name, "saa7129", I2C_NAME_SIZE);
                } else {
                        state->ident = SAA7127;
-                       strlcpy(client->name, "saa7127", I2C_NAME_SIZE);
+                       strscpy(client->name, "saa7127", I2C_NAME_SIZE);
                }
        }
 
index 5919214a56bf3f7dadc5763f08bf90ca3330f558..af2da977a685455da542b1964a793613e58ecef9 100644 (file)
@@ -1981,7 +1981,7 @@ static int tvaudio_probe(struct i2c_client *client, const struct i2c_device_id *
 
        /* fill required data structures */
        if (!id)
-               strlcpy(client->name, desc->name, I2C_NAME_SIZE);
+               strscpy(client->name, desc->name, I2C_NAME_SIZE);
        chip->desc = desc;
        chip->shadow.count = desc->registers+1;
        chip->prevmode = -1;
index 06d29d8f6be8ed8e7cb7c7418c58643e6a9eda58..4d49af86c15ee4a21b6f2e58d51dac4de6a6ddb9 100644 (file)
@@ -352,8 +352,8 @@ static int video_i2c_querycap(struct file *file, void  *priv,
        struct video_i2c_data *data = video_drvdata(file);
        struct i2c_client *client = data->client;
 
-       strlcpy(vcap->driver, data->v4l2_dev.name, sizeof(vcap->driver));
-       strlcpy(vcap->card, data->vdev.name, sizeof(vcap->card));
+       strscpy(vcap->driver, data->v4l2_dev.name, sizeof(vcap->driver));
+       strscpy(vcap->card, data->vdev.name, sizeof(vcap->card));
 
        sprintf(vcap->bus_info, "I2C:%d-%d", client->adapter->nr, client->addr);
 
@@ -378,7 +378,7 @@ static int video_i2c_enum_input(struct file *file, void *fh,
        if (vin->index > 0)
                return -EINVAL;
 
-       strlcpy(vin->name, "Camera", sizeof(vin->name));
+       strscpy(vin->name, "Camera", sizeof(vin->name));
 
        vin->type = V4L2_INPUT_TYPE_CAMERA;
 
@@ -534,7 +534,7 @@ static int video_i2c_probe(struct i2c_client *client,
 
        data->client = client;
        v4l2_dev = &data->v4l2_dev;
-       strlcpy(v4l2_dev->name, VIDEO_I2C_DRIVER, sizeof(v4l2_dev->name));
+       strscpy(v4l2_dev->name, VIDEO_I2C_DRIVER, sizeof(v4l2_dev->name));
 
        ret = v4l2_device_register(&client->dev, v4l2_dev);
        if (ret < 0)
index 3bae24b15eaa4cbd5e25485121e50ddcb5991af2..4c7190db420ea955d207008298d8032a94271a88 100644 (file)
@@ -69,14 +69,14 @@ static long media_device_get_info(struct media_device *dev, void *arg)
        memset(info, 0, sizeof(*info));
 
        if (dev->driver_name[0])
-               strlcpy(info->driver, dev->driver_name, sizeof(info->driver));
+               strscpy(info->driver, dev->driver_name, sizeof(info->driver));
        else
-               strlcpy(info->driver, dev->dev->driver->name,
+               strscpy(info->driver, dev->dev->driver->name,
                        sizeof(info->driver));
 
-       strlcpy(info->model, dev->model, sizeof(info->model));
-       strlcpy(info->serial, dev->serial, sizeof(info->serial));
-       strlcpy(info->bus_info, dev->bus_info, sizeof(info->bus_info));
+       strscpy(info->model, dev->model, sizeof(info->model));
+       strscpy(info->serial, dev->serial, sizeof(info->serial));
+       strscpy(info->bus_info, dev->bus_info, sizeof(info->bus_info));
 
        info->media_version = LINUX_VERSION_CODE;
        info->driver_version = info->media_version;
@@ -115,7 +115,7 @@ static long media_device_enum_entities(struct media_device *mdev, void *arg)
 
        entd->id = media_entity_id(ent);
        if (ent->name)
-               strlcpy(entd->name, ent->name, sizeof(entd->name));
+               strscpy(entd->name, ent->name, sizeof(entd->name));
        entd->type = ent->function;
        entd->revision = 0;             /* Unused */
        entd->flags = ent->flags;
@@ -268,7 +268,7 @@ static long media_device_get_topology(struct media_device *mdev, void *arg)
                kentity.id = entity->graph_obj.id;
                kentity.function = entity->function;
                kentity.flags = entity->flags;
-               strlcpy(kentity.name, entity->name,
+               strscpy(kentity.name, entity->name,
                        sizeof(kentity.name));
 
                if (copy_to_user(uentity, &kentity, sizeof(kentity)))
@@ -836,9 +836,9 @@ void media_device_pci_init(struct media_device *mdev,
        mdev->dev = &pci_dev->dev;
 
        if (name)
-               strlcpy(mdev->model, name, sizeof(mdev->model));
+               strscpy(mdev->model, name, sizeof(mdev->model));
        else
-               strlcpy(mdev->model, pci_name(pci_dev), sizeof(mdev->model));
+               strscpy(mdev->model, pci_name(pci_dev), sizeof(mdev->model));
 
        sprintf(mdev->bus_info, "PCI:%s", pci_name(pci_dev));
 
@@ -859,17 +859,17 @@ void __media_device_usb_init(struct media_device *mdev,
        mdev->dev = &udev->dev;
 
        if (driver_name)
-               strlcpy(mdev->driver_name, driver_name,
+               strscpy(mdev->driver_name, driver_name,
                        sizeof(mdev->driver_name));
 
        if (board_name)
-               strlcpy(mdev->model, board_name, sizeof(mdev->model));
+               strscpy(mdev->model, board_name, sizeof(mdev->model));
        else if (udev->product)
-               strlcpy(mdev->model, udev->product, sizeof(mdev->model));
+               strscpy(mdev->model, udev->product, sizeof(mdev->model));
        else
-               strlcpy(mdev->model, "unknown model", sizeof(mdev->model));
+               strscpy(mdev->model, "unknown model", sizeof(mdev->model));
        if (udev->serial)
-               strlcpy(mdev->serial, udev->serial, sizeof(mdev->serial));
+               strscpy(mdev->serial, udev->serial, sizeof(mdev->serial));
        usb_make_path(udev, mdev->bus_info, sizeof(mdev->bus_info));
        mdev->hw_revision = le16_to_cpu(udev->descriptor.bcdDevice);
 
index cf05e11da01b06c71bccbd17e080d806709cbd06..95045448a1125cda5b448d7e423d773e32ec799d 100644 (file)
@@ -2473,8 +2473,8 @@ static int bttv_querycap(struct file *file, void  *priv,
        if (0 == v4l2)
                return -EINVAL;
 
-       strlcpy(cap->driver, "bttv", sizeof(cap->driver));
-       strlcpy(cap->card, btv->video_dev.name, sizeof(cap->card));
+       strscpy(cap->driver, "bttv", sizeof(cap->driver));
+       strscpy(cap->card, btv->video_dev.name, sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info),
                 "PCI:%s", pci_name(btv->c.pci));
        cap->capabilities =
@@ -2535,7 +2535,7 @@ static int bttv_enum_fmt_cap_ovr(struct v4l2_fmtdesc *f)
                return -EINVAL;
 
        f->pixelformat = formats[i].fourcc;
-       strlcpy(f->description, formats[i].name, sizeof(f->description));
+       strscpy(f->description, formats[i].name, sizeof(f->description));
 
        return i;
 }
index c76823eb399dca1e1a0ceacf15ad60c10d27613a..15ff7f9d8373822fccd33e6cb842d29d2f527f90 100644 (file)
@@ -347,13 +347,13 @@ static void do_i2c_scan(char *name, struct i2c_client *c)
 /* init + register i2c adapter */
 int init_bttv_i2c(struct bttv *btv)
 {
-       strlcpy(btv->i2c_client.name, "bttv internal", I2C_NAME_SIZE);
+       strscpy(btv->i2c_client.name, "bttv internal", I2C_NAME_SIZE);
 
        if (i2c_hw)
                btv->use_i2c_hw = 1;
        if (btv->use_i2c_hw) {
                /* bt878 */
-               strlcpy(btv->c.i2c_adap.name, "bt878",
+               strscpy(btv->c.i2c_adap.name, "bt878",
                        sizeof(btv->c.i2c_adap.name));
                btv->c.i2c_adap.algo = &bttv_algo;
        } else {
@@ -362,7 +362,7 @@ int init_bttv_i2c(struct bttv *btv)
                if (i2c_udelay<5)
                        i2c_udelay=5;
 
-               strlcpy(btv->c.i2c_adap.name, "bttv",
+               strscpy(btv->c.i2c_adap.name, "bttv",
                        sizeof(btv->c.i2c_adap.name));
                btv->i2c_algo = bttv_i2c_algo_bit_template;
                btv->i2c_algo.udelay = i2c_udelay;
index 08266b23826e10418a0d0a91a0603199f0d7124c..5cf9293703988877fcf8f0c764a8de196cba4151 100644 (file)
@@ -382,7 +382,7 @@ void init_bttv_i2c_ir(struct bttv *btv)
 
        memset(&info, 0, sizeof(struct i2c_board_info));
        memset(&btv->init_data, 0, sizeof(btv->init_data));
-       strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
+       strscpy(info.type, "ir_video", I2C_NAME_SIZE);
 
        switch (btv->c.type) {
        case BTTV_BOARD_PV951:
index 2f810b7130e6cec0c961a1e47cabb5cbac31a34f..b46fbe557dd93f775afb490319732b08cf430a74 100644 (file)
@@ -819,7 +819,8 @@ static int dvb_bt8xx_probe(struct bttv_sub_device *sub)
 
        mutex_init(&card->lock);
        card->bttv_nr = sub->core->nr;
-       strlcpy(card->card_name, sub->core->v4l2_dev.name, sizeof(card->card_name));
+       strscpy(card->card_name, sub->core->v4l2_dev.name,
+               sizeof(card->card_name));
        card->i2c_adapter = &sub->core->i2c_adap;
 
        switch(sub->core->type) {
index e5022b620856192f302514c87920a5b75bdb80a9..c57f87a68269087673b23533bbbbbf1432ddf3d4 100644 (file)
@@ -65,7 +65,7 @@ static int snd_cobalt_card_set_names(struct snd_cobalt_card *cobsc)
        struct snd_card *sc = cobsc->sc;
 
        /* sc->driver is used by alsa-lib's configurator: simple, unique */
-       strlcpy(sc->driver, "cobalt", sizeof(sc->driver));
+       strscpy(sc->driver, "cobalt", sizeof(sc->driver));
 
        /* sc->shortname is a symlink in /proc/asound: COBALT-M -> cardN */
        snprintf(sc->shortname,  sizeof(sc->shortname), "cobalt-%d-%d",
index f6a7df13cd048a4ee0fa5015d7fbb953ff4d154a..38d00935a2927220bede32e2ec04cb52b411cb46 100644 (file)
@@ -557,7 +557,7 @@ int snd_cobalt_pcm_create(struct snd_cobalt_card *cobsc)
                                &snd_cobalt_pcm_capture_ops);
                sp->info_flags = 0;
                sp->private_data = cobsc;
-               strlcpy(sp->name, "cobalt", sizeof(sp->name));
+               strscpy(sp->name, "cobalt", sizeof(sp->name));
        } else {
                cobalt_s_bit_sysctrl(cobalt,
                        COBALT_SYS_CTRL_AUDIO_OPP_RESETN_BIT, 0);
@@ -581,7 +581,7 @@ int snd_cobalt_pcm_create(struct snd_cobalt_card *cobsc)
                                &snd_cobalt_pcm_playback_ops);
                sp->info_flags = 0;
                sp->private_data = cobsc;
-               strlcpy(sp->name, "cobalt", sizeof(sp->name));
+               strscpy(sp->name, "cobalt", sizeof(sp->name));
        }
 
        return 0;
index c8fd2d075f43871788365fac4d3540b915a6ac37..0525f5e1565b3187758a45e457f47d22ebc29771 100644 (file)
@@ -479,8 +479,8 @@ static int cobalt_querycap(struct file *file, void *priv_fh,
        struct cobalt_stream *s = video_drvdata(file);
        struct cobalt *cobalt = s->cobalt;
 
-       strlcpy(vcap->driver, "cobalt", sizeof(vcap->driver));
-       strlcpy(vcap->card, "cobalt", sizeof(vcap->card));
+       strscpy(vcap->driver, "cobalt", sizeof(vcap->driver));
+       strscpy(vcap->card, "cobalt", sizeof(vcap->card));
        snprintf(vcap->bus_info, sizeof(vcap->bus_info),
                 "PCIe:%s", pci_name(cobalt->pci_dev));
        vcap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_READWRITE;
@@ -693,15 +693,15 @@ static int cobalt_enum_fmt_vid_cap(struct file *file, void *priv_fh,
 {
        switch (f->index) {
        case 0:
-               strlcpy(f->description, "YUV 4:2:2", sizeof(f->description));
+               strscpy(f->description, "YUV 4:2:2", sizeof(f->description));
                f->pixelformat = V4L2_PIX_FMT_YUYV;
                break;
        case 1:
-               strlcpy(f->description, "RGB24", sizeof(f->description));
+               strscpy(f->description, "RGB24", sizeof(f->description));
                f->pixelformat = V4L2_PIX_FMT_RGB24;
                break;
        case 2:
-               strlcpy(f->description, "RGB32", sizeof(f->description));
+               strscpy(f->description, "RGB32", sizeof(f->description));
                f->pixelformat = V4L2_PIX_FMT_BGR32;
                break;
        default:
@@ -898,11 +898,11 @@ static int cobalt_enum_fmt_vid_out(struct file *file, void *priv_fh,
 {
        switch (f->index) {
        case 0:
-               strlcpy(f->description, "YUV 4:2:2", sizeof(f->description));
+               strscpy(f->description, "YUV 4:2:2", sizeof(f->description));
                f->pixelformat = V4L2_PIX_FMT_YUYV;
                break;
        case 1:
-               strlcpy(f->description, "RGB32", sizeof(f->description));
+               strscpy(f->description, "RGB32", sizeof(f->description));
                f->pixelformat = V4L2_PIX_FMT_BGR32;
                break;
        default:
index 93443d1457c58f4854c50c8d7c38d47e0d792d41..687477748fdd28a4d277324c1826611d7c80b9ae 100644 (file)
@@ -112,7 +112,7 @@ static int snd_cx18_card_set_names(struct snd_cx18_card *cxsc)
        struct snd_card *sc = cxsc->sc;
 
        /* sc->driver is used by alsa-lib's configurator: simple, unique */
-       strlcpy(sc->driver, "CX23418", sizeof(sc->driver));
+       strscpy(sc->driver, "CX23418", sizeof(sc->driver));
 
        /* sc->shortname is a symlink in /proc/asound: CX18-M -> cardN */
        snprintf(sc->shortname,  sizeof(sc->shortname), "CX18-%d",
index 4f31042a442ace9562bd348661d26fb88e8f3d58..3eafc27956c2b81f7c8ec3d015841337d312535a 100644 (file)
@@ -345,7 +345,7 @@ int snd_cx18_pcm_create(struct snd_cx18_card *cxsc)
                        &snd_cx18_pcm_capture_ops);
        sp->info_flags = 0;
        sp->private_data = cxsc;
-       strlcpy(sp->name, cx->card_name, sizeof(sp->name));
+       strscpy(sp->name, cx->card_name, sizeof(sp->name));
 
        return 0;
 
index c2cf965d639e8d89e613e078ce2eab69054d45f4..2dcbccfbd60d7a457d68c9d2c1f4b9fc7b9812db 100644 (file)
@@ -602,8 +602,8 @@ int cx18_get_input(struct cx18 *cx, u16 index, struct v4l2_input *input)
        if (index >= cx->nof_inputs)
                return -EINVAL;
        input->index = index;
-       strlcpy(input->name, input_strs[card_input->video_type - 1],
-                       sizeof(input->name));
+       strscpy(input->name, input_strs[card_input->video_type - 1],
+               sizeof(input->name));
        input->type = (card_input->video_type == CX18_CARD_INPUT_VID_TUNER ?
                        V4L2_INPUT_TYPE_TUNER : V4L2_INPUT_TYPE_CAMERA);
        input->audioset = (1 << cx->nof_audio_inputs) - 1;
@@ -625,8 +625,8 @@ int cx18_get_audio_input(struct cx18 *cx, u16 index, struct v4l2_audio *audio)
        memset(audio, 0, sizeof(*audio));
        if (index >= cx->nof_audio_inputs)
                return -EINVAL;
-       strlcpy(audio->name, input_strs[aud_input->audio_type - 1],
-                       sizeof(audio->name));
+       strscpy(audio->name, input_strs[aud_input->audio_type - 1],
+               sizeof(audio->name));
        audio->index = index;
        audio->capability = V4L2_AUDCAP_STEREO;
        return 0;
index 0c389a3fb4e5f0fb9bdaaa75128e0a177898ba10..56763c4ea1a707014f719b0857aef44df5a2586b 100644 (file)
@@ -328,7 +328,7 @@ void cx18_read_eeprom(struct cx18 *cx, struct tveeprom *tv)
        if (!c)
                return;
 
-       strlcpy(c->name, "cx18 tveeprom tmp", sizeof(c->name));
+       strscpy(c->name, "cx18 tveeprom tmp", sizeof(c->name));
        c->adapter = &cx->i2c_adap[0];
        c->addr = 0xa0 >> 1;
 
index f0eb181f2b94903e7cafc2bf71b2b8b3c58ffb9b..a89c666953f5680cbdfb7e39bbf80d5e6855bc3c 100644 (file)
@@ -83,7 +83,7 @@ static int cx18_i2c_new_ir(struct cx18 *cx, struct i2c_adapter *adap, u32 hw,
        unsigned short addr_list[2] = { addr, I2C_CLIENT_END };
 
        memset(&info, 0, sizeof(struct i2c_board_info));
-       strlcpy(info.type, type, I2C_NAME_SIZE);
+       strscpy(info.type, type, I2C_NAME_SIZE);
 
        /* Our default information for ir-kbd-i2c.c to use */
        switch (hw) {
index 80b902b12a78a97880786c0afe3143fb1db62c46..854116375a7ccb9c4af89e6c648dd192263e2fce 100644 (file)
@@ -397,8 +397,8 @@ static int cx18_querycap(struct file *file, void *fh,
        struct cx18_stream *s = video_drvdata(file);
        struct cx18 *cx = id->cx;
 
-       strlcpy(vcap->driver, CX18_DRIVER_NAME, sizeof(vcap->driver));
-       strlcpy(vcap->card, cx->card_name, sizeof(vcap->card));
+       strscpy(vcap->driver, CX18_DRIVER_NAME, sizeof(vcap->driver));
+       strscpy(vcap->card, cx->card_name, sizeof(vcap->card));
        snprintf(vcap->bus_info, sizeof(vcap->bus_info),
                 "PCI:%s", pci_name(cx->pci_dev));
        vcap->capabilities = cx->v4l2_cap;      /* capabilities */
@@ -632,9 +632,9 @@ static int cx18_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
        cx18_call_all(cx, tuner, g_tuner, vt);
 
        if (vt->type == V4L2_TUNER_RADIO)
-               strlcpy(vt->name, "cx18 Radio Tuner", sizeof(vt->name));
+               strscpy(vt->name, "cx18 Radio Tuner", sizeof(vt->name));
        else
-               strlcpy(vt->name, "cx18 TV Tuner", sizeof(vt->name));
+               strscpy(vt->name, "cx18 TV Tuner", sizeof(vt->name));
        return 0;
 }
 
index a71f3c7569ce3fb9b331cc5f0ba8a1298816b54f..8579de5bb61b376d61ada537ff5c9292aedcba28 100644 (file)
@@ -1329,8 +1329,8 @@ static int vidioc_querycap(struct file *file, void  *priv,
        struct cx23885_dev *dev = video_drvdata(file);
        struct cx23885_tsport  *tsport = &dev->ts1;
 
-       strlcpy(cap->driver, dev->name, sizeof(cap->driver));
-       strlcpy(cap->card, cx23885_boards[tsport->dev->board].name,
+       strscpy(cap->driver, dev->name, sizeof(cap->driver));
+       strscpy(cap->card, cx23885_boards[tsport->dev->board].name,
                sizeof(cap->card));
        sprintf(cap->bus_info, "PCIe:%s", pci_name(dev->pci));
        cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
@@ -1349,7 +1349,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void  *priv,
        if (f->index != 0)
                return -EINVAL;
 
-       strlcpy(f->description, "MPEG", sizeof(f->description));
+       strscpy(f->description, "MPEG", sizeof(f->description));
        f->pixelformat = V4L2_PIX_FMT_MPEG;
 
        return 0;
index 7d52173073d6eedf23fcd19e8de01f848a81311a..0d0929c54f93b1753af3e53625a929fd7bda42c4 100644 (file)
@@ -1165,7 +1165,7 @@ static int dvb_register_ci_mac(struct cx23885_tsport *port)
                sp2_config.priv = port;
                sp2_config.ci_control = cx23885_sp2_ci_ctrl;
                memset(&info, 0, sizeof(struct i2c_board_info));
-               strlcpy(info.type, "sp2", I2C_NAME_SIZE);
+               strscpy(info.type, "sp2", I2C_NAME_SIZE);
                info.addr = 0x40;
                info.platform_data = &sp2_config;
                request_module(info.type);
@@ -1831,7 +1831,7 @@ static int dvb_register(struct cx23885_tsport *port)
                case 1:
                        /* attach demod + tuner combo */
                        memset(&info, 0, sizeof(info));
-                       strlcpy(info.type, "tda10071_cx24118", I2C_NAME_SIZE);
+                       strscpy(info.type, "tda10071_cx24118", I2C_NAME_SIZE);
                        info.addr = 0x05;
                        info.platform_data = &tda10071_pdata;
                        request_module("tda10071");
@@ -1848,7 +1848,7 @@ static int dvb_register(struct cx23885_tsport *port)
                        /* attach SEC */
                        a8293_pdata.dvb_frontend = fe0->dvb.frontend;
                        memset(&info, 0, sizeof(info));
-                       strlcpy(info.type, "a8293", I2C_NAME_SIZE);
+                       strscpy(info.type, "a8293", I2C_NAME_SIZE);
                        info.addr = 0x0b;
                        info.platform_data = &a8293_pdata;
                        request_module("a8293");
@@ -1869,7 +1869,7 @@ static int dvb_register(struct cx23885_tsport *port)
                        si2165_pdata.chip_mode = SI2165_MODE_PLL_XTAL;
                        si2165_pdata.ref_freq_hz = 16000000;
                        memset(&info, 0, sizeof(struct i2c_board_info));
-                       strlcpy(info.type, "si2165", I2C_NAME_SIZE);
+                       strscpy(info.type, "si2165", I2C_NAME_SIZE);
                        info.addr = 0x64;
                        info.platform_data = &si2165_pdata;
                        request_module(info.type);
@@ -1903,7 +1903,7 @@ static int dvb_register(struct cx23885_tsport *port)
 
                /* attach demod + tuner combo */
                memset(&info, 0, sizeof(info));
-               strlcpy(info.type, "tda10071_cx24118", I2C_NAME_SIZE);
+               strscpy(info.type, "tda10071_cx24118", I2C_NAME_SIZE);
                info.addr = 0x05;
                info.platform_data = &tda10071_pdata;
                request_module("tda10071");
@@ -1920,7 +1920,7 @@ static int dvb_register(struct cx23885_tsport *port)
                /* attach SEC */
                a8293_pdata.dvb_frontend = fe0->dvb.frontend;
                memset(&info, 0, sizeof(info));
-               strlcpy(info.type, "a8293", I2C_NAME_SIZE);
+               strscpy(info.type, "a8293", I2C_NAME_SIZE);
                info.addr = 0x0b;
                info.platform_data = &a8293_pdata;
                request_module("a8293");
@@ -1953,7 +1953,7 @@ static int dvb_register(struct cx23885_tsport *port)
                        ts2020_config.fe = fe0->dvb.frontend;
                        ts2020_config.get_agc_pwm = m88ds3103_get_agc_pwm;
                        memset(&info, 0, sizeof(struct i2c_board_info));
-                       strlcpy(info.type, "ts2020", I2C_NAME_SIZE);
+                       strscpy(info.type, "ts2020", I2C_NAME_SIZE);
                        info.addr = 0x60;
                        info.platform_data = &ts2020_config;
                        request_module(info.type);
@@ -1990,7 +1990,7 @@ static int dvb_register(struct cx23885_tsport *port)
                        si2168_config.fe = &fe0->dvb.frontend;
                        si2168_config.ts_mode = SI2168_TS_SERIAL;
                        memset(&info, 0, sizeof(struct i2c_board_info));
-                       strlcpy(info.type, "si2168", I2C_NAME_SIZE);
+                       strscpy(info.type, "si2168", I2C_NAME_SIZE);
                        info.addr = 0x64;
                        info.platform_data = &si2168_config;
                        request_module(info.type);
@@ -2009,7 +2009,7 @@ static int dvb_register(struct cx23885_tsport *port)
                        si2157_config.fe = fe0->dvb.frontend;
                        si2157_config.if_port = 1;
                        memset(&info, 0, sizeof(struct i2c_board_info));
-                       strlcpy(info.type, "si2157", I2C_NAME_SIZE);
+                       strscpy(info.type, "si2157", I2C_NAME_SIZE);
                        info.addr = 0x60;
                        info.platform_data = &si2157_config;
                        request_module(info.type);
@@ -2037,7 +2037,7 @@ static int dvb_register(struct cx23885_tsport *port)
                si2168_config.fe = &fe0->dvb.frontend;
                si2168_config.ts_mode = SI2168_TS_PARALLEL;
                memset(&info, 0, sizeof(struct i2c_board_info));
-               strlcpy(info.type, "si2168", I2C_NAME_SIZE);
+               strscpy(info.type, "si2168", I2C_NAME_SIZE);
                info.addr = 0x64;
                info.platform_data = &si2168_config;
                request_module(info.type);
@@ -2055,7 +2055,7 @@ static int dvb_register(struct cx23885_tsport *port)
                si2157_config.fe = fe0->dvb.frontend;
                si2157_config.if_port = 1;
                memset(&info, 0, sizeof(struct i2c_board_info));
-               strlcpy(info.type, "si2157", I2C_NAME_SIZE);
+               strscpy(info.type, "si2157", I2C_NAME_SIZE);
                info.addr = 0x60;
                info.platform_data = &si2157_config;
                request_module(info.type);
@@ -2085,7 +2085,7 @@ static int dvb_register(struct cx23885_tsport *port)
                ts2020_config.fe = fe0->dvb.frontend;
                ts2020_config.get_agc_pwm = m88ds3103_get_agc_pwm;
                memset(&info, 0, sizeof(struct i2c_board_info));
-               strlcpy(info.type, "ts2020", I2C_NAME_SIZE);
+               strscpy(info.type, "ts2020", I2C_NAME_SIZE);
                info.addr = 0x60;
                info.platform_data = &ts2020_config;
                request_module(info.type);
@@ -2134,7 +2134,7 @@ static int dvb_register(struct cx23885_tsport *port)
                }
 
                memset(&info, 0, sizeof(info));
-               strlcpy(info.type, "m88ds3103", I2C_NAME_SIZE);
+               strscpy(info.type, "m88ds3103", I2C_NAME_SIZE);
                info.addr = 0x68;
                info.platform_data = &m88ds3103_pdata;
                request_module(info.type);
@@ -2154,7 +2154,7 @@ static int dvb_register(struct cx23885_tsport *port)
                ts2020_config.fe = fe0->dvb.frontend;
                ts2020_config.get_agc_pwm = m88ds3103_get_agc_pwm;
                memset(&info, 0, sizeof(struct i2c_board_info));
-               strlcpy(info.type, "ts2020", I2C_NAME_SIZE);
+               strscpy(info.type, "ts2020", I2C_NAME_SIZE);
                info.addr = 0x60;
                info.platform_data = &ts2020_config;
                request_module(info.type);
@@ -2199,7 +2199,7 @@ static int dvb_register(struct cx23885_tsport *port)
                si2168_config.i2c_adapter = &adapter;
                si2168_config.fe = &fe0->dvb.frontend;
                memset(&info, 0, sizeof(struct i2c_board_info));
-               strlcpy(info.type, "si2168", I2C_NAME_SIZE);
+               strscpy(info.type, "si2168", I2C_NAME_SIZE);
                info.addr = 0x64;
                info.platform_data = &si2168_config;
                request_module(info.type);
@@ -2217,7 +2217,7 @@ static int dvb_register(struct cx23885_tsport *port)
                si2157_config.fe = fe0->dvb.frontend;
                si2157_config.if_port = 1;
                memset(&info, 0, sizeof(struct i2c_board_info));
-               strlcpy(info.type, "si2157", I2C_NAME_SIZE);
+               strscpy(info.type, "si2157", I2C_NAME_SIZE);
                info.addr = 0x60;
                info.platform_data = &si2157_config;
                request_module(info.type);
@@ -2250,7 +2250,7 @@ static int dvb_register(struct cx23885_tsport *port)
                        /* attach SEC */
                        a8293_pdata.dvb_frontend = fe0->dvb.frontend;
                        memset(&info, 0, sizeof(info));
-                       strlcpy(info.type, "a8293", I2C_NAME_SIZE);
+                       strscpy(info.type, "a8293", I2C_NAME_SIZE);
                        info.addr = 0x0b;
                        info.platform_data = &a8293_pdata;
                        request_module("a8293");
@@ -2267,7 +2267,7 @@ static int dvb_register(struct cx23885_tsport *port)
                        memset(&m88rs6000t_config, 0, sizeof(m88rs6000t_config));
                        m88rs6000t_config.fe = fe0->dvb.frontend;
                        memset(&info, 0, sizeof(struct i2c_board_info));
-                       strlcpy(info.type, "m88rs6000t", I2C_NAME_SIZE);
+                       strscpy(info.type, "m88rs6000t", I2C_NAME_SIZE);
                        info.addr = 0x21;
                        info.platform_data = &m88rs6000t_config;
                        request_module("%s", info.type);
@@ -2292,7 +2292,7 @@ static int dvb_register(struct cx23885_tsport *port)
                        si2168_config.fe = &fe0->dvb.frontend;
                        si2168_config.ts_mode = SI2168_TS_SERIAL;
                        memset(&info, 0, sizeof(struct i2c_board_info));
-                       strlcpy(info.type, "si2168", I2C_NAME_SIZE);
+                       strscpy(info.type, "si2168", I2C_NAME_SIZE);
                        info.addr = 0x64;
                        info.platform_data = &si2168_config;
                        request_module("%s", info.type);
@@ -2310,7 +2310,7 @@ static int dvb_register(struct cx23885_tsport *port)
                        si2157_config.fe = fe0->dvb.frontend;
                        si2157_config.if_port = 1;
                        memset(&info, 0, sizeof(struct i2c_board_info));
-                       strlcpy(info.type, "si2157", I2C_NAME_SIZE);
+                       strscpy(info.type, "si2157", I2C_NAME_SIZE);
                        info.addr = 0x60;
                        info.platform_data = &si2157_config;
                        request_module("%s", info.type);
@@ -2345,7 +2345,7 @@ static int dvb_register(struct cx23885_tsport *port)
                        si2168_config.fe = &fe0->dvb.frontend;
                        si2168_config.ts_mode = SI2168_TS_SERIAL;
                        memset(&info, 0, sizeof(struct i2c_board_info));
-                       strlcpy(info.type, "si2168", I2C_NAME_SIZE);
+                       strscpy(info.type, "si2168", I2C_NAME_SIZE);
                        info.addr = 0x64;
                        info.platform_data = &si2168_config;
                        request_module("%s", info.type);
@@ -2363,7 +2363,7 @@ static int dvb_register(struct cx23885_tsport *port)
                        si2157_config.fe = fe0->dvb.frontend;
                        si2157_config.if_port = 1;
                        memset(&info, 0, sizeof(struct i2c_board_info));
-                       strlcpy(info.type, "si2157", I2C_NAME_SIZE);
+                       strscpy(info.type, "si2157", I2C_NAME_SIZE);
                        info.addr = 0x60;
                        info.platform_data = &si2157_config;
                        request_module("%s", info.type);
@@ -2392,7 +2392,7 @@ static int dvb_register(struct cx23885_tsport *port)
                        si2168_config.fe = &fe0->dvb.frontend;
                        si2168_config.ts_mode = SI2168_TS_SERIAL;
                        memset(&info, 0, sizeof(struct i2c_board_info));
-                       strlcpy(info.type, "si2168", I2C_NAME_SIZE);
+                       strscpy(info.type, "si2168", I2C_NAME_SIZE);
                        info.addr = 0x66;
                        info.platform_data = &si2168_config;
                        request_module("%s", info.type);
@@ -2410,7 +2410,7 @@ static int dvb_register(struct cx23885_tsport *port)
                        si2157_config.fe = fe0->dvb.frontend;
                        si2157_config.if_port = 1;
                        memset(&info, 0, sizeof(struct i2c_board_info));
-                       strlcpy(info.type, "si2157", I2C_NAME_SIZE);
+                       strscpy(info.type, "si2157", I2C_NAME_SIZE);
                        info.addr = 0x62;
                        info.platform_data = &si2157_config;
                        request_module("%s", info.type);
@@ -2452,7 +2452,7 @@ static int dvb_register(struct cx23885_tsport *port)
                        si2157_config.if_port = 1;
                        si2157_config.inversion = 1;
                        memset(&info, 0, sizeof(struct i2c_board_info));
-                       strlcpy(info.type, "si2157", I2C_NAME_SIZE);
+                       strscpy(info.type, "si2157", I2C_NAME_SIZE);
                        info.addr = 0x60;
                        info.platform_data = &si2157_config;
                        request_module("%s", info.type);
@@ -2488,7 +2488,7 @@ static int dvb_register(struct cx23885_tsport *port)
                        si2157_config.if_port = 1;
                        si2157_config.inversion = 1;
                        memset(&info, 0, sizeof(struct i2c_board_info));
-                       strlcpy(info.type, "si2157", I2C_NAME_SIZE);
+                       strscpy(info.type, "si2157", I2C_NAME_SIZE);
                        info.addr = 0x62;
                        info.platform_data = &si2157_config;
                        request_module("%s", info.type);
@@ -2528,7 +2528,7 @@ static int dvb_register(struct cx23885_tsport *port)
                        si2157_config.if_port = 1;
                        si2157_config.inversion = 1;
                        memset(&info, 0, sizeof(struct i2c_board_info));
-                       strlcpy(info.type, "si2157", I2C_NAME_SIZE);
+                       strscpy(info.type, "si2157", I2C_NAME_SIZE);
                        info.addr = 0x60;
                        info.platform_data = &si2157_config;
                        request_module("%s", info.type);
index ef863492c0ac7be67824e81057285ccd1ed5b3bf..dd67135d2bb6fdad4bb6886ab279edea5abc7f6c 100644 (file)
@@ -317,7 +317,7 @@ int cx23885_i2c_register(struct cx23885_i2c *bus)
        bus->i2c_client = cx23885_i2c_client_template;
        bus->i2c_adap.dev.parent = &dev->pci->dev;
 
-       strlcpy(bus->i2c_adap.name, bus->dev->name,
+       strscpy(bus->i2c_adap.name, bus->dev->name,
                sizeof(bus->i2c_adap.name));
 
        bus->i2c_adap.algo_data = bus;
@@ -345,7 +345,7 @@ int cx23885_i2c_register(struct cx23885_i2c *bus)
                };
 
                memset(&info, 0, sizeof(struct i2c_board_info));
-               strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
+               strscpy(info.type, "ir_video", I2C_NAME_SIZE);
                /* Use quick read command for probe, some IR chips don't
                 * support writes */
                i2c_new_probed_device(&bus->i2c_adap, &info, addr_list,
index d2cdd40f79f54611b9b6aa46ad7a0d5a9b00d9f0..d162bf4b4800e21e408c95c1d0cd6ac77be0ac42 100644 (file)
@@ -31,9 +31,9 @@ int cx23885_g_chip_info(struct file *file, void *fh,
        if (chip->match.addr == 1) {
                if (dev->v4l_device == NULL)
                        return -EINVAL;
-               strlcpy(chip->name, "cx23417", sizeof(chip->name));
+               strscpy(chip->name, "cx23417", sizeof(chip->name));
        } else {
-               strlcpy(chip->name, dev->v4l2_dev.name, sizeof(chip->name));
+               strscpy(chip->name, dev->v4l2_dev.name, sizeof(chip->name));
        }
        return 0;
 }
index f8a3deadc77a19e2b1fdd0d404dfb3948f52a0f6..b5ac7a6a9a62c95d07618ebb172ddd9be2e10379 100644 (file)
@@ -640,7 +640,7 @@ static int vidioc_querycap(struct file *file, void  *priv,
        struct video_device *vdev = video_devdata(file);
 
        strcpy(cap->driver, "cx23885");
-       strlcpy(cap->card, cx23885_boards[dev->board].name,
+       strscpy(cap->card, cx23885_boards[dev->board].name,
                sizeof(cap->card));
        sprintf(cap->bus_info, "PCIe:%s", pci_name(dev->pci));
        cap->device_caps = V4L2_CAP_READWRITE | V4L2_CAP_STREAMING | V4L2_CAP_AUDIO;
@@ -661,7 +661,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void  *priv,
        if (unlikely(f->index >= ARRAY_SIZE(formats)))
                return -EINVAL;
 
-       strlcpy(f->description, formats[f->index].name,
+       strscpy(f->description, formats[f->index].name,
                sizeof(f->description));
        f->pixelformat = formats[f->index].fourcc;
 
index 31479a41f359dfe589f395bd62346a93d82bb71b..67d2f76100118c1b9bfd2e187b0ed97b43813fc8 100644 (file)
@@ -306,7 +306,7 @@ int cx25821_i2c_register(struct cx25821_i2c *bus)
        bus->i2c_client = cx25821_i2c_client_template;
        bus->i2c_adap.dev.parent = &dev->pci->dev;
 
-       strlcpy(bus->i2c_adap.name, bus->dev->name, sizeof(bus->i2c_adap.name));
+       strscpy(bus->i2c_adap.name, bus->dev->name, sizeof(bus->i2c_adap.name));
 
        bus->i2c_adap.algo_data = bus;
        i2c_set_adapdata(&bus->i2c_adap, &dev->v4l2_dev);
index dbaf42ec26cd8efd4076a53419262fc0855f12fc..21607fbb675889b49c73621b66f785a1c3c9c758 100644 (file)
@@ -322,7 +322,7 @@ static int cx25821_vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
        if (unlikely(f->index >= ARRAY_SIZE(formats)))
                return -EINVAL;
 
-       strlcpy(f->description, formats[f->index].name, sizeof(f->description));
+       strscpy(f->description, formats[f->index].name, sizeof(f->description));
        f->pixelformat = formats[f->index].fourcc;
 
        return 0;
@@ -442,7 +442,7 @@ static int cx25821_vidioc_querycap(struct file *file, void *priv,
        const u32 cap_output = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_READWRITE;
 
        strcpy(cap->driver, "cx25821");
-       strlcpy(cap->card, cx25821_boards[dev->board].name, sizeof(cap->card));
+       strscpy(cap->card, cx25821_boards[dev->board].name, sizeof(cap->card));
        sprintf(cap->bus_info, "PCIe:%s", pci_name(dev->pci));
        if (chan->id >= VID_CHANNEL_NUM)
                cap->device_caps = cap_output;
index 7a4876cf9f088c32abdf3dff4cac8df4c21fb7b5..cf4e926cc3889e8e84fd114bad1683e60274a058 100644 (file)
@@ -814,7 +814,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void  *priv,
        if (f->index != 0)
                return -EINVAL;
 
-       strlcpy(f->description, "MPEG", sizeof(f->description));
+       strscpy(f->description, "MPEG", sizeof(f->description));
        f->pixelformat = V4L2_PIX_FMT_MPEG;
        f->flags = V4L2_FMT_FLAG_COMPRESSED;
        return 0;
index 99f88a05a7c93ed0ed7a301dfa6fade8209b6773..48be0b0ad68081a895e64a12b6f79ffd8747103a 100644 (file)
@@ -140,14 +140,14 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci)
        core->i2c_algo = cx8800_i2c_algo_template;
 
        core->i2c_adap.dev.parent = &pci->dev;
-       strlcpy(core->i2c_adap.name, core->name, sizeof(core->i2c_adap.name));
+       strscpy(core->i2c_adap.name, core->name, sizeof(core->i2c_adap.name));
        core->i2c_adap.owner = THIS_MODULE;
        core->i2c_algo.udelay = i2c_udelay;
        core->i2c_algo.data = core;
        i2c_set_adapdata(&core->i2c_adap, &core->v4l2_dev);
        core->i2c_adap.algo_data = &core->i2c_algo;
        core->i2c_client.adapter = &core->i2c_adap;
-       strlcpy(core->i2c_client.name, "cx88xx internal", I2C_NAME_SIZE);
+       strscpy(core->i2c_client.name, "cx88xx internal", I2C_NAME_SIZE);
 
        cx8800_bit_setscl(core, 1);
        cx8800_bit_setsda(core, 1);
index 2f5debce4905fdf66f7fb1b7f395e3a7ca96fc60..c5cee71d744d1d649819e20165f75fcf257e0e39 100644 (file)
@@ -610,7 +610,7 @@ void cx88_i2c_init_ir(struct cx88_core *core)
                return;
 
        memset(&info, 0, sizeof(struct i2c_board_info));
-       strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
+       strscpy(info.type, "ir_video", I2C_NAME_SIZE);
 
        switch (core->boardnr) {
        case CX88_BOARD_LEADTEK_PVR2000:
@@ -635,7 +635,7 @@ void cx88_i2c_init_ir(struct cx88_core *core)
 
                if (*addrp == 0x71) {
                        /* Hauppauge Z8F0811 */
-                       strlcpy(info.type, "ir_z8f0811_haup", I2C_NAME_SIZE);
+                       strscpy(info.type, "ir_z8f0811_haup", I2C_NAME_SIZE);
                        core->init_data.name = core->board.name;
                        core->init_data.ir_codes = RC_MAP_HAUPPAUGE;
                        core->init_data.type = RC_PROTO_BIT_RC5 |
index 7b113bad70d23b2857dfcf26dd3648d465abffa3..f5d0624023da39da0c08c8126eef50f4ffbb327b 100644 (file)
@@ -811,7 +811,7 @@ int cx88_querycap(struct file *file, struct cx88_core *core,
 {
        struct video_device *vdev = video_devdata(file);
 
-       strlcpy(cap->card, core->board.name, sizeof(cap->card));
+       strscpy(cap->card, core->board.name, sizeof(cap->card));
        cap->device_caps = V4L2_CAP_READWRITE | V4L2_CAP_STREAMING;
        if (core->board.tuner_type != UNSET)
                cap->device_caps |= V4L2_CAP_TUNER;
@@ -853,7 +853,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void  *priv,
        if (unlikely(f->index >= ARRAY_SIZE(formats)))
                return -EINVAL;
 
-       strlcpy(f->description, formats[f->index].name, sizeof(f->description));
+       strscpy(f->description, formats[f->index].name, sizeof(f->description));
        f->pixelformat = formats[f->index].fourcc;
 
        return 0;
index 92876de3841ce4987167c7a59ca91956f47fd87c..e4db636e9fad4959ba2d672ebed91ee43f669b6c 100644 (file)
@@ -114,7 +114,7 @@ int vp3054_i2c_probe(struct cx8802_dev *dev)
        vp3054_i2c->algo = vp3054_i2c_algo_template;
 
        vp3054_i2c->adap.dev.parent = &dev->pci->dev;
-       strlcpy(vp3054_i2c->adap.name, core->name,
+       strscpy(vp3054_i2c->adap.name, core->name,
                sizeof(vp3054_i2c->adap.name));
        vp3054_i2c->adap.owner = THIS_MODULE;
        vp3054_i2c->algo.data = dev;
index 1775c36891ae16786b38f3cf32b79f901a4ba2b5..bf6e1621ad6b3d7dad98d40f52fd87f5fde97b13 100644 (file)
@@ -378,7 +378,7 @@ static int dt3155_enum_input(struct file *filp, void *p,
                snprintf(input->name, sizeof(input->name), "VID%d",
                         input->index);
        else
-               strlcpy(input->name, "J2/VID0", sizeof(input->name));
+               strscpy(input->name, "J2/VID0", sizeof(input->name));
        input->type = V4L2_INPUT_TYPE_CAMERA;
        input->std = V4L2_STD_ALL;
        input->status = 0;
index f0c6374ee58ef293800c5b61fb13f412ed2c49a0..08cf4bf0094166f2881dc78b5d58c36e258b0f04 100644 (file)
@@ -1064,8 +1064,8 @@ static int cio2_v4l2_querycap(struct file *file, void *fh,
 {
        struct cio2_device *cio2 = video_drvdata(file);
 
-       strlcpy(cap->driver, CIO2_NAME, sizeof(cap->driver));
-       strlcpy(cap->card, CIO2_DEVICE_NAME, sizeof(cap->card));
+       strscpy(cap->driver, CIO2_NAME, sizeof(cap->driver));
+       strscpy(cap->card, CIO2_DEVICE_NAME, sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info),
                 "PCI:%s", pci_name(cio2->pci_dev));
 
@@ -1143,7 +1143,7 @@ cio2_video_enum_input(struct file *file, void *fh, struct v4l2_input *input)
        if (input->index > 0)
                return -EINVAL;
 
-       strlcpy(input->name, "camera", sizeof(input->name));
+       strscpy(input->name, "camera", sizeof(input->name));
        input->type = V4L2_INPUT_TYPE_CAMERA;
 
        return 0;
@@ -1783,7 +1783,7 @@ static int cio2_pci_probe(struct pci_dev *pci_dev,
        mutex_init(&cio2->lock);
 
        cio2->media_dev.dev = &cio2->pci_dev->dev;
-       strlcpy(cio2->media_dev.model, CIO2_DEVICE_NAME,
+       strscpy(cio2->media_dev.model, CIO2_DEVICE_NAME,
                sizeof(cio2->media_dev.model));
        snprintf(cio2->media_dev.bus_info, sizeof(cio2->media_dev.bus_info),
                 "PCI:%s", pci_name(cio2->pci_dev));
index c1856f609d2c06f205c25c466b32822c32bed077..0de8a9f5011ab0a78ece14b16ab60c46bffc309a 100644 (file)
@@ -109,7 +109,7 @@ static int snd_ivtv_card_set_names(struct snd_ivtv_card *itvsc)
        struct snd_card *sc = itvsc->sc;
 
        /* sc->driver is used by alsa-lib's configurator: simple, unique */
-       strlcpy(sc->driver, "CX2341[56]", sizeof(sc->driver));
+       strscpy(sc->driver, "CX2341[56]", sizeof(sc->driver));
 
        /* sc->shortname is a symlink in /proc/asound: IVTV-M -> cardN */
        snprintf(sc->shortname,  sizeof(sc->shortname), "IVTV-%d",
index 5326d86fa3753d6d751fd41924ba94940b1c2c02..737c52de755889f9387a964d7e9ef86816d0e5cf 100644 (file)
@@ -350,7 +350,7 @@ int snd_ivtv_pcm_create(struct snd_ivtv_card *itvsc)
                        &snd_ivtv_pcm_capture_ops);
        sp->info_flags = 0;
        sp->private_data = itvsc;
-       strlcpy(sp->name, itv->card_name, sizeof(sp->name));
+       strscpy(sp->name, itv->card_name, sizeof(sp->name));
 
        return 0;
 
index c63792964a03d4f9f5ac5b630dc6ff0ac16c57a7..4ff46a6d05038c0ed961af4e1aea4bcd6420268b 100644 (file)
@@ -1317,8 +1317,8 @@ int ivtv_get_input(struct ivtv *itv, u16 index, struct v4l2_input *input)
        if (index >= itv->nof_inputs)
                return -EINVAL;
        input->index = index;
-       strlcpy(input->name, input_strs[card_input->video_type - 1],
-                       sizeof(input->name));
+       strscpy(input->name, input_strs[card_input->video_type - 1],
+               sizeof(input->name));
        input->type = (card_input->video_type == IVTV_CARD_INPUT_VID_TUNER ?
                        V4L2_INPUT_TYPE_TUNER : V4L2_INPUT_TYPE_CAMERA);
        input->audioset = (1 << itv->nof_audio_inputs) - 1;
@@ -1334,7 +1334,7 @@ int ivtv_get_output(struct ivtv *itv, u16 index, struct v4l2_output *output)
        if (index >= itv->card->nof_outputs)
                return -EINVAL;
        output->index = index;
-       strlcpy(output->name, card_output->name, sizeof(output->name));
+       strscpy(output->name, card_output->name, sizeof(output->name));
        output->type = V4L2_OUTPUT_TYPE_ANALOG;
        output->audioset = 1;
        output->std = V4L2_STD_ALL;
@@ -1353,8 +1353,8 @@ int ivtv_get_audio_input(struct ivtv *itv, u16 index, struct v4l2_audio *audio)
        memset(audio, 0, sizeof(*audio));
        if (index >= itv->nof_audio_inputs)
                return -EINVAL;
-       strlcpy(audio->name, input_strs[aud_input->audio_type - 1],
-                       sizeof(audio->name));
+       strscpy(audio->name, input_strs[aud_input->audio_type - 1],
+               sizeof(audio->name));
        audio->index = index;
        audio->capability = V4L2_AUDCAP_STEREO;
        return 0;
@@ -1365,6 +1365,6 @@ int ivtv_get_audio_output(struct ivtv *itv, u16 index, struct v4l2_audioout *aud
        memset(aud_output, 0, sizeof(*aud_output));
        if (itv->card->video_outputs == NULL || index != 0)
                return -EINVAL;
-       strlcpy(aud_output->name, "A/V Audio Out", sizeof(aud_output->name));
+       strscpy(aud_output->name, "A/V Audio Out", sizeof(aud_output->name));
        return 0;
 }
index e9ce54dd5e011808690bed7aa1a669eee935e9a3..5e4e52147fb71a70e34b7e55be685bf7a747e16b 100644 (file)
@@ -218,7 +218,7 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr)
 
        memset(&info, 0, sizeof(struct i2c_board_info));
        info.platform_data = init_data;
-       strlcpy(info.type, type, I2C_NAME_SIZE);
+       strscpy(info.type, type, I2C_NAME_SIZE);
 
        return i2c_new_probed_device(adap, &info, addr_list, NULL) == NULL ?
               -1 : 0;
@@ -246,7 +246,7 @@ struct i2c_client *ivtv_i2c_new_ir_legacy(struct ivtv *itv)
        };
 
        memset(&info, 0, sizeof(struct i2c_board_info));
-       strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
+       strscpy(info.type, "ir_video", I2C_NAME_SIZE);
        return i2c_new_probed_device(&itv->i2c_adap, &info, addr_list, NULL);
 }
 
index 4cdc6d2be85de973e3548001ba54a3f78c237207..edb85ca9c0c20fb33f8f91d35a4ae64437ba922a 100644 (file)
@@ -747,8 +747,8 @@ static int ivtv_querycap(struct file *file, void *fh, struct v4l2_capability *vc
        struct ivtv *itv = id->itv;
        struct ivtv_stream *s = &itv->streams[id->type];
 
-       strlcpy(vcap->driver, IVTV_DRIVER_NAME, sizeof(vcap->driver));
-       strlcpy(vcap->card, itv->card_name, sizeof(vcap->card));
+       strscpy(vcap->driver, IVTV_DRIVER_NAME, sizeof(vcap->driver));
+       strscpy(vcap->card, itv->card_name, sizeof(vcap->card));
        snprintf(vcap->bus_info, sizeof(vcap->bus_info), "PCI:%s", pci_name(itv->pdev));
        vcap->capabilities = itv->v4l2_cap | V4L2_CAP_DEVICE_CAPS;
        vcap->device_caps = s->caps;
@@ -1227,9 +1227,9 @@ static int ivtv_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
        ivtv_call_all(itv, tuner, g_tuner, vt);
 
        if (vt->type == V4L2_TUNER_RADIO)
-               strlcpy(vt->name, "ivtv Radio Tuner", sizeof(vt->name));
+               strscpy(vt->name, "ivtv Radio Tuner", sizeof(vt->name));
        else
-               strlcpy(vt->name, "ivtv TV Tuner", sizeof(vt->name));
+               strscpy(vt->name, "ivtv TV Tuner", sizeof(vt->name));
        return 0;
 }
 
index 5ddaa8ed11a566c8fcc405ce60c9617c84f91e41..3e02de02ffdd624683da0f74353f7ee28927ccd8 100644 (file)
@@ -624,7 +624,7 @@ static int ivtvfb_get_fix(struct ivtv *itv, struct fb_fix_screeninfo *fix)
 
        IVTVFB_DEBUG_INFO("ivtvfb_get_fix\n");
        memset(fix, 0, sizeof(struct fb_fix_screeninfo));
-       strlcpy(fix->id, "cx23415 TV out", sizeof(fix->id));
+       strscpy(fix->id, "cx23415 TV out", sizeof(fix->id));
        fix->smem_start = oi->video_pbase;
        fix->smem_len = oi->video_buffer_size;
        fix->type = FB_TYPE_PACKED_PIXELS;
index 90273b4d772f809792cb28f4c3db582217d4af4c..7a7afae4c84ce28dc557f551c776a366fdec1f9e 100644 (file)
@@ -765,7 +765,7 @@ static int pt3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        i2c->algo = &pt3_i2c_algo;
        i2c->algo_data = NULL;
        i2c->dev.parent = &pdev->dev;
-       strlcpy(i2c->name, DRV_NAME, sizeof(i2c->name));
+       strscpy(i2c->name, DRV_NAME, sizeof(i2c->name));
        i2c_set_adapdata(i2c, pt3);
        ret = i2c_add_adapter(i2c);
        if (ret < 0)
index 66acfd35ffc601f84f3b8bc718aeb9896402ee17..747a082229dc09208376865f061528b5ef642c5d 100644 (file)
@@ -100,7 +100,7 @@ static int empress_enum_fmt_vid_cap(struct file *file, void  *priv,
        if (f->index != 0)
                return -EINVAL;
 
-       strlcpy(f->description, "MPEG TS", sizeof(f->description));
+       strscpy(f->description, "MPEG TS", sizeof(f->description));
        f->pixelformat = V4L2_PIX_FMT_MPEG;
        f->flags = V4L2_FMT_FLAG_COMPRESSED;
        return 0;
index 2799538e2d7e043ac70a4985daee314a9392f18b..275c5e15181886f20218ca519bc8a6d32a8ca49b 100644 (file)
@@ -435,7 +435,7 @@ static int saa7134_go7007_init(struct saa7134_dev *dev)
 
        go->board_id = GO7007_BOARDID_PCI_VOYAGER;
        snprintf(go->bus_info, sizeof(go->bus_info), "PCI:%s", pci_name(dev->pci));
-       strlcpy(go->name, saa7134_boards[dev->board].name, sizeof(go->name));
+       strscpy(go->name, saa7134_boards[dev->board].name, sizeof(go->name));
        go->hpi_ops = &saa7134_go7007_hpi_ops;
        go->hpi_context = saa;
        saa->dev = dev;
index 0e28c5021ac480f733cace74fa401b252da4d5ab..999b2774b220afb0269d2d1b08cc825b46201689 100644 (file)
@@ -953,7 +953,7 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
 
        memset(&info, 0, sizeof(struct i2c_board_info));
        memset(&dev->init_data, 0, sizeof(dev->init_data));
-       strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
+       strscpy(info.type, "ir_video", I2C_NAME_SIZE);
 
        switch (dev->board) {
        case SAA7134_BOARD_PINNACLE_PCTV_110i:
index 1a50ec9d084f3d6e78fb50ae818b9330071e4ba2..b41de940a1ee07f858d7d9f44c0cde1fd8ab3ab5 100644 (file)
@@ -1503,7 +1503,7 @@ int saa7134_querycap(struct file *file, void *priv,
        unsigned int tuner_type = dev->tuner_type;
 
        strcpy(cap->driver, "saa7134");
-       strlcpy(cap->card, saa7134_boards[dev->board].name,
+       strscpy(cap->card, saa7134_boards[dev->board].name,
                sizeof(cap->card));
        sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci));
 
@@ -1819,7 +1819,7 @@ static int saa7134_enum_fmt_vid_cap(struct file *file, void  *priv,
        if (f->index >= FORMATS)
                return -EINVAL;
 
-       strlcpy(f->description, formats[f->index].name,
+       strscpy(f->description, formats[f->index].name,
                sizeof(f->description));
 
        f->pixelformat = formats[f->index].fourcc;
@@ -1838,7 +1838,7 @@ static int saa7134_enum_fmt_vid_overlay(struct file *file, void  *priv,
        if ((f->index >= FORMATS) || formats[f->index].planar)
                return -EINVAL;
 
-       strlcpy(f->description, formats[f->index].name,
+       strscpy(f->description, formats[f->index].name,
                sizeof(f->description));
 
        f->pixelformat = formats[f->index].fourcc;
index 6b5582b7c5955ca1b514712ac83f60a228f6c16c..44440c6208df3fa66c2fbe5c26430ca72658604b 100644 (file)
@@ -553,7 +553,7 @@ static int vidioc_g_tuner(struct file *file, void *fh, struct v4l2_tuner *t)
        DEB_EE("VIDIOC_G_TUNER: %d\n", t->index);
 
        memset(t, 0, sizeof(*t));
-       strlcpy(t->name, "TV Tuner", sizeof(t->name));
+       strscpy(t->name, "TV Tuner", sizeof(t->name));
        t->type = V4L2_TUNER_ANALOG_TV;
        t->capability = V4L2_TUNER_CAP_NORM | V4L2_TUNER_CAP_STEREO |
                        V4L2_TUNER_CAP_LANG1 | V4L2_TUNER_CAP_LANG2 | V4L2_TUNER_CAP_SAP;
index 4f9f03c3b2523e5485970b7a2a8f78cd8e0f826b..dfb118d7d1ec9d8da27dea14ea76b9c98d3d4265 100644 (file)
@@ -120,7 +120,7 @@ static int si2157_attach(struct saa7164_port *port, struct i2c_adapter *adapter,
 
        memset(&bi, 0, sizeof(bi));
 
-       strlcpy(bi.type, "si2157", I2C_NAME_SIZE);
+       strscpy(bi.type, "si2157", I2C_NAME_SIZE);
        bi.platform_data = cfg;
        bi.addr = addr8bit >> 1;
 
@@ -643,7 +643,7 @@ int saa7164_dvb_register(struct saa7164_port *port)
                        si2168_config.fe = &port->dvb.frontend;
                        si2168_config.ts_mode = SI2168_TS_SERIAL;
                        memset(&info, 0, sizeof(struct i2c_board_info));
-                       strlcpy(info.type, "si2168", I2C_NAME_SIZE);
+                       strscpy(info.type, "si2168", I2C_NAME_SIZE);
                        info.addr = 0xc8 >> 1;
                        info.platform_data = &si2168_config;
                        request_module(info.type);
@@ -663,7 +663,7 @@ int saa7164_dvb_register(struct saa7164_port *port)
                        si2157_config.if_port = 1;
                        si2157_config.fe = port->dvb.frontend;
                        memset(&info, 0, sizeof(struct i2c_board_info));
-                       strlcpy(info.type, "si2157", I2C_NAME_SIZE);
+                       strscpy(info.type, "si2157", I2C_NAME_SIZE);
                        info.addr = 0xc0 >> 1;
                        info.platform_data = &si2157_config;
                        request_module(info.type);
@@ -688,7 +688,7 @@ int saa7164_dvb_register(struct saa7164_port *port)
                        si2168_config.fe = &port->dvb.frontend;
                        si2168_config.ts_mode = SI2168_TS_SERIAL;
                        memset(&info, 0, sizeof(struct i2c_board_info));
-                       strlcpy(info.type, "si2168", I2C_NAME_SIZE);
+                       strscpy(info.type, "si2168", I2C_NAME_SIZE);
                        info.addr = 0xcc >> 1;
                        info.platform_data = &si2168_config;
                        request_module(info.type);
@@ -708,7 +708,7 @@ int saa7164_dvb_register(struct saa7164_port *port)
                        si2157_config.fe = port->dvb.frontend;
                        si2157_config.if_port = 1;
                        memset(&info, 0, sizeof(struct i2c_board_info));
-                       strlcpy(info.type, "si2157", I2C_NAME_SIZE);
+                       strscpy(info.type, "si2157", I2C_NAME_SIZE);
                        info.addr = 0xc0 >> 1;
                        info.platform_data = &si2157_config;
                        request_module(info.type);
index 32136ebe4f61c638c3eaa0e613ff4589655bdccd..50161921e4e7455490834a86e4ffa8caf1941deb 100644 (file)
@@ -498,7 +498,7 @@ static int vidioc_querycap(struct file *file, void  *priv,
        struct saa7164_dev *dev = port->dev;
 
        strcpy(cap->driver, dev->name);
-       strlcpy(cap->card, saa7164_boards[dev->board].name,
+       strscpy(cap->card, saa7164_boards[dev->board].name,
                sizeof(cap->card));
        sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci));
 
@@ -520,7 +520,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void  *priv,
        if (f->index != 0)
                return -EINVAL;
 
-       strlcpy(f->description, "MPEG", sizeof(f->description));
+       strscpy(f->description, "MPEG", sizeof(f->description));
        f->pixelformat = V4L2_PIX_FMT_MPEG;
 
        return 0;
index 6d13cbb9d010d556a34e44bf40d16324532b6258..317f48bc65068a088ae2c7347df022168575f62a 100644 (file)
@@ -99,7 +99,7 @@ int saa7164_i2c_register(struct saa7164_i2c *bus)
 
        bus->i2c_adap.dev.parent = &dev->pci->dev;
 
-       strlcpy(bus->i2c_adap.name, bus->dev->name,
+       strscpy(bus->i2c_adap.name, bus->dev->name,
                sizeof(bus->i2c_adap.name));
 
        bus->i2c_adap.algo_data = bus;
index 221de91a8bae5731a1e046ab77458a4880a9e122..17b7cabf9a1f22e672203ac502f47b6b9c7aef60 100644 (file)
@@ -209,7 +209,7 @@ static int vidioc_querycap(struct file *file, void  *priv,
        struct saa7164_dev *dev = port->dev;
 
        strcpy(cap->driver, dev->name);
-       strlcpy(cap->card, saa7164_boards[dev->board].name,
+       strscpy(cap->card, saa7164_boards[dev->board].name,
                sizeof(cap->card));
        sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci));
 
index 6dbe3b4d09cee5e5d37bc7aac86fdb1db9afbb1a..4c2da27fee4b8bf232da2fa90e2e0d67e6bd8308 100644 (file)
@@ -549,7 +549,7 @@ static int smi_dvbsky_m88ds3103_fe_attach(struct smi_port *port)
        }
        /* attach tuner */
        ts2020_config.fe = port->fe;
-       strlcpy(tuner_info.type, "ts2020", I2C_NAME_SIZE);
+       strscpy(tuner_info.type, "ts2020", I2C_NAME_SIZE);
        tuner_info.addr = 0x60;
        tuner_info.platform_data = &ts2020_config;
        tuner_client = smi_add_i2c_client(tuner_i2c_adapter, &tuner_info);
@@ -605,7 +605,7 @@ static int smi_dvbsky_m88rs6000_fe_attach(struct smi_port *port)
        }
        /* attach tuner */
        m88rs6000t_config.fe = port->fe;
-       strlcpy(tuner_info.type, "m88rs6000t", I2C_NAME_SIZE);
+       strscpy(tuner_info.type, "m88rs6000t", I2C_NAME_SIZE);
        tuner_info.addr = 0x21;
        tuner_info.platform_data = &m88rs6000t_config;
        tuner_client = smi_add_i2c_client(tuner_i2c_adapter, &tuner_info);
@@ -647,7 +647,7 @@ static int smi_dvbsky_sit2_fe_attach(struct smi_port *port)
        si2168_config.ts_mode = SI2168_TS_PARALLEL;
 
        memset(&client_info, 0, sizeof(struct i2c_board_info));
-       strlcpy(client_info.type, "si2168", I2C_NAME_SIZE);
+       strscpy(client_info.type, "si2168", I2C_NAME_SIZE);
        client_info.addr = 0x64;
        client_info.platform_data = &si2168_config;
 
@@ -664,7 +664,7 @@ static int smi_dvbsky_sit2_fe_attach(struct smi_port *port)
        si2157_config.if_port = 1;
 
        memset(&client_info, 0, sizeof(struct i2c_board_info));
-       strlcpy(client_info.type, "si2157", I2C_NAME_SIZE);
+       strscpy(client_info.type, "si2157", I2C_NAME_SIZE);
        client_info.addr = 0x60;
        client_info.platform_data = &si2157_config;
 
index 99ffd1ed4a73a9b56920ceba645b6c2ff473a291..351bc434d3a2c553a22afaa02a3fd4d92732bae0 100644 (file)
@@ -470,7 +470,7 @@ static int solo_enum_fmt_cap(struct file *file, void *priv,
                return -EINVAL;
 
        f->pixelformat = V4L2_PIX_FMT_UYVY;
-       strlcpy(f->description, "UYUV 4:2:2 Packed", sizeof(f->description));
+       strscpy(f->description, "UYUV 4:2:2 Packed", sizeof(f->description));
 
        return 0;
 }
index d6816effb87866b80eae57d7c45004524d8cc031..409defc75c0569caf013976c4cc9ff0a3ec6b803 100644 (file)
@@ -2482,7 +2482,8 @@ static int av7110_attach(struct saa7146_dev* dev,
           get recognized before the main driver is fully loaded */
        saa7146_write(dev, GPIO_CTRL, 0x500000);
 
-       strlcpy(av7110->i2c_adap.name, pci_ext->ext_priv, sizeof(av7110->i2c_adap.name));
+       strscpy(av7110->i2c_adap.name, pci_ext->ext_priv,
+               sizeof(av7110->i2c_adap.name));
 
        saa7146_i2c_adapter_prepare(dev, &av7110->i2c_adap, SAA7146_I2C_BUS_BIT_RATE_120); /* 275 kHz */
 
index b3dc45b91101ddb0861c41de1c083b70aabe1eb7..505356bde14b08674d8d81b0f8555af96cb9236c 100644 (file)
@@ -504,7 +504,8 @@ int ttpci_budget_init(struct budget *budget, struct saa7146_dev *dev,
        if (bi->type != BUDGET_FS_ACTIVY)
                saa7146_write(dev, GPIO_CTRL, 0x500000);        /* GPIO 3 = 1 */
 
-       strlcpy(budget->i2c_adap.name, budget->card->name, sizeof(budget->i2c_adap.name));
+       strscpy(budget->i2c_adap.name, budget->card->name,
+               sizeof(budget->i2c_adap.name));
 
        saa7146_i2c_adapter_prepare(dev, &budget->i2c_adap, SAA7146_I2C_BUS_BIT_RATE_120);
        strcpy(budget->i2c_adap.name, budget->card->name);
index 8c1f4a049764bda53cd98230c5577a640e037896..08e7dd6ecb07a5d6e1c2be858389a3c3bf78e3bc 100644 (file)
@@ -735,7 +735,7 @@ static int tw68_querycap(struct file *file, void  *priv,
        struct tw68_dev *dev = video_drvdata(file);
 
        strcpy(cap->driver, "tw68");
-       strlcpy(cap->card, "Techwell Capture Card",
+       strscpy(cap->card, "Techwell Capture Card",
                sizeof(cap->card));
        sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci));
        cap->device_caps =
@@ -789,7 +789,7 @@ static int tw68_enum_fmt_vid_cap(struct file *file, void  *priv,
        if (f->index >= FORMATS)
                return -EINVAL;
 
-       strlcpy(f->description, formats[f->index].name,
+       strscpy(f->description, formats[f->index].name,
                sizeof(f->description));
 
        f->pixelformat = formats[f->index].fourcc;
index 77190768622a6262418a6e62c7bed5bf341760e1..a28329698e205a86720b519b8e92612abe9e99a3 100644 (file)
@@ -295,7 +295,7 @@ static int tw686x_snd_pcm_init(struct tw686x_dev *dev)
        snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &tw686x_pcm_ops);
        snd_pcm_chip(pcm) = dev;
        pcm->info_flags = 0;
-       strlcpy(pcm->name, "tw686x PCM", sizeof(pcm->name));
+       strscpy(pcm->name, "tw686x PCM", sizeof(pcm->name));
 
        for (i = 0, ss = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream;
             ss; ss = ss->next, i++)
@@ -390,9 +390,9 @@ int tw686x_audio_init(struct tw686x_dev *dev)
                return err;
 
        dev->snd_card = card;
-       strlcpy(card->driver, "tw686x", sizeof(card->driver));
-       strlcpy(card->shortname, "tw686x", sizeof(card->shortname));
-       strlcpy(card->longname, pci_name(pci_dev), sizeof(card->longname));
+       strscpy(card->driver, "tw686x", sizeof(card->driver));
+       strscpy(card->shortname, "tw686x", sizeof(card->shortname));
+       strscpy(card->longname, pci_name(pci_dev), sizeof(card->longname));
        snd_card_set_dev(card, &pci_dev->dev);
 
        for (ch = 0; ch < max_channels(dev); ch++) {
index 3a06c000f97bbf629c8539002cddb7d869baa850..4890b7f1248b1f7cc1ab01b2967808c991142c29 100644 (file)
@@ -765,8 +765,8 @@ static int tw686x_querycap(struct file *file, void *priv,
        struct tw686x_video_channel *vc = video_drvdata(file);
        struct tw686x_dev *dev = vc->dev;
 
-       strlcpy(cap->driver, "tw686x", sizeof(cap->driver));
-       strlcpy(cap->card, dev->name, sizeof(cap->card));
+       strscpy(cap->driver, "tw686x", sizeof(cap->driver));
+       strscpy(cap->card, dev->name, sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info),
                 "PCI:%s", pci_name(dev->pci_dev));
        cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
index b05738a95e55e1dc77449e0780fa6a30b019009f..28590cf3770b2e10b4cbd19acfdbc31a7e3bd0a1 100644 (file)
@@ -1408,8 +1408,8 @@ static int vpfe_querycap(struct file *file, void  *priv,
 
        vpfe_dbg(2, vpfe, "vpfe_querycap\n");
 
-       strlcpy(cap->driver, VPFE_MODULE_NAME, sizeof(cap->driver));
-       strlcpy(cap->card, "TI AM437x VPFE", sizeof(cap->card));
+       strscpy(cap->driver, VPFE_MODULE_NAME, sizeof(cap->driver));
+       strscpy(cap->card, "TI AM437x VPFE", sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info),
                        "platform:%s", vpfe->v4l2_dev.name);
        cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
@@ -2386,7 +2386,7 @@ static int vpfe_probe_complete(struct vpfe_device *vpfe)
        INIT_LIST_HEAD(&vpfe->dma_queue);
 
        vdev = &vpfe->video_dev;
-       strlcpy(vdev->name, VPFE_MODULE_NAME, sizeof(vdev->name));
+       strscpy(vdev->name, VPFE_MODULE_NAME, sizeof(vdev->name));
        vdev->release = video_device_release_empty;
        vdev->fops = &vpfe_fops;
        vdev->ioctl_ops = &vpfe_ioctl_ops;
index d89e14524d427faa94a04f2ae9402d621788270f..776a92d7387fc0cb4aabf0cd40d9ec5c908f7d37 100644 (file)
@@ -1951,7 +1951,7 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier)
        INIT_WORK(&isc->awb_work, isc_awb_work);
 
        /* Register video device */
-       strlcpy(vdev->name, ATMEL_ISC_NAME, sizeof(vdev->name));
+       strscpy(vdev->name, ATMEL_ISC_NAME, sizeof(vdev->name));
        vdev->release           = video_device_release_empty;
        vdev->fops              = &isc_fops;
        vdev->ioctl_ops         = &isc_ioctl_ops;
index e8db4df1e7c41c96e0b9607b8f1506d9d803357e..26874575d3811fb11e26e492981a8c2190046e79 100644 (file)
@@ -655,9 +655,9 @@ static int isi_enum_fmt_vid_cap(struct file *file, void  *priv,
 static int isi_querycap(struct file *file, void *priv,
                        struct v4l2_capability *cap)
 {
-       strlcpy(cap->driver, "atmel-isi", sizeof(cap->driver));
-       strlcpy(cap->card, "Atmel Image Sensor Interface", sizeof(cap->card));
-       strlcpy(cap->bus_info, "platform:isi", sizeof(cap->bus_info));
+       strscpy(cap->driver, "atmel-isi", sizeof(cap->driver));
+       strscpy(cap->card, "Atmel Image Sensor Interface", sizeof(cap->card));
+       strscpy(cap->bus_info, "platform:isi", sizeof(cap->bus_info));
        return 0;
 }
 
@@ -668,7 +668,7 @@ static int isi_enum_input(struct file *file, void *priv,
                return -EINVAL;
 
        i->type = V4L2_INPUT_TYPE_CAMERA;
-       strlcpy(i->name, "Camera", sizeof(i->name));
+       strscpy(i->name, "Camera", sizeof(i->name));
        return 0;
 }
 
@@ -1202,7 +1202,7 @@ static int atmel_isi_probe(struct platform_device *pdev)
        isi->vdev->fops = &isi_fops;
        isi->vdev->v4l2_dev = &isi->v4l2_dev;
        isi->vdev->queue = &isi->queue;
-       strlcpy(isi->vdev->name, KBUILD_MODNAME, sizeof(isi->vdev->name));
+       strscpy(isi->vdev->name, KBUILD_MODNAME, sizeof(isi->vdev->name));
        isi->vdev->release = video_device_release;
        isi->vdev->ioctl_ops = &isi_ioctl_ops;
        isi->vdev->lock = &isi->lock;
index 726b3b93a4863184bb84ee792784d69cdcc39333..0bffa1e02e58be38a56e4e6d01ac143d304adbfd 100644 (file)
@@ -390,10 +390,10 @@ static int coda_querycap(struct file *file, void *priv,
 {
        struct coda_ctx *ctx = fh_to_ctx(priv);
 
-       strlcpy(cap->driver, CODA_NAME, sizeof(cap->driver));
-       strlcpy(cap->card, coda_product_name(ctx->dev->devtype->product),
+       strscpy(cap->driver, CODA_NAME, sizeof(cap->driver));
+       strscpy(cap->card, coda_product_name(ctx->dev->devtype->product),
                sizeof(cap->card));
-       strlcpy(cap->bus_info, "platform:" CODA_NAME, sizeof(cap->bus_info));
+       strscpy(cap->bus_info, "platform:" CODA_NAME, sizeof(cap->bus_info));
        cap->device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
        cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
 
@@ -2408,7 +2408,7 @@ static int coda_register_device(struct coda_dev *dev, int i)
        if (i >= dev->devtype->num_vdevs)
                return -EINVAL;
 
-       strlcpy(vfd->name, dev->devtype->vdevs[i]->name, sizeof(vfd->name));
+       strscpy(vfd->name, dev->devtype->vdevs[i]->name, sizeof(vfd->name));
        vfd->fops       = &coda_fops;
        vfd->ioctl_ops  = &coda_ioctl_ops;
        vfd->release    = video_device_release_empty,
index b0eb3d899eb44bfcca33eac2b50194eeb2b70838..a96c9337ae581dea353cfc8fc3dcf8d36dca09c6 100644 (file)
@@ -647,7 +647,7 @@ static int vpbe_display_querycap(struct file *file, void  *priv,
                dev_name(vpbe_dev->pdev));
        snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
                 dev_name(vpbe_dev->pdev));
-       strlcpy(cap->card, vpbe_dev->cfg->module_name, sizeof(cap->card));
+       strscpy(cap->card, vpbe_dev->cfg->module_name, sizeof(cap->card));
 
        return 0;
 }
index 8613358ed245d75f05c6a528ce62396cc20a5003..ea3ddd5a42bd058e1c35fc6f314d1955eb34aed4 100644 (file)
@@ -889,9 +889,9 @@ static int vpfe_querycap(struct file *file, void  *priv,
 
        cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
        cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
-       strlcpy(cap->driver, CAPTURE_DRV_NAME, sizeof(cap->driver));
-       strlcpy(cap->bus_info, "VPFE", sizeof(cap->bus_info));
-       strlcpy(cap->card, vpfe_dev->cfg->card_name, sizeof(cap->card));
+       strscpy(cap->driver, CAPTURE_DRV_NAME, sizeof(cap->driver));
+       strscpy(cap->bus_info, "VPFE", sizeof(cap->bus_info));
+       strscpy(cap->card, vpfe_dev->cfg->card_name, sizeof(cap->card));
        return 0;
 }
 
index a96f53ce808867f21b6a658532c4264b66704801..f0c2508a6e2e187b938f5688c27242fdfb6a044d 100644 (file)
@@ -1094,10 +1094,10 @@ static int vpif_querycap(struct file *file, void  *priv,
 
        cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
        cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
-       strlcpy(cap->driver, VPIF_DRIVER_NAME, sizeof(cap->driver));
+       strscpy(cap->driver, VPIF_DRIVER_NAME, sizeof(cap->driver));
        snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
                 dev_name(vpif_dev));
-       strlcpy(cap->card, config->card_name, sizeof(cap->card));
+       strscpy(cap->card, config->card_name, sizeof(cap->card));
 
        return 0;
 }
@@ -1463,7 +1463,7 @@ static int vpif_probe_complete(void)
 
                /* Initialize the video_device structure */
                vdev = &ch->video_dev;
-               strlcpy(vdev->name, VPIF_DRIVER_NAME, sizeof(vdev->name));
+               strscpy(vdev->name, VPIF_DRIVER_NAME, sizeof(vdev->name));
                vdev->release = video_device_release_empty;
                vdev->fops = &vpif_fops;
                vdev->ioctl_ops = &vpif_ioctl_ops;
index 0f324055cc9ff21786848a30ab8adcc55dd95d66..fec4341eb93e8efa0f91bcde1f102b34305cbeac 100644 (file)
@@ -586,10 +586,10 @@ static int vpif_querycap(struct file *file, void  *priv,
 
        cap->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
        cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
-       strlcpy(cap->driver, VPIF_DRIVER_NAME, sizeof(cap->driver));
+       strscpy(cap->driver, VPIF_DRIVER_NAME, sizeof(cap->driver));
        snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
                 dev_name(vpif_dev));
-       strlcpy(cap->card, config->card_name, sizeof(cap->card));
+       strscpy(cap->card, config->card_name, sizeof(cap->card));
 
        return 0;
 }
@@ -1209,7 +1209,7 @@ static int vpif_probe_complete(void)
 
                /* Initialize the video_device structure */
                vdev = &ch->video_dev;
-               strlcpy(vdev->name, VPIF_DRIVER_NAME, sizeof(vdev->name));
+               strscpy(vdev->name, VPIF_DRIVER_NAME, sizeof(vdev->name));
                vdev->release = video_device_release_empty;
                vdev->fops = &vpif_fops;
                vdev->ioctl_ops = &vpif_ioctl_ops;
index 17854a379243ce97fa65776320147b7e30749d6a..838c5c53de37d7e92e39926485587c11cb4f93b7 100644 (file)
@@ -339,7 +339,7 @@ int gsc_enum_fmt_mplane(struct v4l2_fmtdesc *f)
        if (!fmt)
                return -EINVAL;
 
-       strlcpy(f->description, fmt->name, sizeof(f->description));
+       strscpy(f->description, fmt->name, sizeof(f->description));
        f->pixelformat = fmt->pixelformat;
 
        return 0;
index c9d2f6c5311a73fd284fe7d7c32d71ba44c844b8..cc5d690818e17d87f901ce10da4e87b31bf4f5f3 100644 (file)
@@ -294,8 +294,8 @@ static int gsc_m2m_querycap(struct file *file, void *fh,
        struct gsc_ctx *ctx = fh_to_ctx(fh);
        struct gsc_dev *gsc = ctx->gsc_dev;
 
-       strlcpy(cap->driver, GSC_MODULE_NAME, sizeof(cap->driver));
-       strlcpy(cap->card, GSC_MODULE_NAME " gscaler", sizeof(cap->card));
+       strscpy(cap->driver, GSC_MODULE_NAME, sizeof(cap->driver));
+       strscpy(cap->card, GSC_MODULE_NAME " gscaler", sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
                 dev_name(&gsc->pdev->dev));
        cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M_MPLANE;
index b90f5bb15517b10692890639c3823e7df512cd2e..76f557548dfcbf588ca654592314093f586ac7d3 100644 (file)
@@ -40,8 +40,8 @@ EXPORT_SYMBOL(fimc_find_remote_sensor);
 void __fimc_vidioc_querycap(struct device *dev, struct v4l2_capability *cap,
                                                unsigned int caps)
 {
-       strlcpy(cap->driver, dev->driver->name, sizeof(cap->driver));
-       strlcpy(cap->card, dev->driver->name, sizeof(cap->card));
+       strscpy(cap->driver, dev->driver->name, sizeof(cap->driver));
+       strscpy(cap->card, dev->driver->name, sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info),
                                "platform:%s", dev_name(dev));
        cap->device_caps = caps;
index a3cdac18819043df209f1b4df6ffaf34833eeef6..f56220e549bb95117cbf4c0cb94113d38d242c5d 100644 (file)
@@ -1087,7 +1087,7 @@ static int fimc_cap_enum_input(struct file *file, void *priv,
        fimc_md_graph_unlock(ve);
 
        if (sd)
-               strlcpy(i->name, sd->name, sizeof(i->name));
+               strscpy(i->name, sd->name, sizeof(i->name));
 
        return 0;
 }
index 70dd4852b2b90ae648f47bb365280b0a9c22feb5..be937caf7645184c681de032b918300edf6fe9f0 100644 (file)
@@ -57,7 +57,7 @@ static int fimc_is_i2c_probe(struct platform_device *pdev)
        i2c_adap = &isp_i2c->adapter;
        i2c_adap->dev.of_node = node;
        i2c_adap->dev.parent = &pdev->dev;
-       strlcpy(i2c_adap->name, "exynos4x12-isp-i2c", sizeof(i2c_adap->name));
+       strscpy(i2c_adap->name, "exynos4x12-isp-i2c", sizeof(i2c_adap->name));
        i2c_adap->owner = THIS_MODULE;
        i2c_adap->algo = &fimc_is_i2c_algorithm;
        i2c_adap->class = I2C_CLASS_SPD;
index a920164f53f1f0ab9de8a9947af72ac6cf653c95..de6bd28f7e313d20332bd3fa24f87c4b422cf189 100644 (file)
@@ -365,7 +365,7 @@ static int isp_video_enum_fmt_mplane(struct file *file, void *priv,
        if (WARN_ON(fmt == NULL))
                return -EINVAL;
 
-       strlcpy(f->description, fmt->name, sizeof(f->description));
+       strscpy(f->description, fmt->name, sizeof(f->description));
        f->pixelformat = fmt->fourcc;
 
        return 0;
index 70d5f5586a5d5ca615a8667d6e8946920d381d51..96f0a8a0dcae591f8a069b565a2ca3cf48976eef 100644 (file)
@@ -654,8 +654,8 @@ static int fimc_lite_querycap(struct file *file, void *priv,
 {
        struct fimc_lite *fimc = video_drvdata(file);
 
-       strlcpy(cap->driver, FIMC_LITE_DRV_NAME, sizeof(cap->driver));
-       strlcpy(cap->card, FIMC_LITE_DRV_NAME, sizeof(cap->card));
+       strscpy(cap->driver, FIMC_LITE_DRV_NAME, sizeof(cap->driver));
+       strscpy(cap->card, FIMC_LITE_DRV_NAME, sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
                                        dev_name(&fimc->pdev->dev));
 
@@ -673,7 +673,7 @@ static int fimc_lite_enum_fmt_mplane(struct file *file, void *priv,
                return -EINVAL;
 
        fmt = &fimc_lite_formats[f->index];
-       strlcpy(f->description, fmt->name, sizeof(f->description));
+       strscpy(f->description, fmt->name, sizeof(f->description));
        f->pixelformat = fmt->fourcc;
 
        return 0;
index deb499f76412a33f139aaedc467e038476f905aa..18a393f51a26dd900225bebbb3e51a323d4c890d 100644 (file)
@@ -1204,9 +1204,9 @@ static ssize_t fimc_md_sysfs_show(struct device *dev,
        struct fimc_md *fmd = dev_get_drvdata(dev);
 
        if (fmd->user_subdev_api)
-               return strlcpy(buf, "Sub-device API (sub-dev)\n", PAGE_SIZE);
+               return strscpy(buf, "Sub-device API (sub-dev)\n", PAGE_SIZE);
 
-       return strlcpy(buf, "V4L2 video node only API (vid-dev)\n", PAGE_SIZE);
+       return strscpy(buf, "V4L2 video node only API (vid-dev)\n", PAGE_SIZE);
 }
 
 static ssize_t fimc_md_sysfs_store(struct device *dev,
@@ -1426,7 +1426,7 @@ static int fimc_md_probe(struct platform_device *pdev)
        INIT_LIST_HEAD(&fmd->pipelines);
        fmd->pdev = pdev;
 
-       strlcpy(fmd->media_dev.model, "SAMSUNG S5P FIMC",
+       strscpy(fmd->media_dev.model, "SAMSUNG S5P FIMC",
                sizeof(fmd->media_dev.model));
        fmd->media_dev.ops = &fimc_md_ops;
        fmd->media_dev.dev = dev;
@@ -1434,7 +1434,7 @@ static int fimc_md_probe(struct platform_device *pdev)
        v4l2_dev = &fmd->v4l2_dev;
        v4l2_dev->mdev = &fmd->media_dev;
        v4l2_dev->notify = fimc_sensor_notify;
-       strlcpy(v4l2_dev->name, "s5p-fimc-md", sizeof(v4l2_dev->name));
+       strscpy(v4l2_dev->name, "s5p-fimc-md", sizeof(v4l2_dev->name));
 
        fmd->use_isp = fimc_md_is_isp_available(dev->of_node);
        fmd->user_subdev_api = true;
index 5f84d2aa47ab88e0d1de3a397f937fdc85d57dbc..c62e598ee7d022f3ae7375f2561ea8177182adb6 100644 (file)
@@ -438,9 +438,9 @@ static void deinterlace_device_run(void *priv)
 static int vidioc_querycap(struct file *file, void *priv,
                           struct v4l2_capability *cap)
 {
-       strlcpy(cap->driver, MEM2MEM_NAME, sizeof(cap->driver));
-       strlcpy(cap->card, MEM2MEM_NAME, sizeof(cap->card));
-       strlcpy(cap->bus_info, MEM2MEM_NAME, sizeof(cap->card));
+       strscpy(cap->driver, MEM2MEM_NAME, sizeof(cap->driver));
+       strscpy(cap->card, MEM2MEM_NAME, sizeof(cap->card));
+       strscpy(cap->bus_info, MEM2MEM_NAME, sizeof(cap->card));
        /*
         * This is only a mem-to-mem video device. The capture and output
         * device capability flags are left only for backward compatibility
@@ -474,7 +474,7 @@ static int enum_fmt(struct v4l2_fmtdesc *f, u32 type)
        if (i < NUM_FORMATS) {
                /* Format found */
                fmt = &formats[i];
-               strlcpy(f->description, fmt->name, sizeof(f->description));
+               strscpy(f->description, fmt->name, sizeof(f->description));
                f->pixelformat = fmt->fourcc;
                return 0;
        }
index dfdbd4354b74cf700305c0b2c70a396938cd039a..c47011194710bb8eee1f94aad7715c9d3eb12aa5 100644 (file)
@@ -1305,7 +1305,7 @@ static int mcam_vidioc_querycap(struct file *file, void *priv,
 
        strcpy(cap->driver, "marvell_ccic");
        strcpy(cap->card, "marvell_ccic");
-       strlcpy(cap->bus_info, cam->bus_info, sizeof(cap->bus_info));
+       strscpy(cap->bus_info, cam->bus_info, sizeof(cap->bus_info));
        cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |
                V4L2_CAP_READWRITE | V4L2_CAP_STREAMING;
        cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
@@ -1318,8 +1318,8 @@ static int mcam_vidioc_enum_fmt_vid_cap(struct file *filp,
 {
        if (fmt->index >= N_MCAM_FMTS)
                return -EINVAL;
-       strlcpy(fmt->description, mcam_formats[fmt->index].desc,
-                       sizeof(fmt->description));
+       strscpy(fmt->description, mcam_formats[fmt->index].desc,
+               sizeof(fmt->description));
        fmt->pixelformat = mcam_formats[fmt->index].pixelformat;
        return 0;
 }
index 6d9f0abb26600534ad29ab83ac5c15686a650e6d..41968cd388ac91b78c8bc8228478bdfa04dac471 100644 (file)
@@ -371,7 +371,7 @@ static int mmpcam_probe(struct platform_device *pdev)
        mcam->lane = pdata->lane;
        mcam->chip_id = MCAM_ARMADA610;
        mcam->buffer_mode = B_DMA_sg;
-       strlcpy(mcam->bus_info, "platform:mmp-camera", sizeof(mcam->bus_info));
+       strscpy(mcam->bus_info, "platform:mmp-camera", sizeof(mcam->bus_info));
        spin_lock_init(&mcam->dev_lock);
        /*
         * Get our I/O memory.
index 4f24da8afecc4db93bbb482fd331daae084dff5b..2a5d5002c27ea8175d699ecb919f4ae2e513c9f3 100644 (file)
@@ -94,8 +94,8 @@ static int mtk_jpeg_querycap(struct file *file, void *priv,
 {
        struct mtk_jpeg_dev *jpeg = video_drvdata(file);
 
-       strlcpy(cap->driver, MTK_JPEG_NAME " decoder", sizeof(cap->driver));
-       strlcpy(cap->card, MTK_JPEG_NAME " decoder", sizeof(cap->card));
+       strscpy(cap->driver, MTK_JPEG_NAME " decoder", sizeof(cap->driver));
+       strscpy(cap->card, MTK_JPEG_NAME " decoder", sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
                 dev_name(jpeg->dev));
 
index ceffc31cc6eb92f32db6e1ad0c0c4fb4b44191c6..51a13466261ef2d4ceaa45532797c36f25d1c4c3 100644 (file)
@@ -619,9 +619,9 @@ static int mtk_mdp_m2m_querycap(struct file *file, void *fh,
        struct mtk_mdp_ctx *ctx = fh_to_ctx(fh);
        struct mtk_mdp_dev *mdp = ctx->mdp_dev;
 
-       strlcpy(cap->driver, MTK_MDP_MODULE_NAME, sizeof(cap->driver));
-       strlcpy(cap->card, mdp->pdev->name, sizeof(cap->card));
-       strlcpy(cap->bus_info, "platform:mt8173", sizeof(cap->bus_info));
+       strscpy(cap->driver, MTK_MDP_MODULE_NAME, sizeof(cap->driver));
+       strscpy(cap->card, mdp->pdev->name, sizeof(cap->card));
+       strscpy(cap->bus_info, "platform:mt8173", sizeof(cap->bus_info));
 
        return 0;
 }
index 0c8a8b4c4e1cf1683cfeb81e732655a9961a3cdf..ba619647bc10e351467ac624f77b813ccf6757a0 100644 (file)
@@ -613,9 +613,9 @@ static int vidioc_vdec_dqbuf(struct file *file, void *priv,
 static int vidioc_vdec_querycap(struct file *file, void *priv,
                                struct v4l2_capability *cap)
 {
-       strlcpy(cap->driver, MTK_VCODEC_DEC_NAME, sizeof(cap->driver));
-       strlcpy(cap->bus_info, MTK_PLATFORM_STR, sizeof(cap->bus_info));
-       strlcpy(cap->card, MTK_PLATFORM_STR, sizeof(cap->card));
+       strscpy(cap->driver, MTK_VCODEC_DEC_NAME, sizeof(cap->driver));
+       strscpy(cap->bus_info, MTK_PLATFORM_STR, sizeof(cap->bus_info));
+       strscpy(cap->card, MTK_PLATFORM_STR, sizeof(cap->card));
 
        return 0;
 }
index 6ad408514a9984b999e0e0f99d9d439311716157..54631ad1c71eb760cc206322eb571203acd217f6 100644 (file)
@@ -222,9 +222,9 @@ static int vidioc_enum_fmt_vid_out_mplane(struct file *file, void *prov,
 static int vidioc_venc_querycap(struct file *file, void *priv,
                                struct v4l2_capability *cap)
 {
-       strlcpy(cap->driver, MTK_VCODEC_ENC_NAME, sizeof(cap->driver));
-       strlcpy(cap->bus_info, MTK_PLATFORM_STR, sizeof(cap->bus_info));
-       strlcpy(cap->card, MTK_PLATFORM_STR, sizeof(cap->card));
+       strscpy(cap->driver, MTK_VCODEC_ENC_NAME, sizeof(cap->driver));
+       strscpy(cap->bus_info, MTK_PLATFORM_STR, sizeof(cap->bus_info));
+       strscpy(cap->card, MTK_PLATFORM_STR, sizeof(cap->card));
 
        return 0;
 }
index 64195c4ddeaf5d3b2f4c682cc4acc5dc3b744014..27b078cf98e35f737cc3f3f433c4627dd48c24e3 100644 (file)
@@ -413,7 +413,7 @@ static int enum_fmt(struct v4l2_fmtdesc *f, u32 type)
        if (i < NUM_FORMATS) {
                /* Format found */
                fmt = &formats[i];
-               strlcpy(f->description, fmt->name, sizeof(f->description) - 1);
+               strscpy(f->description, fmt->name, sizeof(f->description) - 1);
                f->pixelformat = fmt->fourcc;
                return 0;
        }
index 5700b7818621de4d91fa562e3515b2be09c8ba08..f447ae3bb465154922f7950a3f7fb9e2642f847d 100644 (file)
@@ -1041,8 +1041,8 @@ static int vidioc_querycap(struct file *file, void *fh,
 {
        struct omap_vout_device *vout = fh;
 
-       strlcpy(cap->driver, VOUT_NAME, sizeof(cap->driver));
-       strlcpy(cap->card, vout->vfd->name, sizeof(cap->card));
+       strscpy(cap->driver, VOUT_NAME, sizeof(cap->driver));
+       strscpy(cap->card, vout->vfd->name, sizeof(cap->card));
        cap->bus_info[0] = '\0';
        cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_OUTPUT |
                V4L2_CAP_VIDEO_OUTPUT_OVERLAY;
@@ -1060,8 +1060,8 @@ static int vidioc_enum_fmt_vid_out(struct file *file, void *fh,
                return -EINVAL;
 
        fmt->flags = omap_formats[index].flags;
-       strlcpy(fmt->description, omap_formats[index].description,
-                       sizeof(fmt->description));
+       strscpy(fmt->description, omap_formats[index].description,
+               sizeof(fmt->description));
        fmt->pixelformat = omap_formats[index].pixelformat;
 
        return 0;
@@ -1868,7 +1868,7 @@ static int __init omap_vout_setup_video_data(struct omap_vout_device *vout)
        vfd->release = video_device_release;
        vfd->ioctl_ops = &vout_ioctl_ops;
 
-       strlcpy(vfd->name, VOUT_NAME, sizeof(vfd->name));
+       strscpy(vfd->name, VOUT_NAME, sizeof(vfd->name));
 
        vfd->fops = &omap_vout_fops;
        vfd->v4l2_dev = &vout->vid_dev->v4l2_dev;
index 842e2235047d9c6327a65e1ab4fd9ea468fc015a..93f032a39470df2199053758fc4b0ce62798da72 100644 (file)
@@ -1677,7 +1677,7 @@ static int isp_register_entities(struct isp_device *isp)
        int ret;
 
        isp->media_dev.dev = isp->dev;
-       strlcpy(isp->media_dev.model, "TI OMAP3 ISP",
+       strscpy(isp->media_dev.model, "TI OMAP3 ISP",
                sizeof(isp->media_dev.model));
        isp->media_dev.hw_revision = isp->revision;
        isp->media_dev.ops = &isp_media_ops;
index 77b73e27a2746bf086d1bf86c7cb252582c94316..14a1c24037c4a7f12f2d859f8675b28dcdba876f 100644 (file)
@@ -2641,7 +2641,7 @@ static int ccdc_init_entities(struct isp_ccdc_device *ccdc)
 
        v4l2_subdev_init(sd, &ccdc_v4l2_ops);
        sd->internal_ops = &ccdc_v4l2_internal_ops;
-       strlcpy(sd->name, "OMAP3 ISP CCDC", sizeof(sd->name));
+       strscpy(sd->name, "OMAP3 ISP CCDC", sizeof(sd->name));
        sd->grp_id = 1 << 16;   /* group ID for isp subdevs */
        v4l2_set_subdevdata(sd, ccdc);
        sd->flags |= V4L2_SUBDEV_FL_HAS_EVENTS | V4L2_SUBDEV_FL_HAS_DEVNODE;
index e062939d0d054386b533ab8d3ab13afb3bdc1fbf..2dea423ffc0e365baf170185414755390bc78e12 100644 (file)
@@ -1070,7 +1070,7 @@ static int ccp2_init_entities(struct isp_ccp2_device *ccp2)
 
        v4l2_subdev_init(sd, &ccp2_sd_ops);
        sd->internal_ops = &ccp2_sd_internal_ops;
-       strlcpy(sd->name, "OMAP3 ISP CCP2", sizeof(sd->name));
+       strscpy(sd->name, "OMAP3 ISP CCP2", sizeof(sd->name));
        sd->grp_id = 1 << 16;   /* group ID for isp subdevs */
        v4l2_set_subdevdata(sd, ccp2);
        sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
index a4d3d030e81e20568b063d0544d18b64dd3a4d87..9c180f607bcb70ec9dd8c4f4a204fc69479b69a3 100644 (file)
@@ -1234,7 +1234,7 @@ static int csi2_init_entities(struct isp_csi2_device *csi2)
 
        v4l2_subdev_init(sd, &csi2_ops);
        sd->internal_ops = &csi2_internal_ops;
-       strlcpy(sd->name, "OMAP3 ISP CSI2a", sizeof(sd->name));
+       strscpy(sd->name, "OMAP3 ISP CSI2a", sizeof(sd->name));
 
        sd->grp_id = 1 << 16;   /* group ID for isp subdevs */
        v4l2_set_subdevdata(sd, csi2);
index 3195f7c8b8b7e43343af0908ad4a6ac8d0075a27..6ea6aeafd7513a42553d47a91f7c5a59ab8cc02f 100644 (file)
@@ -2267,7 +2267,7 @@ static int preview_init_entities(struct isp_prev_device *prev)
 
        v4l2_subdev_init(sd, &preview_v4l2_ops);
        sd->internal_ops = &preview_v4l2_internal_ops;
-       strlcpy(sd->name, "OMAP3 ISP preview", sizeof(sd->name));
+       strscpy(sd->name, "OMAP3 ISP preview", sizeof(sd->name));
        sd->grp_id = 1 << 16;   /* group ID for isp subdevs */
        v4l2_set_subdevdata(sd, prev);
        sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
index 0b6a87508584f4eb5201f3f2b0bf284c1b7380f7..b281cae036b3d6dd75efd0b858450917364d7098 100644 (file)
@@ -1723,7 +1723,7 @@ static int resizer_init_entities(struct isp_res_device *res)
 
        v4l2_subdev_init(sd, &resizer_v4l2_ops);
        sd->internal_ops = &resizer_v4l2_internal_ops;
-       strlcpy(sd->name, "OMAP3 ISP resizer", sizeof(sd->name));
+       strscpy(sd->name, "OMAP3 ISP resizer", sizeof(sd->name));
        sd->grp_id = 1 << 16;   /* group ID for isp subdevs */
        v4l2_set_subdevdata(sd, res);
        sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
index 9d228eac24ea538c45dac5dd15123193587f0bc4..5658f6a326f77f66ef130cc0a48f002801cc0d86 100644 (file)
@@ -654,9 +654,9 @@ isp_video_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
 {
        struct isp_video *video = video_drvdata(file);
 
-       strlcpy(cap->driver, ISP_VIDEO_DRIVER_NAME, sizeof(cap->driver));
-       strlcpy(cap->card, video->video.name, sizeof(cap->card));
-       strlcpy(cap->bus_info, "media", sizeof(cap->bus_info));
+       strscpy(cap->driver, ISP_VIDEO_DRIVER_NAME, sizeof(cap->driver));
+       strscpy(cap->card, video->video.name, sizeof(cap->card));
+       strscpy(cap->bus_info, "media", sizeof(cap->bus_info));
 
        cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT
                | V4L2_CAP_STREAMING | V4L2_CAP_DEVICE_CAPS;
@@ -1251,7 +1251,7 @@ isp_video_enum_input(struct file *file, void *fh, struct v4l2_input *input)
        if (input->index > 0)
                return -EINVAL;
 
-       strlcpy(input->name, "camera", sizeof(input->name));
+       strscpy(input->name, "camera", sizeof(input->name));
        input->type = V4L2_INPUT_TYPE_CAMERA;
 
        return 0;
index b6e9e93bde7a8ad635a32eab35fc4658610d571a..3288d22de2a02dd270a9bb027235d7552dd9c751 100644 (file)
@@ -1994,9 +1994,9 @@ static int pxac_vidioc_s_fmt_vid_cap(struct file *filp, void *priv,
 static int pxac_vidioc_querycap(struct file *file, void *priv,
                                struct v4l2_capability *cap)
 {
-       strlcpy(cap->bus_info, "platform:pxa-camera", sizeof(cap->bus_info));
-       strlcpy(cap->driver, PXA_CAM_DRV_NAME, sizeof(cap->driver));
-       strlcpy(cap->card, pxa_cam_driver_description, sizeof(cap->card));
+       strscpy(cap->bus_info, "platform:pxa-camera", sizeof(cap->bus_info));
+       strscpy(cap->driver, PXA_CAM_DRV_NAME, sizeof(cap->driver));
+       strscpy(cap->card, pxa_cam_driver_description, sizeof(cap->card));
        cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
        cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
 
@@ -2010,7 +2010,7 @@ static int pxac_vidioc_enum_input(struct file *file, void *priv,
                return -EINVAL;
 
        i->type = V4L2_INPUT_TYPE_CAMERA;
-       strlcpy(i->name, "Camera", sizeof(i->name));
+       strscpy(i->name, "Camera", sizeof(i->name));
 
        return 0;
 }
index c9bb0d023db480d1343b04ec953429996d9606a0..58aebe7114cd7dc5eb259cb4e9645be279c2765a 100644 (file)
@@ -521,8 +521,8 @@ static int video_querycap(struct file *file, void *fh,
 {
        struct camss_video *video = video_drvdata(file);
 
-       strlcpy(cap->driver, "qcom-camss", sizeof(cap->driver));
-       strlcpy(cap->card, "Qualcomm Camera Subsystem", sizeof(cap->card));
+       strscpy(cap->driver, "qcom-camss", sizeof(cap->driver));
+       strscpy(cap->card, "Qualcomm Camera Subsystem", sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
                 dev_name(video->camss->dev));
 
@@ -683,7 +683,7 @@ static int video_enum_input(struct file *file, void *fh,
        if (input->index > 0)
                return -EINVAL;
 
-       strlcpy(input->name, "camera", sizeof(input->name));
+       strscpy(input->name, "camera", sizeof(input->name));
        input->type = V4L2_INPUT_TYPE_CAMERA;
 
        return 0;
@@ -919,7 +919,7 @@ int msm_video_register(struct camss_video *video, struct v4l2_device *v4l2_dev,
        vdev->vfl_dir = VFL_DIR_RX;
        vdev->queue = &video->vb2_q;
        vdev->lock = &video->lock;
-       strlcpy(vdev->name, name, sizeof(vdev->name));
+       strscpy(vdev->name, name, sizeof(vdev->name));
 
        ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
        if (ret < 0) {
index 669615fff6a0819dfa792a9be7253f92b39f79c5..a838a7e560e39a49e17c61197d1befc4fc95613a 100644 (file)
@@ -876,7 +876,7 @@ static int camss_probe(struct platform_device *pdev)
                return ret;
 
        camss->media_dev.dev = camss->dev;
-       strlcpy(camss->media_dev.model, "Qualcomm Camera Subsystem",
+       strscpy(camss->media_dev.model, "Qualcomm Camera Subsystem",
                sizeof(camss->media_dev.model));
        camss->media_dev.ops = &camss_media_ops;
        media_device_init(&camss->media_dev);
index dfbbbf0f746f93e41d9bf39c69ddc066b8f7a4a1..991e1583b92a985a50e7fd089ad0aa6fd00d9fa1 100644 (file)
@@ -341,9 +341,9 @@ vdec_g_selection(struct file *file, void *fh, struct v4l2_selection *s)
 static int
 vdec_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
 {
-       strlcpy(cap->driver, "qcom-venus", sizeof(cap->driver));
-       strlcpy(cap->card, "Qualcomm Venus video decoder", sizeof(cap->card));
-       strlcpy(cap->bus_info, "platform:qcom-venus", sizeof(cap->bus_info));
+       strscpy(cap->driver, "qcom-venus", sizeof(cap->driver));
+       strscpy(cap->card, "Qualcomm Venus video decoder", sizeof(cap->card));
+       strscpy(cap->bus_info, "platform:qcom-venus", sizeof(cap->bus_info));
 
        return 0;
 }
@@ -1153,7 +1153,7 @@ static int vdec_probe(struct platform_device *pdev)
        if (!vdev)
                return -ENOMEM;
 
-       strlcpy(vdev->name, "qcom-venus-decoder", sizeof(vdev->name));
+       strscpy(vdev->name, "qcom-venus-decoder", sizeof(vdev->name));
        vdev->release = video_device_release;
        vdev->fops = &vdec_fops;
        vdev->ioctl_ops = &vdec_ioctl_ops;
index 41249d1443fa18dc1b1d4667ef81f36c3509fa86..ce85962b6adcc31597a6a95cda66d4b345fc8f85 100644 (file)
@@ -273,9 +273,9 @@ static int venc_v4l2_to_hfi(int id, int value)
 static int
 venc_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
 {
-       strlcpy(cap->driver, "qcom-venus", sizeof(cap->driver));
-       strlcpy(cap->card, "Qualcomm Venus video encoder", sizeof(cap->card));
-       strlcpy(cap->bus_info, "platform:qcom-venus", sizeof(cap->bus_info));
+       strscpy(cap->driver, "qcom-venus", sizeof(cap->driver));
+       strscpy(cap->card, "Qualcomm Venus video encoder", sizeof(cap->card));
+       strscpy(cap->bus_info, "platform:qcom-venus", sizeof(cap->bus_info));
 
        return 0;
 }
@@ -1257,7 +1257,7 @@ static int venc_probe(struct platform_device *pdev)
        if (!vdev)
                return -ENOMEM;
 
-       strlcpy(vdev->name, "qcom-venus-encoder", sizeof(vdev->name));
+       strscpy(vdev->name, "qcom-venus-encoder", sizeof(vdev->name));
        vdev->release = video_device_release;
        vdev->fops = &venc_fops;
        vdev->ioctl_ops = &venc_ioctl_ops;
index ce09799976efe1b506598123f9cf82997fb041ca..5dd16af3625c333bc1655d50df3383f19b735898 100644 (file)
@@ -268,8 +268,8 @@ static int rvin_group_init(struct rvin_group *group, struct rvin_dev *vin)
        match = of_match_node(vin->dev->driver->of_match_table,
                              vin->dev->of_node);
 
-       strlcpy(mdev->driver_name, KBUILD_MODNAME, sizeof(mdev->driver_name));
-       strlcpy(mdev->model, match->compatible, sizeof(mdev->model));
+       strscpy(mdev->driver_name, KBUILD_MODNAME, sizeof(mdev->driver_name));
+       strscpy(mdev->model, match->compatible, sizeof(mdev->model));
        snprintf(mdev->bus_info, sizeof(mdev->bus_info), "platform:%s",
                 dev_name(mdev->dev));
 
index 5a54779cfc27f65ddce716b2e784f3fcbd2ee431..dc77682b47857c97b820f17008dbe5f1b9115e26 100644 (file)
@@ -238,8 +238,8 @@ static int rvin_querycap(struct file *file, void *priv,
 {
        struct rvin_dev *vin = video_drvdata(file);
 
-       strlcpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
-       strlcpy(cap->card, "R_Car_VIN", sizeof(cap->card));
+       strscpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
+       strscpy(cap->card, "R_Car_VIN", sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
                 dev_name(vin->dev));
        return 0;
@@ -440,7 +440,7 @@ static int rvin_enum_input(struct file *file, void *priv,
                i->std = vin->vdev.tvnorms;
        }
 
-       strlcpy(i->name, "Camera", sizeof(i->name));
+       strscpy(i->name, "Camera", sizeof(i->name));
 
        return 0;
 }
@@ -714,7 +714,7 @@ static int rvin_mc_enum_input(struct file *file, void *priv,
                return -EINVAL;
 
        i->type = V4L2_INPUT_TYPE_CAMERA;
-       strlcpy(i->name, "Camera", sizeof(i->name));
+       strscpy(i->name, "Camera", sizeof(i->name));
 
        return 0;
 }
index 81413ab52475d4132ef6c0c08f6c034f82395b25..9fa108b23cb32313d744755dca0ee509bcf42d93 100644 (file)
@@ -870,8 +870,8 @@ static int rcar_drif_querycap(struct file *file, void *fh,
 {
        struct rcar_drif_sdr *sdr = video_drvdata(file);
 
-       strlcpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
-       strlcpy(cap->card, sdr->vdev->name, sizeof(cap->card));
+       strscpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
+       strscpy(cap->card, sdr->vdev->name, sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
                 sdr->vdev->name);
 
index 2a15b7cca338fe6445ae11a8ec275c9e40ac1245..6bda1eee91702e5f767d584ce16d9bcf7c4be031 100644 (file)
@@ -1359,8 +1359,8 @@ static void device_frame_end(struct fdp1_dev *fdp1,
 static int fdp1_vidioc_querycap(struct file *file, void *priv,
                           struct v4l2_capability *cap)
 {
-       strlcpy(cap->driver, DRIVER_NAME, sizeof(cap->driver));
-       strlcpy(cap->card, DRIVER_NAME, sizeof(cap->card));
+       strscpy(cap->driver, DRIVER_NAME, sizeof(cap->driver));
+       strscpy(cap->card, DRIVER_NAME, sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info),
                        "platform:%s", DRIVER_NAME);
        return 0;
@@ -2339,7 +2339,7 @@ static int fdp1_probe(struct platform_device *pdev)
        vfd->lock = &fdp1->dev_mutex;
        vfd->v4l2_dev = &fdp1->v4l2_dev;
        video_set_drvdata(vfd, fdp1);
-       strlcpy(vfd->name, fdp1_videodev.name, sizeof(vfd->name));
+       strscpy(vfd->name, fdp1_videodev.name, sizeof(vfd->name));
 
        ret = video_register_device(vfd, VFL_TYPE_GRABBER, 0);
        if (ret) {
index e5c882423f57482304ca52f92863687496fd4803..1dfd2eb65920012e346c30095c08af67740fcfb9 100644 (file)
@@ -664,11 +664,11 @@ static int jpu_querycap(struct file *file, void *priv,
        struct jpu_ctx *ctx = fh_to_ctx(priv);
 
        if (ctx->encoder)
-               strlcpy(cap->card, DRV_NAME " encoder", sizeof(cap->card));
+               strscpy(cap->card, DRV_NAME " encoder", sizeof(cap->card));
        else
-               strlcpy(cap->card, DRV_NAME " decoder", sizeof(cap->card));
+               strscpy(cap->card, DRV_NAME " decoder", sizeof(cap->card));
 
-       strlcpy(cap->driver, DRV_NAME, sizeof(cap->driver));
+       strscpy(cap->driver, DRV_NAME, sizeof(cap->driver));
        snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
                 dev_name(ctx->jpu->dev));
        cap->device_caps |= V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M_MPLANE;
@@ -1654,7 +1654,7 @@ static int jpu_probe(struct platform_device *pdev)
        for (i = 0; i < JPU_MAX_QUALITY; i++)
                jpu_generate_hdr(i, (unsigned char *)jpeg_hdrs[i]);
 
-       strlcpy(jpu->vfd_encoder.name, DRV_NAME, sizeof(jpu->vfd_encoder.name));
+       strscpy(jpu->vfd_encoder.name, DRV_NAME, sizeof(jpu->vfd_encoder.name));
        jpu->vfd_encoder.fops           = &jpu_fops;
        jpu->vfd_encoder.ioctl_ops      = &jpu_ioctl_ops;
        jpu->vfd_encoder.minor          = -1;
@@ -1671,7 +1671,7 @@ static int jpu_probe(struct platform_device *pdev)
 
        video_set_drvdata(&jpu->vfd_encoder, jpu);
 
-       strlcpy(jpu->vfd_decoder.name, DRV_NAME, sizeof(jpu->vfd_decoder.name));
+       strscpy(jpu->vfd_decoder.name, DRV_NAME, sizeof(jpu->vfd_decoder.name));
        jpu->vfd_decoder.fops           = &jpu_fops;
        jpu->vfd_decoder.ioctl_ops      = &jpu_ioctl_ops;
        jpu->vfd_decoder.minor          = -1;
index ad782901cd7a40594e0b7349c41c33691ba30019..b7ae820a2ef6b7adfa306c67a7cded9441e24eb7 100644 (file)
@@ -1137,8 +1137,8 @@ static int ceu_querycap(struct file *file, void *priv,
 {
        struct ceu_device *ceudev = video_drvdata(file);
 
-       strlcpy(cap->card, "Renesas CEU", sizeof(cap->card));
-       strlcpy(cap->driver, DRIVER_NAME, sizeof(cap->driver));
+       strscpy(cap->card, "Renesas CEU", sizeof(cap->card));
+       strscpy(cap->driver, DRIVER_NAME, sizeof(cap->driver));
        snprintf(cap->bus_info, sizeof(cap->bus_info),
                 "platform:renesas-ceu-%s", dev_name(ceudev->dev));
 
@@ -1440,7 +1440,7 @@ static int ceu_notify_complete(struct v4l2_async_notifier *notifier)
                return ret;
 
        /* Register the video device. */
-       strlcpy(vdev->name, DRIVER_NAME, sizeof(vdev->name));
+       strscpy(vdev->name, DRIVER_NAME, sizeof(vdev->name));
        vdev->v4l2_dev          = v4l2_dev;
        vdev->lock              = &ceudev->mlock;
        vdev->queue             = &ceudev->vb2_vq;
index ab5a6f95044a2d0ab5a1b77a7a4e69708945ba73..9cc9db0838702f535cffc91269430e35002862b8 100644 (file)
@@ -447,9 +447,9 @@ static const struct v4l2_file_operations rga_fops = {
 static int
 vidioc_querycap(struct file *file, void *priv, struct v4l2_capability *cap)
 {
-       strlcpy(cap->driver, RGA_NAME, sizeof(cap->driver));
-       strlcpy(cap->card, "rockchip-rga", sizeof(cap->card));
-       strlcpy(cap->bus_info, "platform:rga", sizeof(cap->bus_info));
+       strscpy(cap->driver, RGA_NAME, sizeof(cap->driver));
+       strscpy(cap->card, "rockchip-rga", sizeof(cap->card));
+       strscpy(cap->bus_info, "platform:rga", sizeof(cap->bus_info));
 
        return 0;
 }
index c02dce8b4c6c788ba5dd025fc35b1378a9c466e9..23b008d1a47bb9d1fcc5cd4445084b66a2211400 100644 (file)
@@ -640,8 +640,8 @@ static int s3c_camif_vidioc_querycap(struct file *file, void *priv,
 {
        struct camif_vp *vp = video_drvdata(file);
 
-       strlcpy(cap->driver, S3C_CAMIF_DRIVER_NAME, sizeof(cap->driver));
-       strlcpy(cap->card, S3C_CAMIF_DRIVER_NAME, sizeof(cap->card));
+       strscpy(cap->driver, S3C_CAMIF_DRIVER_NAME, sizeof(cap->driver));
+       strscpy(cap->card, S3C_CAMIF_DRIVER_NAME, sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s.%d",
                 dev_name(vp->camif->dev), vp->id);
 
@@ -661,7 +661,7 @@ static int s3c_camif_vidioc_enum_input(struct file *file, void *priv,
                return -EINVAL;
 
        input->type = V4L2_INPUT_TYPE_CAMERA;
-       strlcpy(input->name, sensor->name, sizeof(input->name));
+       strscpy(input->name, sensor->name, sizeof(input->name));
        return 0;
 }
 
@@ -688,7 +688,7 @@ static int s3c_camif_vidioc_enum_fmt(struct file *file, void *priv,
        if (!fmt)
                return -EINVAL;
 
-       strlcpy(f->description, fmt->name, sizeof(f->description));
+       strscpy(f->description, fmt->name, sizeof(f->description));
        f->pixelformat = fmt->fourcc;
 
        pr_debug("fmt(%d): %s\n", f->index, f->description);
@@ -1555,7 +1555,7 @@ int s3c_camif_create_subdev(struct camif_dev *camif)
 
        v4l2_subdev_init(sd, &s3c_camif_subdev_ops);
        sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
-       strlcpy(sd->name, "S3C-CAMIF", sizeof(sd->name));
+       strscpy(sd->name, "S3C-CAMIF", sizeof(sd->name));
 
        camif->pads[CAMIF_SD_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
        camif->pads[CAMIF_SD_PAD_SOURCE_C].flags = MEDIA_PAD_FL_SOURCE;
index 79bc0ef6bb413d8cd15aaaea3662444d2b047635..31759f16458ed3acdc8de859c5af3585021344ba 100644 (file)
@@ -316,12 +316,12 @@ static int camif_media_dev_init(struct camif_dev *camif)
        memset(md, 0, sizeof(*md));
        snprintf(md->model, sizeof(md->model), "SAMSUNG S3C%s CAMIF",
                 ip_rev == S3C6410_CAMIF_IP_REV ? "6410" : "244X");
-       strlcpy(md->bus_info, "platform", sizeof(md->bus_info));
+       strscpy(md->bus_info, "platform", sizeof(md->bus_info));
        md->hw_revision = ip_rev;
 
        md->dev = camif->dev;
 
-       strlcpy(v4l2_dev->name, "s3c-camif", sizeof(v4l2_dev->name));
+       strscpy(v4l2_dev->name, "s3c-camif", sizeof(v4l2_dev->name));
        v4l2_dev->mdev = md;
 
        media_device_init(md);
index 04fd2e0493c0f9bc1da65603629d3f4645480e0f..3f9000b7038515170ef2e3dd9f9b35feb4a2cfa8 100644 (file)
@@ -1276,14 +1276,14 @@ static int s5p_jpeg_querycap(struct file *file, void *priv,
        struct s5p_jpeg_ctx *ctx = fh_to_ctx(priv);
 
        if (ctx->mode == S5P_JPEG_ENCODE) {
-               strlcpy(cap->driver, S5P_JPEG_M2M_NAME,
+               strscpy(cap->driver, S5P_JPEG_M2M_NAME,
                        sizeof(cap->driver));
-               strlcpy(cap->card, S5P_JPEG_M2M_NAME " encoder",
+               strscpy(cap->card, S5P_JPEG_M2M_NAME " encoder",
                        sizeof(cap->card));
        } else {
-               strlcpy(cap->driver, S5P_JPEG_M2M_NAME,
+               strscpy(cap->driver, S5P_JPEG_M2M_NAME,
                        sizeof(cap->driver));
-               strlcpy(cap->card, S5P_JPEG_M2M_NAME " decoder",
+               strscpy(cap->card, S5P_JPEG_M2M_NAME " decoder",
                        sizeof(cap->card));
        }
        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,
        if (i >= n)
                return -EINVAL;
 
-       strlcpy(f->description, sjpeg_formats[i].name, sizeof(f->description));
+       strscpy(f->description, sjpeg_formats[i].name, sizeof(f->description));
        f->pixelformat = sjpeg_formats[i].fourcc;
 
        return 0;
index 6a3cc4f86c5df586b636dd81d4f81ef548cac4ac..670ca869babb9fb4edd637bc052ec8709150b0f1 100644 (file)
@@ -271,8 +271,8 @@ static int vidioc_querycap(struct file *file, void *priv,
 {
        struct s5p_mfc_dev *dev = video_drvdata(file);
 
-       strlcpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver));
-       strlcpy(cap->card, dev->vfd_dec->name, sizeof(cap->card));
+       strscpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver));
+       strscpy(cap->card, dev->vfd_dec->name, sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
                 dev_name(&dev->plat_dev->dev));
        /*
@@ -308,7 +308,7 @@ static int vidioc_enum_fmt(struct file *file, struct v4l2_fmtdesc *f,
        if (i == ARRAY_SIZE(formats))
                return -EINVAL;
        fmt = &formats[i];
-       strlcpy(f->description, fmt->name, sizeof(f->description));
+       strscpy(f->description, fmt->name, sizeof(f->description));
        f->pixelformat = fmt->fourcc;
        return 0;
 }
index 3ad4f5073002c90ae561f8e142a1d60c44b9badf..7037d48bdc2cf329c368357f12e8b688a154b4e6 100644 (file)
@@ -1313,8 +1313,8 @@ static int vidioc_querycap(struct file *file, void *priv,
 {
        struct s5p_mfc_dev *dev = video_drvdata(file);
 
-       strlcpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver));
-       strlcpy(cap->card, dev->vfd_enc->name, sizeof(cap->card));
+       strscpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver));
+       strscpy(cap->card, dev->vfd_enc->name, sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
                 dev_name(&dev->plat_dev->dev));
        /*
@@ -1344,7 +1344,7 @@ static int vidioc_enum_fmt(struct file *file, struct v4l2_fmtdesc *f,
 
                if (j == f->index) {
                        fmt = &formats[i];
-                       strlcpy(f->description, fmt->name,
+                       strscpy(f->description, fmt->name,
                                sizeof(f->description));
                        f->pixelformat = fmt->fourcc;
                        return 0;
index 1d274c64de09e54ff01b0201b87bc3c791269f04..09ae64a0004c1fdceacedd5c8930476f50931ed2 100644 (file)
@@ -345,9 +345,9 @@ static int sh_veu_context_init(struct sh_veu_dev *veu)
 static int sh_veu_querycap(struct file *file, void *priv,
                           struct v4l2_capability *cap)
 {
-       strlcpy(cap->driver, "sh-veu", sizeof(cap->driver));
-       strlcpy(cap->card, "sh-mobile VEU", sizeof(cap->card));
-       strlcpy(cap->bus_info, "platform:sh-veu", sizeof(cap->bus_info));
+       strscpy(cap->driver, "sh-veu", sizeof(cap->driver));
+       strscpy(cap->card, "sh-mobile VEU", sizeof(cap->card));
+       strscpy(cap->bus_info, "platform:sh-veu", sizeof(cap->bus_info));
        cap->device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
        cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
 
@@ -359,7 +359,8 @@ static int sh_veu_enum_fmt(struct v4l2_fmtdesc *f, const int *fmt, int fmt_num)
        if (f->index >= fmt_num)
                return -EINVAL;
 
-       strlcpy(f->description, sh_veu_fmt[fmt[f->index]].name, sizeof(f->description));
+       strscpy(f->description, sh_veu_fmt[fmt[f->index]].name,
+               sizeof(f->description));
        f->pixelformat = sh_veu_fmt[fmt[f->index]].fourcc;
        return 0;
 }
index 6135e13e24d4879884775fc22d454be362e75064..cee58b125548aa6b5f151c760dd7bd17bbbe2599 100644 (file)
@@ -378,9 +378,9 @@ static int sh_vou_querycap(struct file *file, void  *priv,
 
        dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__);
 
-       strlcpy(cap->card, "SuperH VOU", sizeof(cap->card));
-       strlcpy(cap->driver, "sh-vou", sizeof(cap->driver));
-       strlcpy(cap->bus_info, "platform:sh-vou", sizeof(cap->bus_info));
+       strscpy(cap->card, "SuperH VOU", sizeof(cap->card));
+       strscpy(cap->driver, "sh-vou", sizeof(cap->driver));
+       strscpy(cap->bus_info, "platform:sh-vou", sizeof(cap->bus_info));
        cap->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_READWRITE |
                           V4L2_CAP_STREAMING;
        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,
        dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__);
 
        fmt->type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
-       strlcpy(fmt->description, vou_fmt[fmt->index].desc,
+       strscpy(fmt->description, vou_fmt[fmt->index].desc,
                sizeof(fmt->description));
        fmt->pixelformat = vou_fmt[fmt->index].pfmt;
 
@@ -790,7 +790,7 @@ static int sh_vou_enum_output(struct file *file, void *fh,
 
        if (a->index)
                return -EINVAL;
-       strlcpy(a->name, "Video Out", sizeof(a->name));
+       strscpy(a->name, "Video Out", sizeof(a->name));
        a->type = V4L2_OUTPUT_TYPE_ANALOG;
        a->std = vou_dev->vdev.tvnorms;
        return 0;
index 0a2c0daaffeffbabc547061023832c7b0951578a..6803f744e3077ccf9bcca0da48402d5dde196581 100644 (file)
@@ -1564,9 +1564,9 @@ static __poll_t sh_mobile_ceu_poll(struct file *file, poll_table *pt)
 static int sh_mobile_ceu_querycap(struct soc_camera_host *ici,
                                  struct v4l2_capability *cap)
 {
-       strlcpy(cap->card, "SuperH_Mobile_CEU", sizeof(cap->card));
-       strlcpy(cap->driver, "sh_mobile_ceu", sizeof(cap->driver));
-       strlcpy(cap->bus_info, "platform:sh_mobile_ceu", sizeof(cap->bus_info));
+       strscpy(cap->card, "SuperH_Mobile_CEU", sizeof(cap->card));
+       strscpy(cap->driver, "sh_mobile_ceu", sizeof(cap->driver));
+       strscpy(cap->bus_info, "platform:sh_mobile_ceu", sizeof(cap->bus_info));
        cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
        cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
 
index 66d6136291678cdec5add275d03a1d72213b8213..1a00b1fa79902199e5dd2f25b166492cb51ceca8 100644 (file)
@@ -874,7 +874,7 @@ static int soc_camera_enum_fmt_vid_cap(struct file *file, void  *priv,
        format = icd->user_formats[f->index].host_fmt;
 
        if (format->name)
-               strlcpy(f->description, format->name, sizeof(f->description));
+               strscpy(f->description, format->name, sizeof(f->description));
        f->pixelformat = format->fourcc;
        return 0;
 }
@@ -910,7 +910,7 @@ static int soc_camera_querycap(struct file *file, void  *priv,
 
        WARN_ON(priv != file->private_data);
 
-       strlcpy(cap->driver, ici->drv_name, sizeof(cap->driver));
+       strscpy(cap->driver, ici->drv_name, sizeof(cap->driver));
        return ici->ops->querycap(ici, cap);
 }
 
@@ -2026,7 +2026,7 @@ static int video_dev_create(struct soc_camera_device *icd)
        if (!vdev)
                return -ENOMEM;
 
-       strlcpy(vdev->name, ici->drv_name, sizeof(vdev->name));
+       strscpy(vdev->name, ici->drv_name, sizeof(vdev->name));
 
        vdev->v4l2_dev          = &ici->v4l2_dev;
        vdev->fops              = &soc_camera_fops;
index 6745a6e3f464d57f5c0104570988fa05c79fada0..79fbe1fea95f53aca9daccd70451a59cb751693e 100644 (file)
@@ -156,7 +156,7 @@ static int soc_camera_platform_probe(struct platform_device *pdev)
 
        v4l2_subdev_init(&priv->subdev, &platform_subdev_ops);
        v4l2_set_subdevdata(&priv->subdev, p);
-       strlcpy(priv->subdev.name, dev_name(&pdev->dev),
+       strscpy(priv->subdev.name, dev_name(&pdev->dev),
                sizeof(priv->subdev.name));
 
        return v4l2_device_register_subdev(&ici->v4l2_dev, &priv->subdev);
index 66b64096f5de0e8cc33306af98692d9b4e7b2691..79f7db1a9d1887dbcfa8d59fd30010611334eb5e 100644 (file)
@@ -688,8 +688,8 @@ static int bdisp_querycap(struct file *file, void *fh,
        struct bdisp_ctx *ctx = fh_to_ctx(fh);
        struct bdisp_dev *bdisp = ctx->bdisp_dev;
 
-       strlcpy(cap->driver, bdisp->pdev->name, sizeof(cap->driver));
-       strlcpy(cap->card, bdisp->pdev->name, sizeof(cap->card));
+       strscpy(cap->driver, bdisp->pdev->name, sizeof(cap->driver));
+       strscpy(cap->card, bdisp->pdev->name, sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s%d",
                 BDISP_NAME, bdisp->id);
 
index 0b42acd4e3a6e793650ffd1ec7ba6c05330a5a83..91369fb3ffaa41bf3bdd6822f9d8c86066c39efc 100644 (file)
@@ -385,8 +385,8 @@ static int delta_querycap(struct file *file, void *priv,
        struct delta_ctx *ctx = to_ctx(file->private_data);
        struct delta_dev *delta = ctx->dev;
 
-       strlcpy(cap->driver, DELTA_NAME, sizeof(cap->driver));
-       strlcpy(cap->card, delta->vdev->name, sizeof(cap->card));
+       strscpy(cap->driver, DELTA_NAME, sizeof(cap->driver));
+       strscpy(cap->card, delta->vdev->name, sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
                 delta->pdev->name);
 
index 5a807c7c5e79195da386232d13d56e37015ce868..c42623dccfd60d2192e15da0081e799f3378ef52 100644 (file)
@@ -257,8 +257,8 @@ static int hva_querycap(struct file *file, void *priv,
        struct hva_ctx *ctx = fh_to_ctx(file->private_data);
        struct hva_dev *hva = ctx_to_hdev(ctx);
 
-       strlcpy(cap->driver, HVA_NAME, sizeof(cap->driver));
-       strlcpy(cap->card, hva->vdev->name, sizeof(cap->card));
+       strscpy(cap->driver, HVA_NAME, sizeof(cap->driver));
+       strscpy(cap->card, hva->vdev->name, sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
                 hva->pdev->name);
 
index 721564176d8c07585d1803b35435f7ef8c52afcd..ba3e2eee1d92af259d8e060bc729ed21748a14a0 100644 (file)
@@ -1147,10 +1147,10 @@ static int dcmi_s_selection(struct file *file, void *priv,
 static int dcmi_querycap(struct file *file, void *priv,
                         struct v4l2_capability *cap)
 {
-       strlcpy(cap->driver, DRV_NAME, sizeof(cap->driver));
-       strlcpy(cap->card, "STM32 Camera Memory Interface",
+       strscpy(cap->driver, DRV_NAME, sizeof(cap->driver));
+       strscpy(cap->card, "STM32 Camera Memory Interface",
                sizeof(cap->card));
-       strlcpy(cap->bus_info, "platform:dcmi", sizeof(cap->bus_info));
+       strscpy(cap->bus_info, "platform:dcmi", sizeof(cap->bus_info));
        return 0;
 }
 
@@ -1161,7 +1161,7 @@ static int dcmi_enum_input(struct file *file, void *priv,
                return -EINVAL;
 
        i->type = V4L2_INPUT_TYPE_CAMERA;
-       strlcpy(i->name, "Camera", sizeof(i->name));
+       strscpy(i->name, "Camera", sizeof(i->name));
        return 0;
 }
 
@@ -1736,7 +1736,7 @@ static int dcmi_probe(struct platform_device *pdev)
        dcmi->vdev->fops = &dcmi_fops;
        dcmi->vdev->v4l2_dev = &dcmi->v4l2_dev;
        dcmi->vdev->queue = &dcmi->queue;
-       strlcpy(dcmi->vdev->name, KBUILD_MODNAME, sizeof(dcmi->vdev->name));
+       strscpy(dcmi->vdev->name, KBUILD_MODNAME, sizeof(dcmi->vdev->name));
        dcmi->vdev->release = video_device_release;
        dcmi->vdev->ioctl_ops = &dcmi_ioctl_ops;
        dcmi->vdev->lock = &dcmi->lock;
index d1febe5baa6dd9b45c2482e1e2d32c373bbd355f..c9f54fbcdfe48230794ac0723e040cf494bb95b2 100644 (file)
@@ -912,8 +912,8 @@ static int cal_querycap(struct file *file, void *priv,
 {
        struct cal_ctx *ctx = video_drvdata(file);
 
-       strlcpy(cap->driver, CAL_MODULE_NAME, sizeof(cap->driver));
-       strlcpy(cap->card, CAL_MODULE_NAME, sizeof(cap->card));
+       strscpy(cap->driver, CAL_MODULE_NAME, sizeof(cap->driver));
+       strscpy(cap->card, CAL_MODULE_NAME, sizeof(cap->card));
 
        snprintf(cap->bus_info, sizeof(cap->bus_info),
                 "platform:%s", ctx->v4l2_dev.name);
@@ -1818,7 +1818,7 @@ static int cal_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        /* set pseudo v4l2 device name so we can use v4l2_printk */
-       strlcpy(dev->v4l2_dev.name, CAL_MODULE_NAME,
+       strscpy(dev->v4l2_dev.name, CAL_MODULE_NAME,
                sizeof(dev->v4l2_dev.name));
 
        /* save pdev pointer */
index c8bb82fe0b9df628ff11b086bb1e5d54fb582068..554870e48750fdf15483dca82d696cc53d5f2bb7 100644 (file)
@@ -860,8 +860,8 @@ static int viacam_enum_fmt_vid_cap(struct file *filp, void *priv,
 {
        if (fmt->index >= N_VIA_FMTS)
                return -EINVAL;
-       strlcpy(fmt->description, via_formats[fmt->index].desc,
-                       sizeof(fmt->description));
+       strscpy(fmt->description, via_formats[fmt->index].desc,
+               sizeof(fmt->description));
        fmt->pixelformat = via_formats[fmt->index].pixelformat;
        return 0;
 }
index 11385d44e50041a97fe8b08a01e394929d7e6f3b..a044475d04699211a22bd0bfde02a7c38dd33995 100644 (file)
@@ -1287,7 +1287,7 @@ static int vicodec_probe(struct platform_device *pdev)
 
 #ifdef CONFIG_MEDIA_CONTROLLER
        dev->mdev.dev = &pdev->dev;
-       strlcpy(dev->mdev.model, "vicodec", sizeof(dev->mdev.model));
+       strscpy(dev->mdev.model, "vicodec", sizeof(dev->mdev.model));
        media_device_init(&dev->mdev);
        dev->v4l2_dev.mdev = &dev->mdev;
 #endif
@@ -1315,7 +1315,7 @@ static int vicodec_probe(struct platform_device *pdev)
        vfd = &dev->enc_vfd;
        vfd->lock = &dev->enc_mutex;
        vfd->v4l2_dev = &dev->v4l2_dev;
-       strlcpy(vfd->name, "vicodec-enc", sizeof(vfd->name));
+       strscpy(vfd->name, "vicodec-enc", sizeof(vfd->name));
        v4l2_disable_ioctl(vfd, VIDIOC_DECODER_CMD);
        v4l2_disable_ioctl(vfd, VIDIOC_TRY_DECODER_CMD);
        video_set_drvdata(vfd, dev);
@@ -1332,7 +1332,7 @@ static int vicodec_probe(struct platform_device *pdev)
        vfd = &dev->dec_vfd;
        vfd->lock = &dev->dec_mutex;
        vfd->v4l2_dev = &dev->v4l2_dev;
-       strlcpy(vfd->name, "vicodec-dec", sizeof(vfd->name));
+       strscpy(vfd->name, "vicodec-dec", sizeof(vfd->name));
        v4l2_disable_ioctl(vfd, VIDIOC_ENCODER_CMD);
        v4l2_disable_ioctl(vfd, VIDIOC_TRY_ENCODER_CMD);
        video_set_drvdata(vfd, dev);
index 462099a141e4aaae2da52bedad20d94b5197d554..60c522ee2e0368ea31efb3d0583ef52dfee9447b 100644 (file)
@@ -1038,7 +1038,7 @@ static int vim2m_probe(struct platform_device *pdev)
 
 #ifdef CONFIG_MEDIA_CONTROLLER
        dev->mdev.dev = &pdev->dev;
-       strlcpy(dev->mdev.model, "vim2m", sizeof(dev->mdev.model));
+       strscpy(dev->mdev.model, "vim2m", sizeof(dev->mdev.model));
        media_device_init(&dev->mdev);
        dev->v4l2_dev.mdev = &dev->mdev;
 
index ec68feaac3784242aacae61852fdb0cf0c19cf17..3f7e9ed5663376dfeac8c767875f94ec8535b1f6 100644 (file)
@@ -71,8 +71,8 @@ static int vimc_cap_querycap(struct file *file, void *priv,
 {
        struct vimc_cap_device *vcap = video_drvdata(file);
 
-       strlcpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
-       strlcpy(cap->card, KBUILD_MODNAME, sizeof(cap->card));
+       strscpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
+       strscpy(cap->card, KBUILD_MODNAME, sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info),
                 "platform:%s", vcap->vdev.v4l2_dev->name);
 
@@ -476,7 +476,7 @@ static int vimc_cap_comp_bind(struct device *comp, struct device *master,
        vdev->queue = q;
        vdev->v4l2_dev = v4l2_dev;
        vdev->vfl_dir = VFL_DIR_RX;
-       strlcpy(vdev->name, pdata->entity_name, sizeof(vdev->name));
+       strscpy(vdev->name, pdata->entity_name, sizeof(vdev->name));
        video_set_drvdata(vdev, &vcap->ved);
 
        /* Register the video_device with the v4l2 and the media framework */
index 617415c224fe4943fc1308d9bc3d0be55997f45e..dee1b9dfc4f64ba3a274c8775ad9531a3fa332b4 100644 (file)
@@ -430,7 +430,7 @@ int vimc_ent_sd_register(struct vimc_ent_device *ved,
        sd->entity.function = function;
        sd->entity.ops = &vimc_ent_sd_mops;
        sd->owner = THIS_MODULE;
-       strlcpy(sd->name, name, sizeof(sd->name));
+       strscpy(sd->name, name, sizeof(sd->name));
        v4l2_set_subdevdata(sd, ved);
 
        /* Expose this subdev to user space */
index 9246f265de31b920f2181efe1f305c8b85c66cf4..ce809d2e3d5370e02dc6533f91f0dfb0df0f7370 100644 (file)
@@ -259,7 +259,7 @@ static struct component_match *vimc_add_subdevs(struct vimc_device *vimc)
                dev_dbg(&vimc->pdev.dev, "new pdev for %s\n",
                        vimc->pipe_cfg->ents[i].drv);
 
-               strlcpy(pdata.entity_name, vimc->pipe_cfg->ents[i].name,
+               strscpy(pdata.entity_name, vimc->pipe_cfg->ents[i].name,
                        sizeof(pdata.entity_name));
 
                vimc->subdevs[i] = platform_device_register_data(&vimc->pdev.dev,
@@ -317,7 +317,7 @@ static int vimc_probe(struct platform_device *pdev)
        vimc->v4l2_dev.mdev = &vimc->mdev;
 
        /* Initialize media device */
-       strlcpy(vimc->mdev.model, VIMC_MDEV_MODEL_NAME,
+       strscpy(vimc->mdev.model, VIMC_MDEV_MODEL_NAME,
                sizeof(vimc->mdev.model));
        vimc->mdev.dev = &pdev->dev;
        media_device_init(&vimc->mdev);
index bbbc1b6938a56ba8fa91cb093bb46b70ffc5394f..1a89593b0c86ffe697e58560b7b4ad4b668af04c 100644 (file)
@@ -110,7 +110,7 @@ static int vivid_fb_get_fix(struct vivid_dev *dev, struct fb_fix_screeninfo *fix
 {
        dprintk(dev, 1, "vivid_fb_get_fix\n");
        memset(fix, 0, sizeof(struct fb_fix_screeninfo));
-       strlcpy(fix->id, "vioverlay fb", sizeof(fix->id));
+       strscpy(fix->id, "vioverlay fb", sizeof(fix->id));
        fix->smem_start = dev->video_pbase;
        fix->smem_len = dev->video_buffer_size;
        fix->type = FB_TYPE_PACKED_PIXELS;
index 7c8efe38ff5b781e6346b7b09c59bd2e36338a02..138c7bce68b15c910e507b9d58f97b16cef672fe 100644 (file)
@@ -76,10 +76,10 @@ void vivid_radio_rds_init(struct vivid_dev *dev)
                rds->ta = dev->radio_tx_rds_ta->cur.val;
                rds->tp = dev->radio_tx_rds_tp->cur.val;
                rds->ms = dev->radio_tx_rds_ms->cur.val;
-               strlcpy(rds->psname,
+               strscpy(rds->psname,
                        dev->radio_tx_rds_psname->p_cur.p_char,
                        sizeof(rds->psname));
-               strlcpy(rds->radiotext,
+               strscpy(rds->radiotext,
                        dev->radio_tx_rds_radiotext->p_cur.p_char + alt * 64,
                        sizeof(rds->radiotext));
                v4l2_ctrl_unlock(dev->radio_tx_rds_pi);
index 1f86d7d4f72fa57f45ea6aa20c77aa584d84ec35..232cab508f48b0e9a02934dca6196933b73657a5 100644 (file)
@@ -223,7 +223,7 @@ int vivid_radio_rx_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
        if (vt->index > 0)
                return -EINVAL;
 
-       strlcpy(vt->name, "AM/FM/SW Receiver", sizeof(vt->name));
+       strscpy(vt->name, "AM/FM/SW Receiver", sizeof(vt->name));
        vt->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO |
                         V4L2_TUNER_CAP_FREQ_BANDS | V4L2_TUNER_CAP_RDS |
                         (dev->radio_rx_rds_controls ?
index 1a3749ba5e7e582b6dd9d9af0063d456cc6a18e4..049d40b948bb25276650d8ac6a83c8adf8221e51 100644 (file)
@@ -103,7 +103,7 @@ int vidioc_g_modulator(struct file *file, void *fh, struct v4l2_modulator *a)
        if (a->index > 0)
                return -EINVAL;
 
-       strlcpy(a->name, "AM/FM/SW Transmitter", sizeof(a->name));
+       strscpy(a->name, "AM/FM/SW Transmitter", sizeof(a->name));
        a->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO |
                        V4L2_TUNER_CAP_FREQ_BANDS | V4L2_TUNER_CAP_RDS |
                        (dev->radio_tx_rds_controls ?
index 39ca9a56448c0e79bdaa54e0e5cf862687b7f62c..b5b104ee64c99f4ba31d07ecb96b62ed64d815cb 100644 (file)
@@ -147,11 +147,11 @@ void vivid_rds_gen_fill(struct vivid_rds_gen *rds, unsigned freq,
        snprintf(rds->psname, sizeof(rds->psname), "%6d.%1d",
                 freq / 16, ((freq & 0xf) * 10) / 16);
        if (alt)
-               strlcpy(rds->radiotext,
+               strscpy(rds->radiotext,
                        " The Radio Data System can switch between different Radio Texts ",
                        sizeof(rds->radiotext));
        else
-               strlcpy(rds->radiotext,
+               strscpy(rds->radiotext,
                        "An example of Radio Text as transmitted by the Radio Data System",
                        sizeof(rds->radiotext));
 }
index cfb7cb4d37a875b0715d1b4020a662c0338625eb..200b789a3f211c766bad2d4746738469d322a17b 100644 (file)
@@ -396,7 +396,7 @@ int vivid_sdr_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
 {
        switch (vt->index) {
        case 0:
-               strlcpy(vt->name, "ADC", sizeof(vt->name));
+               strscpy(vt->name, "ADC", sizeof(vt->name));
                vt->type = V4L2_TUNER_ADC;
                vt->capability =
                        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)
                vt->rangehigh = bands_adc[2].rangehigh;
                return 0;
        case 1:
-               strlcpy(vt->name, "RF", sizeof(vt->name));
+               strscpy(vt->name, "RF", sizeof(vt->name));
                vt->type = V4L2_TUNER_RF;
                vt->capability =
                        V4L2_TUNER_CAP_1HZ | V4L2_TUNER_CAP_FREQ_BANDS;
index 1599159f2574e5c1f9dbc9b075bdc05134bb2d5a..f2c37e959bea62b120e306a12d466744abc1c9a5 100644 (file)
@@ -1505,7 +1505,7 @@ int vivid_video_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
                        break;
                }
        }
-       strlcpy(vt->name, "TV Tuner", sizeof(vt->name));
+       strscpy(vt->name, "TV Tuner", sizeof(vt->name));
        return 0;
 }
 
index b6619c9c18bb4adb8416813b4b5a0aa476c095a1..8c9d9d6e5632b52267c2889207bcfde3cedd8c57 100644 (file)
@@ -242,7 +242,7 @@ static int vsp1_create_entities(struct vsp1_device *vsp1)
 
        mdev->dev = vsp1->dev;
        mdev->hw_revision = vsp1->version;
-       strlcpy(mdev->model, vsp1->info->model, sizeof(mdev->model));
+       strscpy(mdev->model, vsp1->info->model, sizeof(mdev->model));
        snprintf(mdev->bus_info, sizeof(mdev->bus_info), "platform:%s",
                 dev_name(mdev->dev));
        media_device_init(mdev);
index 5e15c8ff88d9952486d36f4ea6ad78858de464fa..8b01e99acd20ac0c66aeecb6503e1b1879ef392b 100644 (file)
@@ -429,8 +429,8 @@ static int histo_v4l2_querycap(struct file *file, void *fh,
        cap->device_caps = V4L2_CAP_META_CAPTURE
                         | V4L2_CAP_STREAMING;
 
-       strlcpy(cap->driver, "vsp1", sizeof(cap->driver));
-       strlcpy(cap->card, histo->video.name, sizeof(cap->card));
+       strscpy(cap->driver, "vsp1", sizeof(cap->driver));
+       strscpy(cap->card, histo->video.name, sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
                 dev_name(histo->entity.vsp1->dev));
 
index 81d47a09d7bcc6b88fb58a166cbd447710d19fd5..aa54322dad71c21ab530d908d4d7de1208eb2c3b 100644 (file)
@@ -976,8 +976,8 @@ vsp1_video_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
                cap->device_caps = V4L2_CAP_VIDEO_OUTPUT_MPLANE
                                 | V4L2_CAP_STREAMING;
 
-       strlcpy(cap->driver, "vsp1", sizeof(cap->driver));
-       strlcpy(cap->card, video->video.name, sizeof(cap->card));
+       strscpy(cap->driver, "vsp1", sizeof(cap->driver));
+       strscpy(cap->card, video->video.name, sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
                 dev_name(video->vsp1->dev));
 
index d041f94be832ae62888a1422e25dc70171375031..5d3f627516b273cb6b9ad7ba50586ad776339e14 100644 (file)
@@ -504,8 +504,8 @@ xvip_dma_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
        cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS
                          | dma->xdev->v4l2_caps;
 
-       strlcpy(cap->driver, "xilinx-vipp", sizeof(cap->driver));
-       strlcpy(cap->card, dma->video.name, sizeof(cap->card));
+       strscpy(cap->driver, "xilinx-vipp", sizeof(cap->driver));
+       strscpy(cap->card, dma->video.name, sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s:%u",
                 dma->xdev->dev->of_node->name, dma->port);
 
@@ -527,7 +527,7 @@ xvip_dma_enum_format(struct file *file, void *fh, struct v4l2_fmtdesc *f)
                return -EINVAL;
 
        f->pixelformat = dma->format.pixelformat;
-       strlcpy(f->description, dma->fmtinfo->description,
+       strscpy(f->description, dma->fmtinfo->description,
                sizeof(f->description));
 
        return 0;
index 9c49d1d10bee572066e14d35151595a878f124d9..851d20dcd550757a0613d66e9988670ea69496d9 100644 (file)
@@ -833,7 +833,7 @@ static int xtpg_probe(struct platform_device *pdev)
        v4l2_subdev_init(subdev, &xtpg_ops);
        subdev->dev = &pdev->dev;
        subdev->internal_ops = &xtpg_internal_ops;
-       strlcpy(subdev->name, dev_name(&pdev->dev), sizeof(subdev->name));
+       strscpy(subdev->name, dev_name(&pdev->dev), sizeof(subdev->name));
        v4l2_set_subdevdata(subdev, xtpg);
        subdev->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
        subdev->entity.ops = &xtpg_media_ops;
index 6d95ec1e9a6b4b4450d4c60266c27ac72e807137..5148df007c6e9bbf16d4974000e6f4a012e43732 100644 (file)
@@ -578,7 +578,7 @@ static int xvip_composite_v4l2_init(struct xvip_composite_device *xdev)
        int ret;
 
        xdev->media_dev.dev = xdev->dev;
-       strlcpy(xdev->media_dev.model, "Xilinx Video Composite Device",
+       strscpy(xdev->media_dev.model, "Xilinx Video Composite Device",
                sizeof(xdev->media_dev.model));
        xdev->media_dev.hw_revision = 0;
 
index 8521bb2825e8c639251ec2c842f339eb7efae556..a6f207b448bee1d29f9701fa95d3912ae551b586 100644 (file)
@@ -174,8 +174,8 @@ static int vidioc_querycap(struct file *file, void *priv,
 {
        struct dsbr100_device *radio = video_drvdata(file);
 
-       strlcpy(v->driver, "dsbr100", sizeof(v->driver));
-       strlcpy(v->card, "D-Link R-100 USB FM Radio", sizeof(v->card));
+       strscpy(v->driver, "dsbr100", sizeof(v->driver));
+       strscpy(v->card, "D-Link R-100 USB FM Radio", sizeof(v->card));
        usb_make_path(radio->usbdev, v->bus_info, sizeof(v->bus_info));
        v->device_caps = V4L2_CAP_RADIO | V4L2_CAP_TUNER;
        v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS;
@@ -379,7 +379,8 @@ static int usb_dsbr100_probe(struct usb_interface *intf,
                goto err_reg_ctrl;
        }
        mutex_init(&radio->v4l2_lock);
-       strlcpy(radio->videodev.name, v4l2_dev->name, sizeof(radio->videodev.name));
+       strscpy(radio->videodev.name, v4l2_dev->name,
+               sizeof(radio->videodev.name));
        radio->videodev.v4l2_dev = v4l2_dev;
        radio->videodev.fops = &usb_dsbr100_fops;
        radio->videodev.ioctl_ops = &usb_dsbr100_ioctl_ops;
index 5b82e63885cdd845a744451b0f2ed8f16056c0e2..d12e07e325462a23d70fa2202b9689fd349d249f 100644 (file)
@@ -353,9 +353,9 @@ static ssize_t cadet_read(struct file *file, char __user *data, size_t count, lo
 static int vidioc_querycap(struct file *file, void *priv,
                                struct v4l2_capability *v)
 {
-       strlcpy(v->driver, "ADS Cadet", sizeof(v->driver));
-       strlcpy(v->card, "ADS Cadet", sizeof(v->card));
-       strlcpy(v->bus_info, "ISA:radio-cadet", sizeof(v->bus_info));
+       strscpy(v->driver, "ADS Cadet", sizeof(v->driver));
+       strscpy(v->card, "ADS Cadet", sizeof(v->card));
+       strscpy(v->bus_info, "ISA:radio-cadet", sizeof(v->bus_info));
        v->device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO |
                          V4L2_CAP_READWRITE | V4L2_CAP_RDS_CAPTURE;
        v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS;
@@ -370,7 +370,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
        if (v->index)
                return -EINVAL;
        v->type = V4L2_TUNER_RADIO;
-       strlcpy(v->name, "Radio", sizeof(v->name));
+       strscpy(v->name, "Radio", sizeof(v->name));
        v->capability = bands[0].capability | bands[1].capability;
        v->rangelow = bands[0].rangelow;           /* 520 kHz (start of AM band) */
        v->rangehigh = bands[1].rangehigh;    /* 108.0 MHz (end of FM band) */
@@ -595,7 +595,7 @@ static int __init cadet_init(void)
        struct v4l2_ctrl_handler *hdl;
        int res = -ENODEV;
 
-       strlcpy(v4l2_dev->name, "cadet", sizeof(v4l2_dev->name));
+       strscpy(v4l2_dev->name, "cadet", sizeof(v4l2_dev->name));
        mutex_init(&dev->lock);
 
        /* If a probe was requested then probe ISAPnP first (safest) */
@@ -639,7 +639,7 @@ static int __init cadet_init(void)
        dev->is_fm_band = true;
        dev->curfreq = bands[dev->is_fm_band].rangelow;
        cadet_setfreq(dev, dev->curfreq);
-       strlcpy(dev->vdev.name, v4l2_dev->name, sizeof(dev->vdev.name));
+       strscpy(dev->vdev.name, v4l2_dev->name, sizeof(dev->vdev.name));
        dev->vdev.v4l2_dev = v4l2_dev;
        dev->vdev.fops = &cadet_fops;
        dev->vdev.ioctl_ops = &cadet_ioctl_ops;
index 7312e469e850e8bbb0d3e54f02356de7a96d953e..551de8a45b95445fb78bea9e461649f1d595fee6 100644 (file)
@@ -42,8 +42,8 @@ static int radio_isa_querycap(struct file *file, void  *priv,
 {
        struct radio_isa_card *isa = video_drvdata(file);
 
-       strlcpy(v->driver, isa->drv->driver.driver.name, sizeof(v->driver));
-       strlcpy(v->card, isa->drv->card, sizeof(v->card));
+       strscpy(v->driver, isa->drv->driver.driver.name, sizeof(v->driver));
+       strscpy(v->card, isa->drv->card, sizeof(v->card));
        snprintf(v->bus_info, sizeof(v->bus_info), "ISA:%s", isa->v4l2_dev.name);
 
        v->device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO;
@@ -60,7 +60,7 @@ static int radio_isa_g_tuner(struct file *file, void *priv,
        if (v->index > 0)
                return -EINVAL;
 
-       strlcpy(v->name, "FM", sizeof(v->name));
+       strscpy(v->name, "FM", sizeof(v->name));
        v->type = V4L2_TUNER_RADIO;
        v->rangelow = FREQ_LOW;
        v->rangehigh = FREQ_HIGH;
@@ -198,7 +198,7 @@ static struct radio_isa_card *radio_isa_alloc(struct radio_isa_driver *drv,
        dev_set_drvdata(pdev, isa);
        isa->drv = drv;
        v4l2_dev = &isa->v4l2_dev;
-       strlcpy(v4l2_dev->name, dev_name(pdev), sizeof(v4l2_dev->name));
+       strscpy(v4l2_dev->name, dev_name(pdev), sizeof(v4l2_dev->name));
 
        return isa;
 }
@@ -243,7 +243,7 @@ static int radio_isa_common_probe(struct radio_isa_card *isa,
 
        mutex_init(&isa->lock);
        isa->vdev.lock = &isa->lock;
-       strlcpy(isa->vdev.name, v4l2_dev->name, sizeof(isa->vdev.name));
+       strscpy(isa->vdev.name, v4l2_dev->name, sizeof(isa->vdev.name));
        isa->vdev.v4l2_dev = v4l2_dev;
        isa->vdev.fops = &radio_isa_fops;
        isa->vdev.ioctl_ops = &radio_isa_ioctl_ops;
index f2ea8bc5f5eea11dbd266e881d3e3b8cfe2dd1e0..e9484b01307347feda1c36a817554024be204874 100644 (file)
@@ -174,8 +174,8 @@ static int vidioc_querycap(struct file *file, void *priv,
 {
        struct keene_device *radio = video_drvdata(file);
 
-       strlcpy(v->driver, "radio-keene", sizeof(v->driver));
-       strlcpy(v->card, "Keene FM Transmitter", sizeof(v->card));
+       strscpy(v->driver, "radio-keene", sizeof(v->driver));
+       strscpy(v->card, "Keene FM Transmitter", sizeof(v->card));
        usb_make_path(radio->usbdev, v->bus_info, sizeof(v->bus_info));
        v->device_caps = V4L2_CAP_RADIO | V4L2_CAP_MODULATOR;
        v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS;
@@ -190,7 +190,7 @@ static int vidioc_g_modulator(struct file *file, void *priv,
        if (v->index > 0)
                return -EINVAL;
 
-       strlcpy(v->name, "FM", sizeof(v->name));
+       strscpy(v->name, "FM", sizeof(v->name));
        v->rangelow = FREQ_MIN * FREQ_MUL;
        v->rangehigh = FREQ_MAX * FREQ_MUL;
        v->txsubchans = radio->stereo ? V4L2_TUNER_SUB_STEREO : V4L2_TUNER_SUB_MONO;
@@ -362,7 +362,7 @@ static int usb_keene_probe(struct usb_interface *intf,
 
        radio->v4l2_dev.ctrl_handler = hdl;
        radio->v4l2_dev.release = usb_keene_video_device_release;
-       strlcpy(radio->vdev.name, radio->v4l2_dev.name,
+       strscpy(radio->vdev.name, radio->v4l2_dev.name,
                sizeof(radio->vdev.name));
        radio->vdev.v4l2_dev = &radio->v4l2_dev;
        radio->vdev.fops = &usb_keene_fops;
index fdc481257efddbbf3d45a706b4b4a6d65e66e55c..0a59d97d4627c54540abed48e337c6b733e79a1d 100644 (file)
@@ -197,8 +197,8 @@ static int vidioc_querycap(struct file *file, void *priv,
 {
        struct ma901radio_device *radio = video_drvdata(file);
 
-       strlcpy(v->driver, "radio-ma901", sizeof(v->driver));
-       strlcpy(v->card, "Masterkit MA901 USB FM Radio", sizeof(v->card));
+       strscpy(v->driver, "radio-ma901", sizeof(v->driver));
+       strscpy(v->card, "Masterkit MA901 USB FM Radio", sizeof(v->card));
        usb_make_path(radio->usbdev, v->bus_info, sizeof(v->bus_info));
        v->device_caps = V4L2_CAP_RADIO | V4L2_CAP_TUNER;
        v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS;
@@ -400,7 +400,7 @@ static int usb_ma901radio_probe(struct usb_interface *intf,
 
        radio->v4l2_dev.ctrl_handler = &radio->hdl;
        radio->v4l2_dev.release = usb_ma901radio_release;
-       strlcpy(radio->vdev.name, radio->v4l2_dev.name,
+       strscpy(radio->vdev.name, radio->v4l2_dev.name,
                sizeof(radio->vdev.name));
        radio->vdev.v4l2_dev = &radio->v4l2_dev;
        radio->vdev.fops = &usb_ma901radio_fops;
index e4e7587392469b840cd5c40c38926f7f741a009b..1b97ad2ce7d0a157328dad1c8c0b54ca8a62d7ac 100644 (file)
@@ -142,7 +142,7 @@ static int maxiradio_probe(struct pci_dev *pdev,
        dev->tea.cannot_read_data = true;
        dev->tea.v4l2_dev = v4l2_dev;
        dev->tea.radio_nr = radio_nr;
-       strlcpy(dev->tea.card, "Maxi Radio FM2000", sizeof(dev->tea.card));
+       strscpy(dev->tea.card, "Maxi Radio FM2000", sizeof(dev->tea.card));
        snprintf(dev->tea.bus_info, sizeof(dev->tea.bus_info),
                        "PCI:%s", pci_name(pdev));
 
index 7b35e633118d68952e22ddb60e4869055eb5a478..b626567b75c5a454557e1da7a2398b1bf441d996 100644 (file)
@@ -200,8 +200,8 @@ static int vidioc_querycap(struct file *file, void *priv,
 {
        struct pcm20 *dev = video_drvdata(file);
 
-       strlcpy(v->driver, "Miro PCM20", sizeof(v->driver));
-       strlcpy(v->card, "Miro PCM20", sizeof(v->card));
+       strscpy(v->driver, "Miro PCM20", sizeof(v->driver));
+       strscpy(v->card, "Miro PCM20", sizeof(v->card));
        snprintf(v->bus_info, sizeof(v->bus_info), "ISA:%s", dev->v4l2_dev.name);
        v->device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO | V4L2_CAP_RDS_CAPTURE;
        v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS;
@@ -231,7 +231,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
 
        if (v->index)
                return -EINVAL;
-       strlcpy(v->name, "FM", sizeof(v->name));
+       strscpy(v->name, "FM", sizeof(v->name));
        v->type = V4L2_TUNER_RADIO;
        v->rangelow = 87*16000;
        v->rangehigh = 108*16000;
@@ -443,7 +443,7 @@ static int __init pcm20_init(void)
                         "you must load the snd-miro driver first!\n");
                return -ENODEV;
        }
-       strlcpy(v4l2_dev->name, "radio-miropcm20", sizeof(v4l2_dev->name));
+       strscpy(v4l2_dev->name, "radio-miropcm20", sizeof(v4l2_dev->name));
        mutex_init(&dev->lock);
 
        res = v4l2_device_register(NULL, v4l2_dev);
@@ -474,7 +474,7 @@ static int __init pcm20_init(void)
                v4l2_err(v4l2_dev, "Could not register control\n");
                goto err_hdl;
        }
-       strlcpy(dev->vdev.name, v4l2_dev->name, sizeof(dev->vdev.name));
+       strscpy(dev->vdev.name, v4l2_dev->name, sizeof(dev->vdev.name));
        dev->vdev.v4l2_dev = v4l2_dev;
        dev->vdev.fops = &pcm20_fops;
        dev->vdev.ioctl_ops = &pcm20_ioctl_ops;
index 0f292c6ba338f06e3a03f77bf869ef684d084b43..e7c35b184e21dd828df37d2a55a0baaf77c35ab6 100644 (file)
@@ -266,8 +266,8 @@ static int vidioc_querycap(struct file *file, void *priv,
 {
        struct amradio_device *radio = video_drvdata(file);
 
-       strlcpy(v->driver, "radio-mr800", sizeof(v->driver));
-       strlcpy(v->card, "AverMedia MR 800 USB FM Radio", sizeof(v->card));
+       strscpy(v->driver, "radio-mr800", sizeof(v->driver));
+       strscpy(v->card, "AverMedia MR 800 USB FM Radio", sizeof(v->card));
        usb_make_path(radio->usbdev, v->bus_info, sizeof(v->bus_info));
        v->device_caps = V4L2_CAP_RADIO | V4L2_CAP_TUNER |
                                        V4L2_CAP_HW_FREQ_SEEK;
@@ -547,7 +547,7 @@ static int usb_amradio_probe(struct usb_interface *intf,
 
        radio->v4l2_dev.ctrl_handler = &radio->hdl;
        radio->v4l2_dev.release = usb_amradio_release;
-       strlcpy(radio->vdev.name, radio->v4l2_dev.name,
+       strscpy(radio->vdev.name, radio->v4l2_dev.name,
                sizeof(radio->vdev.name));
        radio->vdev.v4l2_dev = &radio->v4l2_dev;
        radio->vdev.fops = &usb_amradio_fops;
index 9a5079d64c4ab1fa96af7f0a22b0ebdb4793701b..5e782b3c2fa92a5658392652af56e1c6120d9d31 100644 (file)
@@ -181,8 +181,8 @@ static int vidioc_querycap(struct file *file, void *priv,
 {
        struct raremono_device *radio = video_drvdata(file);
 
-       strlcpy(v->driver, "radio-raremono", sizeof(v->driver));
-       strlcpy(v->card, "Thanko's Raremono", sizeof(v->card));
+       strscpy(v->driver, "radio-raremono", sizeof(v->driver));
+       strscpy(v->card, "Thanko's Raremono", sizeof(v->card));
        usb_make_path(radio->usbdev, v->bus_info, sizeof(v->bus_info));
        v->device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO;
        v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS;
@@ -212,7 +212,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
        if (v->index > 0)
                return -EINVAL;
 
-       strlcpy(v->name, "AM/FM/SW", sizeof(v->name));
+       strscpy(v->name, "AM/FM/SW", sizeof(v->name));
        v->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO |
                V4L2_TUNER_CAP_FREQ_BANDS;
        v->rangelow = AM_FREQ_RANGE_LOW * 16;
@@ -338,7 +338,7 @@ static int usb_raremono_probe(struct usb_interface *intf,
 
        mutex_init(&radio->lock);
 
-       strlcpy(radio->vdev.name, radio->v4l2_dev.name,
+       strscpy(radio->vdev.name, radio->v4l2_dev.name,
                sizeof(radio->vdev.name));
        radio->vdev.v4l2_dev = &radio->v4l2_dev;
        radio->vdev.fops = &usb_raremono_fops;
index 4f9b97edd9eb9f7514aae2964933c77afe2d5318..a8fedc96361443d475dcf45e46eec7eed06b9baf 100644 (file)
@@ -129,9 +129,9 @@ static void fmi_set_freq(struct fmi *fmi)
 static int vidioc_querycap(struct file *file, void  *priv,
                                        struct v4l2_capability *v)
 {
-       strlcpy(v->driver, "radio-sf16fmi", sizeof(v->driver));
-       strlcpy(v->card, "SF16-FMI/FMP/FMD radio", sizeof(v->card));
-       strlcpy(v->bus_info, "ISA:radio-sf16fmi", sizeof(v->bus_info));
+       strscpy(v->driver, "radio-sf16fmi", sizeof(v->driver));
+       strscpy(v->card, "SF16-FMI/FMP/FMD radio", sizeof(v->card));
+       strscpy(v->bus_info, "ISA:radio-sf16fmi", sizeof(v->bus_info));
        v->device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO;
        v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS;
        return 0;
@@ -145,7 +145,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
        if (v->index > 0)
                return -EINVAL;
 
-       strlcpy(v->name, "FM", sizeof(v->name));
+       strscpy(v->name, "FM", sizeof(v->name));
        v->type = V4L2_TUNER_RADIO;
        v->rangelow = RSF16_MINFREQ;
        v->rangehigh = RSF16_MAXFREQ;
@@ -315,7 +315,7 @@ static int __init fmi_init(void)
                return -ENODEV;
        }
 
-       strlcpy(v4l2_dev->name, "sf16fmi", sizeof(v4l2_dev->name));
+       strscpy(v4l2_dev->name, "sf16fmi", sizeof(v4l2_dev->name));
        fmi->io = io;
 
        res = v4l2_device_register(NULL, v4l2_dev);
@@ -339,7 +339,7 @@ static int __init fmi_init(void)
                return res;
        }
 
-       strlcpy(fmi->vdev.name, v4l2_dev->name, sizeof(fmi->vdev.name));
+       strscpy(fmi->vdev.name, v4l2_dev->name, sizeof(fmi->vdev.name));
        fmi->vdev.v4l2_dev = v4l2_dev;
        fmi->vdev.fops = &fmi_fops;
        fmi->vdev.ioctl_ops = &fmi_ioctl_ops;
index 7b07d42a9909a7eb05bb2a298c8445745aa0796e..ca8a1c263eac1902e4b421d4aa1a12ab5f903c2d 100644 (file)
@@ -213,8 +213,8 @@ static int fmr2_probe(struct fmr2 *fmr2, struct device *pdev, int io)
                if (io == fmr2_cards[i]->io)
                        return -EBUSY;
 
-       strlcpy(fmr2->v4l2_dev.name, "radio-sf16fmr2",
-                       sizeof(fmr2->v4l2_dev.name)),
+       strscpy(fmr2->v4l2_dev.name, "radio-sf16fmr2",
+               sizeof(fmr2->v4l2_dev.name)),
        fmr2->io = io;
 
        if (!request_region(fmr2->io, 2, fmr2->v4l2_dev.name)) {
@@ -234,7 +234,7 @@ static int fmr2_probe(struct fmr2 *fmr2, struct device *pdev, int io)
        fmr2->tea.radio_nr = radio_nr[num_fmr2_cards];
        fmr2->tea.ops = &fmr2_tea_ops;
        fmr2->tea.ext_init = fmr2_tea_ext_init;
-       strlcpy(fmr2->tea.card, card_name, sizeof(fmr2->tea.card));
+       strscpy(fmr2->tea.card, card_name, sizeof(fmr2->tea.card));
        snprintf(fmr2->tea.bus_info, sizeof(fmr2->tea.bus_info), "%s:%s",
                        fmr2->is_fmd2 ? "PnP" : "ISA", dev_name(pdev));
 
index 22f3466af2b187d1779c1bd81515ae5e85d3f9ad..8230da828d0ee677ec89498b569c6d6fd0c9c472 100644 (file)
@@ -345,7 +345,7 @@ static int usb_shark_probe(struct usb_interface *intf,
        shark->tea.ops = &shark_tea_ops;
        shark->tea.cannot_mute = true;
        shark->tea.has_am = true;
-       strlcpy(shark->tea.card, "Griffin radioSHARK",
+       strscpy(shark->tea.card, "Griffin radioSHARK",
                sizeof(shark->tea.card));
        usb_make_path(shark->usbdev, shark->tea.bus_info,
                sizeof(shark->tea.bus_info));
index 4d1a4b3d669cf5fcdcde0d2b3a882d059baa0acd..d150f12382c60e441e155c63a0ec21276b1d2482 100644 (file)
@@ -310,7 +310,7 @@ static int usb_shark_probe(struct usb_interface *intf,
        shark->tea.ops = &shark_tea_ops;
        shark->tea.has_am = true;
        shark->tea.write_before_read = true;
-       strlcpy(shark->tea.card, "Griffin radioSHARK2",
+       strscpy(shark->tea.card, "Griffin radioSHARK2",
                sizeof(shark->tea.card));
        usb_make_path(shark->usbdev, shark->tea.bus_info,
                sizeof(shark->tea.bus_info));
index b52e678c6901cfa8b115d7790be029cbd37cfc2f..269971145f88d5fd5df50f91bc207ce304c11287 100644 (file)
@@ -340,9 +340,9 @@ static int si476x_radio_querycap(struct file *file, void *priv,
 {
        struct si476x_radio *radio = video_drvdata(file);
 
-       strlcpy(capability->driver, radio->v4l2dev.name,
+       strscpy(capability->driver, radio->v4l2dev.name,
                sizeof(capability->driver));
-       strlcpy(capability->card,   DRIVER_CARD, sizeof(capability->card));
+       strscpy(capability->card,   DRIVER_CARD, sizeof(capability->card));
        snprintf(capability->bus_info, sizeof(capability->bus_info),
                 "platform:%s", radio->v4l2dev.name);
 
@@ -428,15 +428,15 @@ static int si476x_radio_g_tuner(struct file *file, void *priv,
        si476x_core_lock(radio->core);
 
        if (si476x_core_is_a_secondary_tuner(radio->core)) {
-               strlcpy(tuner->name, "FM (secondary)", sizeof(tuner->name));
+               strscpy(tuner->name, "FM (secondary)", sizeof(tuner->name));
                tuner->rxsubchans = 0;
                tuner->rangelow = si476x_bands[SI476X_BAND_FM].rangelow;
        } else if (si476x_core_has_am(radio->core)) {
                if (si476x_core_is_a_primary_tuner(radio->core))
-                       strlcpy(tuner->name, "AM/FM (primary)",
+                       strscpy(tuner->name, "AM/FM (primary)",
                                sizeof(tuner->name));
                else
-                       strlcpy(tuner->name, "AM/FM", sizeof(tuner->name));
+                       strscpy(tuner->name, "AM/FM", sizeof(tuner->name));
 
                tuner->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO
                        | V4L2_TUNER_SUB_RDS;
@@ -446,7 +446,7 @@ static int si476x_radio_g_tuner(struct file *file, void *priv,
 
                tuner->rangelow = si476x_bands[SI476X_BAND_AM].rangelow;
        } else {
-               strlcpy(tuner->name, "FM", sizeof(tuner->name));
+               strscpy(tuner->name, "FM", sizeof(tuner->name));
                tuner->rxsubchans = V4L2_TUNER_SUB_RDS;
                tuner->capability |= V4L2_TUNER_CAP_RDS
                        | V4L2_TUNER_CAP_RDS_BLOCK_IO
index afb763256fd68a9a203f060c104707fe1699a29d..6632be648cea5e15264a9c5420326dec2b1e9920 100644 (file)
@@ -287,8 +287,8 @@ static int vidioc_querycap(struct file *file, void  *priv,
        struct tea5764_device *radio = video_drvdata(file);
        struct video_device *dev = &radio->vdev;
 
-       strlcpy(v->driver, dev->dev.driver->name, sizeof(v->driver));
-       strlcpy(v->card, dev->name, sizeof(v->card));
+       strscpy(v->driver, dev->dev.driver->name, sizeof(v->driver));
+       strscpy(v->card, dev->name, sizeof(v->card));
        snprintf(v->bus_info, sizeof(v->bus_info),
                 "I2C:%s", dev_name(&dev->dev));
        v->device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO;
@@ -305,7 +305,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
        if (v->index > 0)
                return -EINVAL;
 
-       strlcpy(v->name, "FM", sizeof(v->name));
+       strscpy(v->name, "FM", sizeof(v->name));
        v->type = V4L2_TUNER_RADIO;
        tea5764_i2c_read(radio);
        v->rangelow   = FREQ_MIN * FREQ_MUL;
index 04ed1a5d117789bcc598e039144bf7168ed09d90..61f751cf1aa4cf575f132ed49f1f13bf9d687702 100644 (file)
@@ -266,10 +266,10 @@ static int vidioc_querycap(struct file *file, void  *priv,
 {
        struct radio_tea5777 *tea = video_drvdata(file);
 
-       strlcpy(v->driver, tea->v4l2_dev->name, sizeof(v->driver));
-       strlcpy(v->card, tea->card, sizeof(v->card));
+       strscpy(v->driver, tea->v4l2_dev->name, sizeof(v->driver));
+       strscpy(v->card, tea->card, sizeof(v->card));
        strlcat(v->card, " TEA5777", sizeof(v->card));
-       strlcpy(v->bus_info, tea->bus_info, sizeof(v->bus_info));
+       strscpy(v->bus_info, tea->bus_info, sizeof(v->bus_info));
        v->device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO;
        v->device_caps |= V4L2_CAP_HW_FREQ_SEEK;
        v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS;
@@ -304,9 +304,9 @@ static int vidioc_g_tuner(struct file *file, void *priv,
 
        memset(v, 0, sizeof(*v));
        if (tea->has_am)
-               strlcpy(v->name, "AM/FM", sizeof(v->name));
+               strscpy(v->name, "AM/FM", sizeof(v->name));
        else
-               strlcpy(v->name, "FM", sizeof(v->name));
+               strscpy(v->name, "FM", sizeof(v->name));
        v->type = V4L2_TUNER_RADIO;
        v->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO |
                        V4L2_TUNER_CAP_FREQ_BANDS |
@@ -560,7 +560,7 @@ int radio_tea5777_init(struct radio_tea5777 *tea, struct module *owner)
        tea->vd = tea575x_radio;
        video_set_drvdata(&tea->vd, tea);
        mutex_init(&tea->mutex);
-       strlcpy(tea->vd.name, tea->v4l2_dev->name, sizeof(tea->vd.name));
+       strscpy(tea->vd.name, tea->v4l2_dev->name, sizeof(tea->vd.name));
        tea->vd.lock = &tea->mutex;
        tea->vd.v4l2_dev = tea->v4l2_dev;
        tea->fops = tea575x_fops;
index fc4d9a73ab17fc6ce41c466a43e761c2d2ea9576..0eda863124e9358bf594b12c897a824c6eed8b19 100644 (file)
@@ -39,8 +39,8 @@ struct timbradio {
 static int timbradio_vidioc_querycap(struct file *file, void  *priv,
        struct v4l2_capability *v)
 {
-       strlcpy(v->driver, DRIVER_NAME, sizeof(v->driver));
-       strlcpy(v->card, "Timberdale Radio", sizeof(v->card));
+       strscpy(v->driver, DRIVER_NAME, sizeof(v->driver));
+       strscpy(v->card, "Timberdale Radio", sizeof(v->card));
        snprintf(v->bus_info, sizeof(v->bus_info), "platform:"DRIVER_NAME);
        v->device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO;
        v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS;
@@ -115,7 +115,7 @@ static int timbradio_probe(struct platform_device *pdev)
        tr->pdata = *pdata;
        mutex_init(&tr->lock);
 
-       strlcpy(tr->video_dev.name, "Timberdale Radio",
+       strscpy(tr->video_dev.name, "Timberdale Radio",
                sizeof(tr->video_dev.name));
        tr->video_dev.fops = &timbradio_fops;
        tr->video_dev.ioctl_ops = &timbradio_ioctl_ops;
@@ -123,7 +123,7 @@ static int timbradio_probe(struct platform_device *pdev)
        tr->video_dev.minor = -1;
        tr->video_dev.lock = &tr->lock;
 
-       strlcpy(tr->v4l2_dev.name, DRIVER_NAME, sizeof(tr->v4l2_dev.name));
+       strscpy(tr->v4l2_dev.name, DRIVER_NAME, sizeof(tr->v4l2_dev.name));
        err = v4l2_device_register(NULL, &tr->v4l2_dev);
        if (err)
                goto err;
index 11aa94f189cb0f2fd2776e3dc23220942c549f9f..b95704f3cb8bb3e40fdb195c0b747dfdfe5a5e13 100644 (file)
@@ -1286,11 +1286,11 @@ static int wl1273_fm_vidioc_querycap(struct file *file, void *priv,
 
        dev_dbg(radio->dev, "%s\n", __func__);
 
-       strlcpy(capability->driver, WL1273_FM_DRIVER_NAME,
+       strscpy(capability->driver, WL1273_FM_DRIVER_NAME,
                sizeof(capability->driver));
-       strlcpy(capability->card, "Texas Instruments Wl1273 FM Radio",
+       strscpy(capability->card, "Texas Instruments Wl1273 FM Radio",
                sizeof(capability->card));
-       strlcpy(capability->bus_info, radio->bus_type,
+       strscpy(capability->bus_info, radio->bus_type,
                sizeof(capability->bus_info));
 
        capability->device_caps = V4L2_CAP_HW_FREQ_SEEK |
@@ -1488,7 +1488,7 @@ static int wl1273_fm_vidioc_g_audio(struct file *file, void *priv,
        if (audio->index > 1)
                return -EINVAL;
 
-       strlcpy(audio->name, "Radio", sizeof(audio->name));
+       strscpy(audio->name, "Radio", sizeof(audio->name));
        audio->capability = V4L2_AUDCAP_STEREO;
 
        return 0;
@@ -1523,7 +1523,7 @@ static int wl1273_fm_vidioc_g_tuner(struct file *file, void *priv,
        if (tuner->index > 0)
                return -EINVAL;
 
-       strlcpy(tuner->name, WL1273_FM_DRIVER_NAME, sizeof(tuner->name));
+       strscpy(tuner->name, WL1273_FM_DRIVER_NAME, sizeof(tuner->name));
        tuner->type = V4L2_TUNER_RADIO;
 
        tuner->rangelow = WL1273_FREQ(WL1273_BAND_JAPAN_LOW);
@@ -1781,7 +1781,7 @@ static int wl1273_fm_vidioc_g_modulator(struct file *file, void *priv,
 
        dev_dbg(radio->dev, "%s\n", __func__);
 
-       strlcpy(modulator->name, WL1273_FM_DRIVER_NAME,
+       strscpy(modulator->name, WL1273_FM_DRIVER_NAME,
                sizeof(modulator->name));
 
        modulator->rangelow = WL1273_FREQ(WL1273_BAND_JAPAN_LOW);
index e3b3ecd14a4dd38803cec253a5eefc18ef723af4..9751ea1d80be558e11f7aecd00180fd1aeccc0a0 100644 (file)
@@ -229,8 +229,8 @@ static int si470x_fops_release(struct file *file)
 static int si470x_vidioc_querycap(struct file *file, void *priv,
                                  struct v4l2_capability *capability)
 {
-       strlcpy(capability->driver, DRIVER_NAME, sizeof(capability->driver));
-       strlcpy(capability->card, DRIVER_CARD, sizeof(capability->card));
+       strscpy(capability->driver, DRIVER_NAME, sizeof(capability->driver));
+       strscpy(capability->card, DRIVER_CARD, sizeof(capability->card));
        capability->device_caps = V4L2_CAP_HW_FREQ_SEEK | V4L2_CAP_READWRITE |
                V4L2_CAP_TUNER | V4L2_CAP_RADIO | V4L2_CAP_RDS_CAPTURE;
        capability->capabilities = capability->device_caps | V4L2_CAP_DEVICE_CAPS;
index 313a95f195a27235bf2f1545e7bf2e25cde521e1..91d6ef5579f7950cee08d16eed0e075ecc97f422 100644 (file)
@@ -519,8 +519,8 @@ static int si470x_vidioc_querycap(struct file *file, void *priv,
 {
        struct si470x_device *radio = video_drvdata(file);
 
-       strlcpy(capability->driver, DRIVER_NAME, sizeof(capability->driver));
-       strlcpy(capability->card, DRIVER_CARD, sizeof(capability->card));
+       strscpy(capability->driver, DRIVER_NAME, sizeof(capability->driver));
+       strscpy(capability->card, DRIVER_CARD, sizeof(capability->card));
        usb_make_path(radio->usbdev, capability->bus_info,
                        sizeof(capability->bus_info));
        capability->device_caps = V4L2_CAP_HW_FREQ_SEEK | V4L2_CAP_READWRITE |
index 27339ec495f603b87481cef5958b5c7c4c7e6ada..733fcf3933e44c60bdc452534989cbd8c8b525bb 100644 (file)
@@ -67,10 +67,10 @@ static const struct v4l2_file_operations radio_si4713_fops = {
 static int radio_si4713_querycap(struct file *file, void *priv,
                                        struct v4l2_capability *capability)
 {
-       strlcpy(capability->driver, "radio-si4713", sizeof(capability->driver));
-       strlcpy(capability->card, "Silicon Labs Si4713 Modulator",
+       strscpy(capability->driver, "radio-si4713", sizeof(capability->driver));
+       strscpy(capability->card, "Silicon Labs Si4713 Modulator",
                sizeof(capability->card));
-       strlcpy(capability->bus_info, "platform:radio-si4713",
+       strscpy(capability->bus_info, "platform:radio-si4713",
                sizeof(capability->bus_info));
        capability->device_caps = V4L2_CAP_MODULATOR | V4L2_CAP_RDS_OUTPUT;
        capability->capabilities = capability->device_caps | V4L2_CAP_DEVICE_CAPS;
index 1ebbf02171429010e8ee586b2292179edbb5a3de..23065ecce9796c2fe2f473c271e59a4d576d018c 100644 (file)
@@ -67,8 +67,8 @@ static int vidioc_querycap(struct file *file, void *priv,
 {
        struct si4713_usb_device *radio = video_drvdata(file);
 
-       strlcpy(v->driver, "radio-usb-si4713", sizeof(v->driver));
-       strlcpy(v->card, "Si4713 FM Transmitter", sizeof(v->card));
+       strscpy(v->driver, "radio-usb-si4713", sizeof(v->driver));
+       strscpy(v->card, "Si4713 FM Transmitter", sizeof(v->card));
        usb_make_path(radio->usbdev, v->bus_info, sizeof(v->bus_info));
        v->device_caps = V4L2_CAP_MODULATOR | V4L2_CAP_RDS_OUTPUT;
        v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS;
@@ -467,7 +467,7 @@ static int usb_si4713_probe(struct usb_interface *intf,
 
        radio->vdev.ctrl_handler = sd->ctrl_handler;
        radio->v4l2_dev.release = usb_si4713_video_device_release;
-       strlcpy(radio->vdev.name, radio->v4l2_dev.name,
+       strscpy(radio->vdev.name, radio->v4l2_dev.name,
                sizeof(radio->vdev.name));
        radio->vdev.v4l2_dev = &radio->v4l2_dev;
        radio->vdev.fops = &usb_si4713_fops;
index 7412fe1b10c6673336cae5bff37bfa522725e065..f89f83e047416e03387a502797200c2154f6b25b 100644 (file)
@@ -233,10 +233,10 @@ static int vidioc_querycap(struct file *file, void  *priv,
 {
        struct snd_tea575x *tea = video_drvdata(file);
 
-       strlcpy(v->driver, tea->v4l2_dev->name, sizeof(v->driver));
-       strlcpy(v->card, tea->card, sizeof(v->card));
+       strscpy(v->driver, tea->v4l2_dev->name, sizeof(v->driver));
+       strscpy(v->card, tea->card, sizeof(v->card));
        strlcat(v->card, tea->tea5759 ? " TEA5759" : " TEA5757", sizeof(v->card));
-       strlcpy(v->bus_info, tea->bus_info, sizeof(v->bus_info));
+       strscpy(v->bus_info, tea->bus_info, sizeof(v->bus_info));
        v->device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO;
        if (!tea->cannot_read_data)
                v->device_caps |= V4L2_CAP_HW_FREQ_SEEK;
@@ -296,7 +296,7 @@ int snd_tea575x_g_tuner(struct snd_tea575x *tea, struct v4l2_tuner *v)
        snd_tea575x_enum_freq_bands(tea, &band_fm);
 
        memset(v, 0, sizeof(*v));
-       strlcpy(v->name, tea->has_am ? "FM/AM" : "FM", sizeof(v->name));
+       strscpy(v->name, tea->has_am ? "FM/AM" : "FM", sizeof(v->name));
        v->type = V4L2_TUNER_RADIO;
        v->capability = band_fm.capability;
        v->rangelow = tea->has_am ? bands[BAND_AM].rangelow : band_fm.rangelow;
@@ -537,7 +537,7 @@ int snd_tea575x_init(struct snd_tea575x *tea, struct module *owner)
        tea->vd = tea575x_radio;
        video_set_drvdata(&tea->vd, tea);
        mutex_init(&tea->mutex);
-       strlcpy(tea->vd.name, tea->v4l2_dev->name, sizeof(tea->vd.name));
+       strscpy(tea->vd.name, tea->v4l2_dev->name, sizeof(tea->vd.name));
        tea->vd.lock = &tea->mutex;
        tea->vd.v4l2_dev = tea->v4l2_dev;
        tea->fops = tea575x_fops;
index ed210f4c476aa1ac3604e087e7fdb5d5c667d2ec..a76ff2978dfb8a101a8355e2f4e5107eb0b0db0f 100644 (file)
@@ -79,7 +79,7 @@ static int tef6862_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *v)
                return -EINVAL;
 
        /* only support FM for now */
-       strlcpy(v->name, "FM", sizeof(v->name));
+       strscpy(v->name, "FM", sizeof(v->name));
        v->type = V4L2_TUNER_RADIO;
        v->rangelow = TEF6862_LO_FREQ;
        v->rangehigh = TEF6862_HI_FREQ;
index dccdf6558e6ab7ce4e1e613453acdd5558badd3a..c5f433b2471392117b21e2c32f1135426a4a548e 100644 (file)
@@ -190,9 +190,9 @@ release_unlock:
 static int fm_v4l2_vidioc_querycap(struct file *file, void *priv,
                struct v4l2_capability *capability)
 {
-       strlcpy(capability->driver, FM_DRV_NAME, sizeof(capability->driver));
-       strlcpy(capability->card, FM_DRV_CARD_SHORT_NAME,
-                       sizeof(capability->card));
+       strscpy(capability->driver, FM_DRV_NAME, sizeof(capability->driver));
+       strscpy(capability->card, FM_DRV_CARD_SHORT_NAME,
+               sizeof(capability->card));
        sprintf(capability->bus_info, "UART");
        capability->device_caps = V4L2_CAP_HW_FREQ_SEEK | V4L2_CAP_TUNER |
                V4L2_CAP_RADIO | V4L2_CAP_MODULATOR |
@@ -531,7 +531,8 @@ int fm_v4l2_init_video_device(struct fmdev *fmdev, int radio_nr)
        struct v4l2_ctrl *ctrl;
        int ret;
 
-       strlcpy(fmdev->v4l2_dev.name, FM_DRV_NAME, sizeof(fmdev->v4l2_dev.name));
+       strscpy(fmdev->v4l2_dev.name, FM_DRV_NAME,
+               sizeof(fmdev->v4l2_dev.name));
        ret = v4l2_device_register(NULL, &fmdev->v4l2_dev);
        if (ret < 0)
                return ret;
index 8e82610ffaad51e26bfdfb852e27a4e44a782d60..265e91a2a70da146362302cbfcf121a0dbf2a06f 100644 (file)
@@ -862,7 +862,7 @@ static int ati_remote_probe(struct usb_interface *interface,
        ati_remote->interface = interface;
 
        usb_make_path(udev, ati_remote->rc_phys, sizeof(ati_remote->rc_phys));
-       strlcpy(ati_remote->mouse_phys, ati_remote->rc_phys,
+       strscpy(ati_remote->mouse_phys, ati_remote->rc_phys,
                sizeof(ati_remote->mouse_phys));
 
        strlcat(ati_remote->rc_phys, "/input0", sizeof(ati_remote->rc_phys));
index 4c0c8008872aed48b4dac05063eb4c8831f2283b..7f0fc3e12190606c0553b4adee1631b565ccd17e 100644 (file)
@@ -1603,7 +1603,7 @@ static int mceusb_dev_probe(struct usb_interface *intf,
        if (dev->descriptor.iManufacturer
            && usb_string(dev, dev->descriptor.iManufacturer,
                          buf, sizeof(buf)) > 0)
-               strlcpy(name, buf, sizeof(name));
+               strscpy(name, buf, sizeof(name));
        if (dev->descriptor.iProduct
            && usb_string(dev, dev->descriptor.iProduct,
                          buf, sizeof(buf)) > 0)
index c9a70fda88a88bcd02b45137581896857c612bb9..c3e183aabfbe165fad9e350229ab419e16f6a49a 100644 (file)
@@ -396,7 +396,7 @@ static int streamzap_probe(struct usb_interface *intf,
        if (usbdev->descriptor.iManufacturer
            && usb_string(usbdev, usbdev->descriptor.iManufacturer,
                          buf, sizeof(buf)) > 0)
-               strlcpy(name, buf, sizeof(name));
+               strscpy(name, buf, sizeof(name));
 
        if (usbdev->descriptor.iProduct
            && usb_string(usbdev, usbdev->descriptor.iProduct,
index fbec1a13dc6a542ab4d495a8ad469bf2d585540c..91956fb55b75051e4119d18240b1e1b043bb8de3 100644 (file)
@@ -312,7 +312,7 @@ static int e4000_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *v)
 
        dev_dbg(&client->dev, "index=%d\n", v->index);
 
-       strlcpy(v->name, "Elonics E4000", sizeof(v->name));
+       strscpy(v->name, "Elonics E4000", sizeof(v->name));
        v->type = V4L2_TUNER_RF;
        v->capability = V4L2_TUNER_CAP_1HZ | V4L2_TUNER_CAP_FREQ_BANDS;
        v->rangelow  = bands[0].rangelow;
index db26892aac844be91a33c54c5a9c2f74e8d4be1e..dd88cf7148d0b738901ea4ca482ce8206cde2612 100644 (file)
@@ -405,7 +405,7 @@ static int fc2580_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *v)
 
        dev_dbg(&client->dev, "index=%d\n", v->index);
 
-       strlcpy(v->name, "FCI FC2580", sizeof(v->name));
+       strscpy(v->name, "FCI FC2580", sizeof(v->name));
        v->type = V4L2_TUNER_RF;
        v->capability = V4L2_TUNER_CAP_1HZ | V4L2_TUNER_CAP_FREQ_BANDS;
        v->rangelow  = bands[0].rangelow;
index 5de6ed72870853bb39cc7e872621ab4199757f20..331c198c00bb4e904b37a7eb9cf09a495b07f219 100644 (file)
@@ -305,7 +305,7 @@ static int msi001_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *v)
 
        dev_dbg(&spi->dev, "index=%d\n", v->index);
 
-       strlcpy(v->name, "Mirics MSi001", sizeof(v->name));
+       strscpy(v->name, "Mirics MSi001", sizeof(v->name));
        v->type = V4L2_TUNER_RF;
        v->capability = V4L2_TUNER_CAP_1HZ | V4L2_TUNER_CAP_FREQ_BANDS;
        v->rangelow =    49000000;
index 129bf8e1aff8c1003ef97eb18ce1029472ddde46..8b4ce84b6914c3ec0a8fdfdb58ea4a00f9b5e94b 100644 (file)
@@ -636,7 +636,7 @@ struct dvb_frontend *microtune_attach(struct dvb_frontend *fe,
                return NULL;
        }
 
-       strlcpy(fe->ops.tuner_ops.info.name, name,
+       strscpy(fe->ops.tuner_ops.info.name, name,
                sizeof(fe->ops.tuner_ops.info.name));
        tuner_info("microtune %s found, OK\n",name);
        return fe;
index 29c1473f2e9f6448890a451aea9b02112a7a8ca8..d2169bb3111a2817e9f643171cdc61722c9128d2 100644 (file)
@@ -1130,7 +1130,7 @@ struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe,
                                   priv->nr, dtv_input[priv->nr]);
        }
 
-       strlcpy(fe->ops.tuner_ops.info.name, priv->tun->name,
+       strscpy(fe->ops.tuner_ops.info.name, priv->tun->name,
                sizeof(fe->ops.tuner_ops.info.name));
 
        return fe;
index e70c9e2f3798de12a3f75b2bef86dc007e5170ad..41fa0f93143d45c81eb3c70a4e028a4efc191cc4 100644 (file)
@@ -619,8 +619,8 @@ static int airspy_querycap(struct file *file, void *fh,
 {
        struct airspy *s = video_drvdata(file);
 
-       strlcpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
-       strlcpy(cap->card, s->vdev.name, sizeof(cap->card));
+       strscpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
+       strscpy(cap->card, s->vdev.name, sizeof(cap->card));
        usb_make_path(s->udev, cap->bus_info, sizeof(cap->bus_info));
        cap->device_caps = V4L2_CAP_SDR_CAPTURE | V4L2_CAP_STREAMING |
                        V4L2_CAP_READWRITE | V4L2_CAP_TUNER;
@@ -635,7 +635,7 @@ static int airspy_enum_fmt_sdr_cap(struct file *file, void *priv,
        if (f->index >= NUM_FORMATS)
                return -EINVAL;
 
-       strlcpy(f->description, formats[f->index].name, sizeof(f->description));
+       strscpy(f->description, formats[f->index].name, sizeof(f->description));
        f->pixelformat = formats[f->index].pixelformat;
 
        return 0;
@@ -720,14 +720,14 @@ static int airspy_g_tuner(struct file *file, void *priv, struct v4l2_tuner *v)
        int ret;
 
        if (v->index == 0) {
-               strlcpy(v->name, "AirSpy ADC", sizeof(v->name));
+               strscpy(v->name, "AirSpy ADC", sizeof(v->name));
                v->type = V4L2_TUNER_ADC;
                v->capability = V4L2_TUNER_CAP_1HZ | V4L2_TUNER_CAP_FREQ_BANDS;
                v->rangelow  = bands[0].rangelow;
                v->rangehigh = bands[0].rangehigh;
                ret = 0;
        } else if (v->index == 1) {
-               strlcpy(v->name, "AirSpy RF", sizeof(v->name));
+               strscpy(v->name, "AirSpy RF", sizeof(v->name));
                v->type = V4L2_TUNER_RF;
                v->capability = V4L2_TUNER_CAP_1HZ | V4L2_TUNER_CAP_FREQ_BANDS;
                v->rangelow  = bands_rf[0].rangelow;
index 1b8ec5d9e7ab8aca9f9dff2cdbe25fdf7fdee130..92df5b5463aff2845d6eab0b980fc414ca22d66b 100644 (file)
@@ -378,7 +378,7 @@ int au0828_i2c_register(struct au0828_dev *dev)
 
        dev->i2c_adap.dev.parent = &dev->usbdev->dev;
 
-       strlcpy(dev->i2c_adap.name, KBUILD_MODNAME,
+       strscpy(dev->i2c_adap.name, KBUILD_MODNAME,
                sizeof(dev->i2c_adap.name));
 
        dev->i2c_adap.algo = &dev->i2c_algo;
index 62b45062b1e685ebdc3dd271c439c57d78a90812..aa25c19437adae8154a8808a509181f80d064e99 100644 (file)
@@ -1191,8 +1191,8 @@ static int vidioc_querycap(struct file *file, void  *priv,
        dprintk(1, "%s called std_set %d dev_state %ld\n", __func__,
                dev->std_set_in_tuner_core, dev->dev_state);
 
-       strlcpy(cap->driver, "au0828", sizeof(cap->driver));
-       strlcpy(cap->card, dev->board.name, sizeof(cap->card));
+       strscpy(cap->driver, "au0828", sizeof(cap->driver));
+       strscpy(cap->card, dev->board.name, sizeof(cap->card));
        usb_make_path(dev->usbdev, cap->bus_info, sizeof(cap->bus_info));
 
        /* set the device capabilities */
index 2f3b0564d676d3d4927e8d9aa8573cdd13b1a486..f700ec35b7f3956eb191a7eb93de69dfb8570951 100644 (file)
@@ -1583,7 +1583,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void  *priv,
        if (f->index != 0)
                return -EINVAL;
 
-       strlcpy(f->description, "MPEG", sizeof(f->description));
+       strscpy(f->description, "MPEG", sizeof(f->description));
        f->pixelformat = V4L2_PIX_FMT_MPEG;
 
        return 0;
index 3e9b73a6b7c93f72dbf78e3f799423d1dcac0d90..9f88c640ec2b34a416e16caa982f7072410f5baa 100644 (file)
@@ -67,7 +67,7 @@ int cx231xx_ir_init(struct cx231xx *dev)
 
        dev->init_data.name = cx231xx_boards[dev->model].name;
 
-       strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
+       strscpy(info.type, "ir_video", I2C_NAME_SIZE);
        info.platform_data = &dev->init_data;
 
        /*
index f7fcd733a2ca8de24360a30fc5e08a6d80902589..7759bc66f18c675bf1aed201b1472abfd83f6c63 100644 (file)
@@ -1354,22 +1354,22 @@ int cx231xx_g_chip_info(struct file *file, void *fh,
        case 0: /* Cx231xx - internal registers */
                return 0;
        case 1: /* AFE - read byte */
-               strlcpy(chip->name, "AFE (byte)", sizeof(chip->name));
+               strscpy(chip->name, "AFE (byte)", sizeof(chip->name));
                return 0;
        case 2: /* Video Block - read byte */
-               strlcpy(chip->name, "Video (byte)", sizeof(chip->name));
+               strscpy(chip->name, "Video (byte)", sizeof(chip->name));
                return 0;
        case 3: /* I2S block - read byte */
-               strlcpy(chip->name, "I2S (byte)", sizeof(chip->name));
+               strscpy(chip->name, "I2S (byte)", sizeof(chip->name));
                return 0;
        case 4: /* AFE - read dword */
-               strlcpy(chip->name, "AFE (dword)", sizeof(chip->name));
+               strscpy(chip->name, "AFE (dword)", sizeof(chip->name));
                return 0;
        case 5: /* Video Block - read dword */
-               strlcpy(chip->name, "Video (dword)", sizeof(chip->name));
+               strscpy(chip->name, "Video (dword)", sizeof(chip->name));
                return 0;
        case 6: /* I2S Block - read dword */
-               strlcpy(chip->name, "I2S (dword)", sizeof(chip->name));
+               strscpy(chip->name, "I2S (dword)", sizeof(chip->name));
                return 0;
        }
        return -EINVAL;
@@ -1553,8 +1553,8 @@ int cx231xx_querycap(struct file *file, void *priv,
        struct cx231xx_fh *fh = priv;
        struct cx231xx *dev = fh->dev;
 
-       strlcpy(cap->driver, "cx231xx", sizeof(cap->driver));
-       strlcpy(cap->card, cx231xx_boards[dev->model].name, sizeof(cap->card));
+       strscpy(cap->driver, "cx231xx", sizeof(cap->driver));
+       strscpy(cap->card, cx231xx_boards[dev->model].name, sizeof(cap->card));
        usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info));
 
        if (vdev->vfl_type == VFL_TYPE_RADIO)
@@ -1583,7 +1583,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
        if (unlikely(f->index >= ARRAY_SIZE(format)))
                return -EINVAL;
 
-       strlcpy(f->description, format[f->index].name, sizeof(f->description));
+       strscpy(f->description, format[f->index].name, sizeof(f->description));
        f->pixelformat = format[f->index].fourcc;
 
        return 0;
index 1f6c1eefe38920c9f1e08d1f99158db7e715c838..80d3bd3a0f245786b69800dcbfaabf7f6d430c1e 100644 (file)
@@ -204,7 +204,7 @@ static int af9035_add_i2c_dev(struct dvb_usb_device *d, const char *type,
                .platform_data = platform_data,
        };
 
-       strlcpy(board_info.type, type, I2C_NAME_SIZE);
+       strscpy(board_info.type, type, I2C_NAME_SIZE);
 
        /* find first free client */
        for (num = 0; num < AF9035_I2C_CLIENT_MAX; num++) {
index 20ee7eea2a91ef238d19d73fc622addf1529005b..0df7ad69e6c782e1160a984adcc93a79754dcef5 100644 (file)
@@ -638,7 +638,7 @@ static int anysee_add_i2c_dev(struct dvb_usb_device *d, const char *type,
                .platform_data = platform_data,
        };
 
-       strlcpy(board_info.type, type, I2C_NAME_SIZE);
+       strscpy(board_info.type, type, I2C_NAME_SIZE);
 
        /* find first free client */
        for (num = 0; num < ANYSEE_I2C_CLIENT_MAX; num++) {
index 955318ab7f5e31c65b698a68b0a1f3581686966e..3b8f7931b7306178f5854b5a2ea2608f8faeb25e 100644 (file)
@@ -74,7 +74,7 @@ static int dvb_usbv2_i2c_init(struct dvb_usb_device *d)
        if (!d->props->i2c_algo)
                return 0;
 
-       strlcpy(d->i2c_adap.name, d->name, sizeof(d->i2c_adap.name));
+       strscpy(d->i2c_adap.name, d->name, sizeof(d->i2c_adap.name));
        d->i2c_adap.algo = d->props->i2c_algo;
        d->i2c_adap.dev.parent = &d->udev->dev;
        i2c_set_adapdata(&d->i2c_adap, d);
index 3338b21d8b25ca0fcb438f4d1eedce6c80c99f1a..0559417c8af48830e614aecb3d206cf1e71cef90 100644 (file)
@@ -507,7 +507,7 @@ static int friio_frontend_attach(struct dvb_usb_adapter *adap)
        priv->i2c_client_demod = cl;
        priv->tuner_adap.algo = &friio_tuner_i2c_algo;
        priv->tuner_adap.dev.parent = &d->udev->dev;
-       strlcpy(priv->tuner_adap.name, d->name, sizeof(priv->tuner_adap.name));
+       strscpy(priv->tuner_adap.name, d->name, sizeof(priv->tuner_adap.name));
        strlcat(priv->tuner_adap.name, "-tuner", sizeof(priv->tuner_adap.name));
        priv->demod_sub_i2c = &priv->tuner_adap;
        i2c_set_adapdata(&priv->tuner_adap, d);
index 0750a975bcb899a4744ebf5229c0ced0dcd00fe9..f109c04f05ae2e879ec00301e8838d263b12edb0 100644 (file)
@@ -1004,7 +1004,7 @@ static int lme_name(struct dvb_usb_adapter *adap)
                " SHARP:BS2F7HZ0194", " RS2000"};
        char *name = adap->fe[0]->ops.info.name;
 
-       strlcpy(name, desc, 128);
+       strscpy(name, desc, 128);
        strlcat(name, fe_name[st->tuner_config], 128);
 
        return 0;
index a970224a94bdd34b1b37ad3979156f26fec13443..33f76a347baadf313a39a4f414dc963a9633dd72 100644 (file)
@@ -687,7 +687,7 @@ static int rtl2831u_frontend_attach(struct dvb_usb_adapter *adap)
 
        /* attach demodulator */
        memset(&board_info, 0, sizeof(board_info));
-       strlcpy(board_info.type, "rtl2830", I2C_NAME_SIZE);
+       strscpy(board_info.type, "rtl2830", I2C_NAME_SIZE);
        board_info.addr = 0x10;
        board_info.platform_data = pdata;
        request_module("%s", board_info.type);
@@ -908,7 +908,7 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap)
 
        /* attach demodulator */
        memset(&board_info, 0, sizeof(board_info));
-       strlcpy(board_info.type, "rtl2832", I2C_NAME_SIZE);
+       strscpy(board_info.type, "rtl2832", I2C_NAME_SIZE);
        board_info.addr = 0x10;
        board_info.platform_data = pdata;
        request_module("%s", board_info.type);
@@ -947,7 +947,7 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap)
 
                        mn88472_config.fe = &adap->fe[1];
                        mn88472_config.i2c_wr_max = 22,
-                       strlcpy(info.type, "mn88472", I2C_NAME_SIZE);
+                       strscpy(info.type, "mn88472", I2C_NAME_SIZE);
                        mn88472_config.xtal = 20500000;
                        mn88472_config.ts_mode = SERIAL_TS_MODE;
                        mn88472_config.ts_clock = VARIABLE_TS_CLOCK;
@@ -972,7 +972,7 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap)
 
                        mn88473_config.fe = &adap->fe[1];
                        mn88473_config.i2c_wr_max = 22,
-                       strlcpy(info.type, "mn88473", I2C_NAME_SIZE);
+                       strscpy(info.type, "mn88473", I2C_NAME_SIZE);
                        info.addr = 0x18;
                        info.platform_data = &mn88473_config;
                        request_module(info.type);
@@ -998,7 +998,7 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap)
                        si2168_config.ts_mode = SI2168_TS_SERIAL;
                        si2168_config.ts_clock_inv = false;
                        si2168_config.ts_clock_gapped = true;
-                       strlcpy(info.type, "si2168", I2C_NAME_SIZE);
+                       strscpy(info.type, "si2168", I2C_NAME_SIZE);
                        info.addr = 0x64;
                        info.platform_data = &si2168_config;
                        request_module(info.type);
@@ -1189,7 +1189,7 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap)
                                .clock = 28800000,
                        };
 
-                       strlcpy(info.type, "e4000", I2C_NAME_SIZE);
+                       strscpy(info.type, "e4000", I2C_NAME_SIZE);
                        info.addr = 0x64;
                        info.platform_data = &e4000_config;
 
@@ -1213,7 +1213,7 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap)
                        };
                        struct i2c_board_info board_info = {};
 
-                       strlcpy(board_info.type, "fc2580", I2C_NAME_SIZE);
+                       strscpy(board_info.type, "fc2580", I2C_NAME_SIZE);
                        board_info.addr = 0x56;
                        board_info.platform_data = &fc2580_pdata;
                        request_module("fc2580");
@@ -1244,7 +1244,7 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap)
                if (ret)
                        goto err;
 
-               strlcpy(board_info.type, "tua9001", I2C_NAME_SIZE);
+               strscpy(board_info.type, "tua9001", I2C_NAME_SIZE);
                board_info.addr = 0x60;
                board_info.platform_data = &tua9001_pdata;
                request_module("tua9001");
@@ -1289,7 +1289,7 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap)
                                .inversion = false,
                        };
 
-                       strlcpy(info.type, "si2157", I2C_NAME_SIZE);
+                       strscpy(info.type, "si2157", I2C_NAME_SIZE);
                        info.addr = 0x60;
                        info.platform_data = &si2157_config;
                        request_module(info.type);
index d1eb4b7bc0519c4103ca401da7cf7478cef7affd..7a41d744ff5800d25d8e4d42873572a63f309f1a 100644 (file)
@@ -177,7 +177,7 @@ static int zd1301_frontend_attach(struct dvb_usb_adapter *adap)
        dev->mt2060_pdata.i2c_write_max = 9;
        dev->mt2060_pdata.dvb_frontend = frontend;
        memset(&board_info, 0, sizeof(board_info));
-       strlcpy(board_info.type, "mt2060", I2C_NAME_SIZE);
+       strscpy(board_info.type, "mt2060", I2C_NAME_SIZE);
        board_info.addr = 0x60;
        board_info.platform_data = &dev->mt2060_pdata;
        request_module("%s", "mt2060");
index 5b51ed7d6243fe8572b126e45fba6cee83587f3e..a51a45c6023315264a5add9fa1d9223de8e2a8fe 100644 (file)
@@ -1196,7 +1196,7 @@ static int cxusb_mygica_t230_frontend_attach(struct dvb_usb_adapter *adap)
        si2168_config.ts_mode = SI2168_TS_PARALLEL;
        si2168_config.ts_clock_inv = 1;
        memset(&info, 0, sizeof(struct i2c_board_info));
-       strlcpy(info.type, "si2168", I2C_NAME_SIZE);
+       strscpy(info.type, "si2168", I2C_NAME_SIZE);
        info.addr = 0x64;
        info.platform_data = &si2168_config;
        request_module(info.type);
@@ -1216,7 +1216,7 @@ static int cxusb_mygica_t230_frontend_attach(struct dvb_usb_adapter *adap)
        si2157_config.fe = adap->fe_adap[0].fe;
        si2157_config.if_port = 1;
        memset(&info, 0, sizeof(struct i2c_board_info));
-       strlcpy(info.type, "si2157", I2C_NAME_SIZE);
+       strscpy(info.type, "si2157", I2C_NAME_SIZE);
        info.addr = 0x60;
        info.platform_data = &si2157_config;
        request_module(info.type);
index 091389fdf89ee62f6e15f8c02f025cfd8ffe6c66..7551dce96f648a3b9e610f51db52ccf7ca020f90 100644 (file)
@@ -3763,7 +3763,7 @@ static int xbox_one_attach(struct dvb_usb_adapter *adap)
        mn88472_config.ts_mode = PARALLEL_TS_MODE;
        mn88472_config.ts_clock = FIXED_TS_CLOCK;
        memset(&info, 0, sizeof(struct i2c_board_info));
-       strlcpy(info.type, "mn88472", I2C_NAME_SIZE);
+       strscpy(info.type, "mn88472", I2C_NAME_SIZE);
        info.addr = 0x18;
        info.platform_data = &mn88472_config;
        request_module(info.type);
@@ -3790,7 +3790,7 @@ static int xbox_one_attach(struct dvb_usb_adapter *adap)
        tda18250_config.fe = adap->fe_adap[0].fe;
 
        memset(&info, 0, sizeof(struct i2c_board_info));
-       strlcpy(info.type, "tda18250", I2C_NAME_SIZE);
+       strscpy(info.type, "tda18250", I2C_NAME_SIZE);
        info.addr = 0x60;
        info.platform_data = &tda18250_config;
 
index ca0b734e009b16c7732420984f08eee20224b25b..2e07106f46803c7cb0d82a27f5e02f9e5eb1a2b7 100644 (file)
@@ -20,7 +20,7 @@ int dvb_usb_i2c_init(struct dvb_usb_device *d)
                return -EINVAL;
        }
 
-       strlcpy(d->i2c_adap.name, d->desc->name, sizeof(d->i2c_adap.name));
+       strscpy(d->i2c_adap.name, d->desc->name, sizeof(d->i2c_adap.name));
        d->i2c_adap.algo      = d->props.i2c_algo;
        d->i2c_adap.algo_data = NULL;
        d->i2c_adap.dev.parent = &d->udev->dev;
index 9ce8b4d79d1fa47ffdd9c027a68a428823c3e4ef..eefe2867815c3aca21637e027e15c9ea1304d643 100644 (file)
@@ -1589,7 +1589,7 @@ static int tt_s2_4600_frontend_attach(struct dvb_usb_adapter *adap)
        m88ds3103_pdata.lnb_hv_pol = 1;
        m88ds3103_pdata.lnb_en_pol = 0;
        memset(&board_info, 0, sizeof(board_info));
-       strlcpy(board_info.type, "m88ds3103", I2C_NAME_SIZE);
+       strscpy(board_info.type, "m88ds3103", I2C_NAME_SIZE);
        board_info.addr = 0x68;
        board_info.platform_data = &m88ds3103_pdata;
        request_module("m88ds3103");
@@ -1608,7 +1608,7 @@ static int tt_s2_4600_frontend_attach(struct dvb_usb_adapter *adap)
        /* attach tuner */
        ts2020_config.fe = adap->fe_adap[0].fe;
        memset(&board_info, 0, sizeof(board_info));
-       strlcpy(board_info.type, "ts2022", I2C_NAME_SIZE);
+       strscpy(board_info.type, "ts2022", I2C_NAME_SIZE);
        board_info.addr = 0x60;
        board_info.platform_data = &ts2020_config;
        request_module("ts2020");
index 18d0f8f5283fa6cb96af7702229a3dc196950a24..c659e18b358b88db8b7ce31836bab9e784a4dfa4 100644 (file)
@@ -566,8 +566,9 @@ static int technisat_usb2_frontend_attach(struct dvb_usb_adapter *a)
                        a->fe_adap[0].fe->ops.set_voltage = technisat_usb2_set_voltage;
 
                        /* if everything was successful assign a nice name to the frontend */
-                       strlcpy(a->fe_adap[0].fe->ops.info.name, a->dev->desc->name,
-                                       sizeof(a->fe_adap[0].fe->ops.info.name));
+                       strscpy(a->fe_adap[0].fe->ops.info.name,
+                               a->dev->desc->name,
+                               sizeof(a->fe_adap[0].fe->ops.info.name));
                } else {
                        dvb_frontend_detach(a->fe_adap[0].fe);
                        a->fe_adap[0].fe = NULL;
index 68571bf36d28623cad6be5908f4f6075dd947df5..5e8a26fa719a69493e7eabba49b2d18a67213f2c 100644 (file)
@@ -1833,9 +1833,9 @@ static int vidioc_g_chip_info(struct file *file, void *priv,
        if (chip->match.addr > 1)
                return -EINVAL;
        if (chip->match.addr == 1)
-               strlcpy(chip->name, "ac97", sizeof(chip->name));
+               strscpy(chip->name, "ac97", sizeof(chip->name));
        else
-               strlcpy(chip->name,
+               strscpy(chip->name,
                        dev->v4l2->v4l2_dev.name, sizeof(chip->name));
        return 0;
 }
@@ -1920,8 +1920,8 @@ static int vidioc_querycap(struct file *file, void  *priv,
        struct em28xx_v4l2    *v4l2 = dev->v4l2;
        struct usb_device *udev = interface_to_usbdev(dev->intf);
 
-       strlcpy(cap->driver, "em28xx", sizeof(cap->driver));
-       strlcpy(cap->card, em28xx_boards[dev->model].name, sizeof(cap->card));
+       strscpy(cap->driver, "em28xx", sizeof(cap->driver));
+       strscpy(cap->card, em28xx_boards[dev->model].name, sizeof(cap->card));
        usb_make_path(udev, cap->bus_info, sizeof(cap->bus_info));
 
        if (vdev->vfl_type == VFL_TYPE_GRABBER)
@@ -1954,7 +1954,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void  *priv,
        if (unlikely(f->index >= ARRAY_SIZE(format)))
                return -EINVAL;
 
-       strlcpy(f->description, format[f->index].name, sizeof(f->description));
+       strscpy(f->description, format[f->index].name, sizeof(f->description));
        f->pixelformat = format[f->index].fourcc;
 
        return 0;
index 62aeebcdd7f71bede5f47a654d9163e33df3e82d..59cf50355b4e441631d0fa0a9814bd04ee79b16a 100644 (file)
@@ -208,7 +208,7 @@ static int init_i2c_module(struct i2c_adapter *adapter, const struct go_i2c *con
        struct i2c_board_info info;
 
        memset(&info, 0, sizeof(info));
-       strlcpy(info.type, i2c->type, sizeof(info.type));
+       strscpy(info.type, i2c->type, sizeof(info.type));
        info.addr = i2c->addr;
        info.flags = i2c->flags;
 
index c55c82f70e541b2b6483ae2c840a3f08f35d5f22..7a2781fa83e71bd1603852c4513faf2082081c87 100644 (file)
@@ -284,9 +284,9 @@ static int vidioc_querycap(struct file *file, void  *priv,
 {
        struct go7007 *go = video_drvdata(file);
 
-       strlcpy(cap->driver, "go7007", sizeof(cap->driver));
-       strlcpy(cap->card, go->name, sizeof(cap->card));
-       strlcpy(cap->bus_info, go->bus_info, sizeof(cap->bus_info));
+       strscpy(cap->driver, "go7007", sizeof(cap->driver));
+       strscpy(cap->card, go->name, sizeof(cap->card));
+       strscpy(cap->bus_info, go->bus_info, sizeof(cap->bus_info));
 
        cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
                                V4L2_CAP_STREAMING;
@@ -634,8 +634,8 @@ static int vidioc_enum_input(struct file *file, void *priv,
        if (inp->index >= go->board_info->num_inputs)
                return -EINVAL;
 
-       strlcpy(inp->name, go->board_info->inputs[inp->index].name,
-                       sizeof(inp->name));
+       strscpy(inp->name, go->board_info->inputs[inp->index].name,
+               sizeof(inp->name));
 
        /* If this board has a tuner, it will be the first input */
        if ((go->board_info->flags & GO7007_BOARD_HAS_TUNER) &&
@@ -673,7 +673,7 @@ static int vidioc_enumaudio(struct file *file, void *fh, struct v4l2_audio *a)
 
        if (a->index >= go->board_info->num_aud_inputs)
                return -EINVAL;
-       strlcpy(a->name, go->board_info->aud_inputs[a->index].name,
+       strscpy(a->name, go->board_info->aud_inputs[a->index].name,
                sizeof(a->name));
        a->capability = V4L2_AUDCAP_STEREO;
        return 0;
@@ -684,7 +684,7 @@ static int vidioc_g_audio(struct file *file, void *fh, struct v4l2_audio *a)
        struct go7007 *go = video_drvdata(file);
 
        a->index = go->aud_input;
-       strlcpy(a->name, go->board_info->aud_inputs[go->aud_input].name,
+       strscpy(a->name, go->board_info->aud_inputs[go->aud_input].name,
                sizeof(a->name));
        a->capability = V4L2_AUDCAP_STEREO;
        return 0;
@@ -742,7 +742,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
        if (t->index != 0)
                return -EINVAL;
 
-       strlcpy(t->name, "Tuner", sizeof(t->name));
+       strscpy(t->name, "Tuner", sizeof(t->name));
        return call_all(&go->v4l2_dev, tuner, g_tuner, t);
 }
 
index 137fc253b1228495e230b8466a8531230da1e6e5..fc84b37d5587858af9b47562ef8d01c1bff479ce 100644 (file)
@@ -260,10 +260,10 @@ int go7007_snd_init(struct go7007 *go)
                kfree(gosnd);
                return ret;
        }
-       strlcpy(gosnd->card->driver, "go7007", sizeof(gosnd->card->driver));
-       strlcpy(gosnd->card->shortname, go->name, sizeof(gosnd->card->driver));
-       strlcpy(gosnd->card->longname, gosnd->card->shortname,
-                       sizeof(gosnd->card->longname));
+       strscpy(gosnd->card->driver, "go7007", sizeof(gosnd->card->driver));
+       strscpy(gosnd->card->shortname, go->name, sizeof(gosnd->card->driver));
+       strscpy(gosnd->card->longname, gosnd->card->shortname,
+               sizeof(gosnd->card->longname));
 
        gosnd->pcm->private_data = go;
        snd_pcm_set_ops(gosnd->pcm, SNDRV_PCM_STREAM_CAPTURE,
index 57aa521e16b159005bea6206dee791873f4cf402..fce9d6f4b7c924c6b95dea6c59f792ac701b7031 100644 (file)
@@ -1193,11 +1193,11 @@ static int vidioc_querycap(struct file *file, void  *priv,
 {
        struct gspca_dev *gspca_dev = video_drvdata(file);
 
-       strlcpy((char *) cap->driver, gspca_dev->sd_desc->name,
-                       sizeof cap->driver);
+       strscpy((char *)cap->driver, gspca_dev->sd_desc->name,
+               sizeof(cap->driver));
        if (gspca_dev->dev->product != NULL) {
-               strlcpy((char *) cap->card, gspca_dev->dev->product,
-                       sizeof cap->card);
+               strscpy((char *)cap->card, gspca_dev->dev->product,
+                       sizeof(cap->card));
        } else {
                snprintf((char *) cap->card, sizeof cap->card,
                        "USB Camera (%04x:%04x)",
@@ -1222,7 +1222,7 @@ static int vidioc_enum_input(struct file *file, void *priv,
                return -EINVAL;
        input->type = V4L2_INPUT_TYPE_CAMERA;
        input->status = gspca_dev->cam.input_flags;
-       strlcpy(input->name, gspca_dev->sd_desc->name,
+       strscpy(input->name, gspca_dev->sd_desc->name,
                sizeof input->name);
        return 0;
 }
index cfa2a04d9f3f6a90cb4c34fd32f32c6f15ba3583..5984bb12bcff2ffe9fcc5d6a814fb6f0a84fa2ba 100644 (file)
@@ -1601,7 +1601,7 @@ static int sd_chip_info(struct gspca_dev *gspca_dev,
        if (chip->match.addr > 1)
                return -EINVAL;
        if (chip->match.addr == 1)
-               strlcpy(chip->name, "sensor", sizeof(chip->name));
+               strscpy(chip->name, "sensor", sizeof(chip->name));
        return 0;
 }
 #endif
index 34085a0b15a1a5ec09bd2d892dcc0c2762c61951..d437852066224c4ca7936aa0610333f98f1b0720 100644 (file)
@@ -918,8 +918,8 @@ static int hackrf_querycap(struct file *file, void *fh,
        cap->capabilities = V4L2_CAP_SDR_CAPTURE | V4L2_CAP_TUNER |
                            V4L2_CAP_SDR_OUTPUT | V4L2_CAP_MODULATOR |
                            V4L2_CAP_DEVICE_CAPS | cap->device_caps;
-       strlcpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
-       strlcpy(cap->card, dev->rx_vdev.name, sizeof(cap->card));
+       strscpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
+       strscpy(cap->card, dev->rx_vdev.name, sizeof(cap->card));
        usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info));
 
        return 0;
@@ -1041,14 +1041,14 @@ static int hackrf_g_tuner(struct file *file, void *priv, struct v4l2_tuner *v)
        dev_dbg(dev->dev, "index=%d\n", v->index);
 
        if (v->index == 0) {
-               strlcpy(v->name, "HackRF ADC", sizeof(v->name));
+               strscpy(v->name, "HackRF ADC", sizeof(v->name));
                v->type = V4L2_TUNER_SDR;
                v->capability = V4L2_TUNER_CAP_1HZ | V4L2_TUNER_CAP_FREQ_BANDS;
                v->rangelow  = bands_adc_dac[0].rangelow;
                v->rangehigh = bands_adc_dac[0].rangehigh;
                ret = 0;
        } else if (v->index == 1) {
-               strlcpy(v->name, "HackRF RF", sizeof(v->name));
+               strscpy(v->name, "HackRF RF", sizeof(v->name));
                v->type = V4L2_TUNER_RF;
                v->capability = V4L2_TUNER_CAP_1HZ | V4L2_TUNER_CAP_FREQ_BANDS;
                v->rangelow  = bands_rx_tx[0].rangelow;
@@ -1080,14 +1080,14 @@ static int hackrf_g_modulator(struct file *file, void *fh,
        dev_dbg(dev->dev, "index=%d\n", a->index);
 
        if (a->index == 0) {
-               strlcpy(a->name, "HackRF DAC", sizeof(a->name));
+               strscpy(a->name, "HackRF DAC", sizeof(a->name));
                a->type = V4L2_TUNER_SDR;
                a->capability = V4L2_TUNER_CAP_1HZ | V4L2_TUNER_CAP_FREQ_BANDS;
                a->rangelow  = bands_adc_dac[0].rangelow;
                a->rangehigh = bands_adc_dac[0].rangehigh;
                ret = 0;
        } else if (a->index == 1) {
-               strlcpy(a->name, "HackRF RF", sizeof(a->name));
+               strscpy(a->name, "HackRF RF", sizeof(a->name));
                a->type = V4L2_TUNER_RF;
                a->capability = V4L2_TUNER_CAP_1HZ | V4L2_TUNER_CAP_FREQ_BANDS;
                a->rangelow  = bands_rx_tx[0].rangelow;
index 1b89c77bad6673d03600f2961f4c8fc96667b5dc..9ab071f8993daf6cff286541d5b3b720fcf1c368 100644 (file)
@@ -873,7 +873,7 @@ static int vidioc_g_audio(struct file *file, void *private_data,
 
        audio->index = dev->options.audio_input;
        audio->capability = V4L2_AUDCAP_STEREO;
-       strlcpy(audio->name, audio_iname[audio->index], sizeof(audio->name));
+       strscpy(audio->name, audio_iname[audio->index], sizeof(audio->name));
        audio->name[sizeof(audio->name) - 1] = '\0';
        return 0;
 }
index 65ef755adfdc1ee51828c3b044b26751c1f76b05..0fc4076c6d1606399005f1e4be372c43c2f4b899 100644 (file)
@@ -604,8 +604,8 @@ static int msi2500_querycap(struct file *file, void *fh,
 
        dev_dbg(dev->dev, "\n");
 
-       strlcpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
-       strlcpy(cap->card, dev->vdev.name, sizeof(cap->card));
+       strscpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
+       strscpy(cap->card, dev->vdev.name, sizeof(cap->card));
        usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info));
        cap->device_caps = V4L2_CAP_SDR_CAPTURE | V4L2_CAP_STREAMING |
                        V4L2_CAP_READWRITE | V4L2_CAP_TUNER;
@@ -916,7 +916,7 @@ static int msi2500_enum_fmt_sdr_cap(struct file *file, void *priv,
        if (f->index >= dev->num_formats)
                return -EINVAL;
 
-       strlcpy(f->description, formats[f->index].name, sizeof(f->description));
+       strscpy(f->description, formats[f->index].name, sizeof(f->description));
        f->pixelformat = formats[f->index].pixelformat;
 
        return 0;
@@ -1017,7 +1017,7 @@ static int msi2500_g_tuner(struct file *file, void *priv, struct v4l2_tuner *v)
        dev_dbg(dev->dev, "index=%d\n", v->index);
 
        if (v->index == 0) {
-               strlcpy(v->name, "Mirics MSi2500", sizeof(v->name));
+               strscpy(v->name, "Mirics MSi2500", sizeof(v->name));
                v->type = V4L2_TUNER_ADC;
                v->capability = V4L2_TUNER_CAP_1HZ | V4L2_TUNER_CAP_FREQ_BANDS;
                v->rangelow =   1200000;
index f3003ca05f4ba370d3ccbc647b269ca5bd817c9c..ec7d32759e39250297e0f2453155ba2d4e6c0ddf 100644 (file)
@@ -573,7 +573,7 @@ static void pvr2_i2c_register_ir(struct pvr2_hdw *hdw)
                /* IR Receiver */
                info.addr          = 0x18;
                info.platform_data = init_data;
-               strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
+               strscpy(info.type, "ir_video", I2C_NAME_SIZE);
                pvr2_trace(PVR2_TRACE_INFO, "Binding %s to i2c address 0x%02x.",
                           info.type, info.addr);
                i2c_new_device(&hdw->i2c_adap, &info);
@@ -588,7 +588,7 @@ static void pvr2_i2c_register_ir(struct pvr2_hdw *hdw)
                /* IR Transceiver */
                info.addr = 0x71;
                info.platform_data = init_data;
-               strlcpy(info.type, "ir_z8f0811_haup", I2C_NAME_SIZE);
+               strscpy(info.type, "ir_z8f0811_haup", I2C_NAME_SIZE);
                pvr2_trace(PVR2_TRACE_INFO, "Binding %s to i2c address 0x%02x.",
                           info.type, info.addr);
                i2c_new_device(&hdw->i2c_adap, &info);
@@ -631,7 +631,7 @@ void pvr2_i2c_core_init(struct pvr2_hdw *hdw)
        // Configure the adapter and set up everything else related to it.
        hdw->i2c_adap = pvr2_i2c_adap_template;
        hdw->i2c_algo = pvr2_i2c_algo_template;
-       strlcpy(hdw->i2c_adap.name,hdw->name,sizeof(hdw->i2c_adap.name));
+       strscpy(hdw->i2c_adap.name, hdw->name, sizeof(hdw->i2c_adap.name));
        hdw->i2c_adap.dev.parent = &hdw->usb_dev->dev;
        hdw->i2c_adap.algo = &hdw->i2c_algo;
        hdw->i2c_adap.algo_data = hdw;
index e53a80b589a15b3e5f7c2dd05aed728b65c2ffe5..cea232a3302d57e0c0a789754819c0b715432bef 100644 (file)
@@ -121,10 +121,10 @@ static int pvr2_querycap(struct file *file, void *priv, struct v4l2_capability *
        struct pvr2_v4l2_fh *fh = file->private_data;
        struct pvr2_hdw *hdw = fh->channel.mc_head->hdw;
 
-       strlcpy(cap->driver, "pvrusb2", sizeof(cap->driver));
-       strlcpy(cap->bus_info, pvr2_hdw_get_bus_info(hdw),
-                       sizeof(cap->bus_info));
-       strlcpy(cap->card, pvr2_hdw_get_desc(hdw), sizeof(cap->card));
+       strscpy(cap->driver, "pvrusb2", sizeof(cap->driver));
+       strscpy(cap->bus_info, pvr2_hdw_get_bus_info(hdw),
+               sizeof(cap->bus_info));
+       strscpy(cap->card, pvr2_hdw_get_desc(hdw), sizeof(cap->card));
        cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_TUNER |
                            V4L2_CAP_AUDIO | V4L2_CAP_RADIO |
                            V4L2_CAP_READWRITE | V4L2_CAP_DEVICE_CAPS;
@@ -545,7 +545,7 @@ static int pvr2_queryctrl(struct file *file, void *priv,
                        "QUERYCTRL id=0x%x mapping name=%s (%s)",
                        vc->id, pvr2_ctrl_get_name(cptr),
                        pvr2_ctrl_get_desc(cptr));
-       strlcpy(vc->name, pvr2_ctrl_get_desc(cptr), sizeof(vc->name));
+       strscpy(vc->name, pvr2_ctrl_get_desc(cptr), sizeof(vc->name));
        vc->flags = pvr2_ctrl_get_v4lflags(cptr);
        pvr2_ctrl_get_def(cptr, &val);
        vc->default_value = val;
index 043b2b97cee6795c9eaa5f52797480f852b3cc95..0673238c2c63e7fcf413d91887d8e6f0abca34c8 100644 (file)
@@ -493,7 +493,7 @@ static int pwc_querycap(struct file *file, void *fh, struct v4l2_capability *cap
        struct pwc_device *pdev = video_drvdata(file);
 
        strcpy(cap->driver, PWC_NAME);
-       strlcpy(cap->card, pdev->vdev.name, sizeof(cap->card));
+       strscpy(cap->card, pdev->vdev.name, sizeof(cap->card));
        usb_make_path(pdev->udev, cap->bus_info, sizeof(cap->bus_info));
        cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
                                        V4L2_CAP_READWRITE;
@@ -506,7 +506,7 @@ static int pwc_enum_input(struct file *file, void *fh, struct v4l2_input *i)
        if (i->index)   /* Only one INPUT is supported */
                return -EINVAL;
 
-       strlcpy(i->name, "Camera", sizeof(i->name));
+       strscpy(i->name, "Camera", sizeof(i->name));
        i->type = V4L2_INPUT_TYPE_CAMERA;
        return 0;
 }
@@ -889,11 +889,13 @@ static int pwc_enum_fmt_vid_cap(struct file *file, void *fh, struct v4l2_fmtdesc
                /* RAW format */
                f->pixelformat = pdev->type <= 646 ? V4L2_PIX_FMT_PWC1 : V4L2_PIX_FMT_PWC2;
                f->flags = V4L2_FMT_FLAG_COMPRESSED;
-               strlcpy(f->description, "Raw Philips Webcam", sizeof(f->description));
+               strscpy(f->description, "Raw Philips Webcam",
+                       sizeof(f->description));
                break;
        case 1:
                f->pixelformat = V4L2_PIX_FMT_YUV420;
-               strlcpy(f->description, "4:2:0, planar, Y-Cb-Cr", sizeof(f->description));
+               strscpy(f->description, "4:2:0, planar, Y-Cb-Cr",
+                       sizeof(f->description));
                break;
        default:
                return -EINVAL;
index 82927eb334c48d07be8b8ec6cd121de37edf643f..5b3e54b76e9a522b2b69f3d55612b04c120426d9 100644 (file)
@@ -730,8 +730,8 @@ static int vidioc_querycap(struct file *file, void *priv,
        struct s2255_vc *vc = video_drvdata(file);
        struct s2255_dev *dev = vc->dev;
 
-       strlcpy(cap->driver, "s2255", sizeof(cap->driver));
-       strlcpy(cap->card, "s2255", sizeof(cap->card));
+       strscpy(cap->driver, "s2255", sizeof(cap->driver));
+       strscpy(cap->card, "s2255", sizeof(cap->card));
        usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info));
        cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
                V4L2_CAP_READWRITE;
@@ -749,7 +749,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
        if (!jpeg_enable && ((formats[index].fourcc == V4L2_PIX_FMT_JPEG) ||
                        (formats[index].fourcc == V4L2_PIX_FMT_MJPEG)))
                return -EINVAL;
-       strlcpy(f->description, formats[index].name, sizeof(f->description));
+       strscpy(f->description, formats[index].name, sizeof(f->description));
        f->pixelformat = formats[index].fourcc;
        return 0;
 }
@@ -1195,10 +1195,10 @@ static int vidioc_enum_input(struct file *file, void *priv,
        switch (dev->pid) {
        case 0x2255:
        default:
-               strlcpy(inp->name, "Composite", sizeof(inp->name));
+               strscpy(inp->name, "Composite", sizeof(inp->name));
                break;
        case 0x2257:
-               strlcpy(inp->name, (vc->idx < 2) ? "Composite" : "S-Video",
+               strscpy(inp->name, (vc->idx < 2) ? "Composite" : "S-Video",
                        sizeof(inp->name));
                break;
        }
index 504e413edcd25a49bce6232cebf2c0937b8716ad..bbf191b71f384e4e649fe3b1177978d41dfb45c2 100644 (file)
@@ -361,7 +361,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void  *priv,
        if (f->index != 0)
                return -EINVAL;
 
-       strlcpy(f->description, format[f->index].name, sizeof(f->description));
+       strscpy(f->description, format[f->index].name, sizeof(f->description));
        f->pixelformat = format[f->index].fourcc;
        return 0;
 }
index ccd1adf862b14cbd4246e07c50430b366dd7f3cb..8c0476dfe54f6f1833a91bedab5e0b374d96744b 100644 (file)
@@ -292,7 +292,7 @@ int tm6000_i2c_register(struct tm6000_core *dev)
        dev->i2c_adap.owner = THIS_MODULE;
        dev->i2c_adap.algo = &tm6000_algo;
        dev->i2c_adap.dev.parent = &dev->udev->dev;
-       strlcpy(dev->i2c_adap.name, dev->name, sizeof(dev->i2c_adap.name));
+       strscpy(dev->i2c_adap.name, dev->name, sizeof(dev->i2c_adap.name));
        dev->i2c_adap.algo_data = dev;
        i2c_set_adapdata(&dev->i2c_adap, &dev->v4l2_dev);
        rc = i2c_add_adapter(&dev->i2c_adap);
@@ -300,7 +300,7 @@ int tm6000_i2c_register(struct tm6000_core *dev)
                return rc;
 
        dev->i2c_client.adapter = &dev->i2c_adap;
-       strlcpy(dev->i2c_client.name, "tm6000 internal", I2C_NAME_SIZE);
+       strscpy(dev->i2c_client.name, "tm6000 internal", I2C_NAME_SIZE);
        tm6000_i2c_eeprom(dev);
 
        return 0;
index 96055de6e8ce2815cde4c0087c651f1a0857dd01..f3082bd44ce6aedfdf9a9227ef4adb5fc428f0f1 100644 (file)
@@ -855,8 +855,9 @@ static int vidioc_querycap(struct file *file, void  *priv,
        struct tm6000_core *dev = ((struct tm6000_fh *)priv)->dev;
        struct video_device *vdev = video_devdata(file);
 
-       strlcpy(cap->driver, "tm6000", sizeof(cap->driver));
-       strlcpy(cap->card, "Trident TVMaster TM5600/6000/6010", sizeof(cap->card));
+       strscpy(cap->driver, "tm6000", sizeof(cap->driver));
+       strscpy(cap->card, "Trident TVMaster TM5600/6000/6010",
+               sizeof(cap->card));
        usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info));
        if (dev->tuner_type != TUNER_ABSENT)
                cap->device_caps |= V4L2_CAP_TUNER;
@@ -878,7 +879,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void  *priv,
        if (f->index >= ARRAY_SIZE(format))
                return -EINVAL;
 
-       strlcpy(f->description, format[f->index].name, sizeof(f->description));
+       strscpy(f->description, format[f->index].name, sizeof(f->description));
        f->pixelformat = format[f->index].fourcc;
        return 0;
 }
index 4ce38246ed6415f312de88f04649f36a4d59daeb..6f108996142d742b4c8ec3ba99368c97ce8f1373 100644 (file)
@@ -358,8 +358,8 @@ int usbtv_audio_init(struct usbtv *usbtv)
        if (rv < 0)
                return rv;
 
-       strlcpy(card->driver, usbtv->dev->driver->name, sizeof(card->driver));
-       strlcpy(card->shortname, "usbtv", sizeof(card->shortname));
+       strscpy(card->driver, usbtv->dev->driver->name, sizeof(card->driver));
+       strscpy(card->shortname, "usbtv", sizeof(card->shortname));
        snprintf(card->longname, sizeof(card->longname),
                "USBTV Audio at bus %d device %d", usbtv->udev->bus->busnum,
                usbtv->udev->devnum);
@@ -372,7 +372,7 @@ int usbtv_audio_init(struct usbtv *usbtv)
        if (rv < 0)
                goto err;
 
-       strlcpy(pcm->name, "USBTV Audio Input", sizeof(pcm->name));
+       strscpy(pcm->name, "USBTV Audio Input", sizeof(pcm->name));
        pcm->info_flags = 0;
        pcm->private_data = usbtv;
 
index 36a9a401718574fc7c8809934e035cc30b4eb546..4a1eab711bdc632da2a3ea80ad5c2a5384cadd93 100644 (file)
@@ -600,8 +600,8 @@ static int usbtv_querycap(struct file *file, void *priv,
 {
        struct usbtv *dev = video_drvdata(file);
 
-       strlcpy(cap->driver, "usbtv", sizeof(cap->driver));
-       strlcpy(cap->card, "usbtv", sizeof(cap->card));
+       strscpy(cap->driver, "usbtv", sizeof(cap->driver));
+       strscpy(cap->card, "usbtv", sizeof(cap->card));
        usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info));
        cap->device_caps = V4L2_CAP_VIDEO_CAPTURE;
        cap->device_caps |= V4L2_CAP_READWRITE | V4L2_CAP_STREAMING;
@@ -616,10 +616,10 @@ static int usbtv_enum_input(struct file *file, void *priv,
 
        switch (i->index) {
        case USBTV_COMPOSITE_INPUT:
-               strlcpy(i->name, "Composite", sizeof(i->name));
+               strscpy(i->name, "Composite", sizeof(i->name));
                break;
        case USBTV_SVIDEO_INPUT:
-               strlcpy(i->name, "S-Video", sizeof(i->name));
+               strscpy(i->name, "S-Video", sizeof(i->name));
                break;
        default:
                return -EINVAL;
@@ -636,8 +636,8 @@ static int usbtv_enum_fmt_vid_cap(struct file *file, void  *priv,
        if (f->index > 0)
                return -EINVAL;
 
-       strlcpy(f->description, "16 bpp YUY2, 4:2:2, packed",
-                                       sizeof(f->description));
+       strscpy(f->description, "16 bpp YUY2, 4:2:2, packed",
+               sizeof(f->description));
        f->pixelformat = V4L2_PIX_FMT_YUYV;
        return 0;
 }
@@ -934,7 +934,7 @@ int usbtv_video_init(struct usbtv *usbtv)
        }
 
        /* Video structure */
-       strlcpy(usbtv->vdev.name, "usbtv", sizeof(usbtv->vdev.name));
+       strscpy(usbtv->vdev.name, "usbtv", sizeof(usbtv->vdev.name));
        usbtv->vdev.v4l2_dev = &usbtv->v4l2_dev;
        usbtv->vdev.release = video_device_release_empty;
        usbtv->vdev.fops = &usbtv_fops;
index f29d1bef029367f241dbbb1125199ee2d99f2525..f4e758e5f3ec8887bc0d3b6198ff41c8fac14e4a 100644 (file)
@@ -467,8 +467,8 @@ static int vidioc_querycap(struct file *file, void  *priv,
        struct usb_usbvision *usbvision = video_drvdata(file);
        struct video_device *vdev = video_devdata(file);
 
-       strlcpy(vc->driver, "USBVision", sizeof(vc->driver));
-       strlcpy(vc->card,
+       strscpy(vc->driver, "USBVision", sizeof(vc->driver));
+       strscpy(vc->card,
                usbvision_device_data[usbvision->dev_model].model_string,
                sizeof(vc->card));
        usb_make_path(usbvision->dev, vc->bus_info, sizeof(vc->bus_info));
index 04ae9c1adbafe30542ada23e6411110de7dd55af..d45415cbe6e7af9bb07ddb23530b44c4779761b5 100644 (file)
@@ -1031,7 +1031,7 @@ static int __uvc_query_v4l2_ctrl(struct uvc_video_chain *chain,
        memset(v4l2_ctrl, 0, sizeof(*v4l2_ctrl));
        v4l2_ctrl->id = mapping->id;
        v4l2_ctrl->type = mapping->v4l2_type;
-       strlcpy(v4l2_ctrl->name, mapping->name, sizeof(v4l2_ctrl->name));
+       strscpy(v4l2_ctrl->name, mapping->name, sizeof(v4l2_ctrl->name));
        v4l2_ctrl->flags = 0;
 
        if (!(ctrl->info.flags & UVC_CTRL_FLAG_GET_CUR))
@@ -1191,7 +1191,7 @@ int uvc_query_v4l2_menu(struct uvc_video_chain *chain,
                }
        }
 
-       strlcpy(query_menu->name, menu_info->name, sizeof(query_menu->name));
+       strscpy(query_menu->name, menu_info->name, sizeof(query_menu->name));
 
 done:
        mutex_unlock(&chain->ctrl_mutex);
index b1114ec37a556e3879e78837a9c5f8f33909ced7..3aa809af5ea7d136ad193c66bc39ce6fd704b352 100644 (file)
@@ -427,7 +427,7 @@ static int uvc_parse_format(struct uvc_device *dev,
                fmtdesc = uvc_format_by_guid(&buffer[5]);
 
                if (fmtdesc != NULL) {
-                       strlcpy(format->name, fmtdesc->name,
+                       strscpy(format->name, fmtdesc->name,
                                sizeof(format->name));
                        format->fcc = fmtdesc->fcc;
                } else {
@@ -445,7 +445,7 @@ static int uvc_parse_format(struct uvc_device *dev,
                 */
                if (dev->quirks & UVC_QUIRK_FORCE_Y8) {
                        if (format->fcc == V4L2_PIX_FMT_YUYV) {
-                               strlcpy(format->name, "Greyscale 8-bit (Y8  )",
+                               strscpy(format->name, "Greyscale 8-bit (Y8  )",
                                        sizeof(format->name));
                                format->fcc = V4L2_PIX_FMT_GREY;
                                format->bpp = 8;
@@ -471,7 +471,7 @@ static int uvc_parse_format(struct uvc_device *dev,
                        return -EINVAL;
                }
 
-               strlcpy(format->name, "MJPEG", sizeof(format->name));
+               strscpy(format->name, "MJPEG", sizeof(format->name));
                format->fcc = V4L2_PIX_FMT_MJPEG;
                format->flags = UVC_FMT_FLAG_COMPRESSED;
                format->bpp = 0;
@@ -489,13 +489,13 @@ static int uvc_parse_format(struct uvc_device *dev,
 
                switch (buffer[8] & 0x7f) {
                case 0:
-                       strlcpy(format->name, "SD-DV", sizeof(format->name));
+                       strscpy(format->name, "SD-DV", sizeof(format->name));
                        break;
                case 1:
-                       strlcpy(format->name, "SDL-DV", sizeof(format->name));
+                       strscpy(format->name, "SDL-DV", sizeof(format->name));
                        break;
                case 2:
-                       strlcpy(format->name, "HD-DV", sizeof(format->name));
+                       strscpy(format->name, "HD-DV", sizeof(format->name));
                        break;
                default:
                        uvc_trace(UVC_TRACE_DESCR, "device %d videostreaming "
@@ -1932,7 +1932,7 @@ int uvc_register_video_device(struct uvc_device *dev,
                break;
        }
 
-       strlcpy(vdev->name, dev->name, sizeof(vdev->name));
+       strscpy(vdev->name, dev->name, sizeof(vdev->name));
 
        /*
         * Set the driver data before calling video_register_device, otherwise
@@ -2080,7 +2080,7 @@ static int uvc_probe(struct usb_interface *intf,
                    ? dev->info->quirks : uvc_quirks_param;
 
        if (udev->product != NULL)
-               strlcpy(dev->name, udev->product, sizeof(dev->name));
+               strscpy(dev->name, udev->product, sizeof(dev->name));
        else
                snprintf(dev->name, sizeof(dev->name),
                         "UVC Camera (%04x:%04x)",
@@ -2128,9 +2128,9 @@ static int uvc_probe(struct usb_interface *intf,
        /* Initialize the media device and register the V4L2 device. */
 #ifdef CONFIG_MEDIA_CONTROLLER
        dev->mdev.dev = &intf->dev;
-       strlcpy(dev->mdev.model, dev->name, sizeof(dev->mdev.model));
+       strscpy(dev->mdev.model, dev->name, sizeof(dev->mdev.model));
        if (udev->serial)
-               strlcpy(dev->mdev.serial, udev->serial,
+               strscpy(dev->mdev.serial, udev->serial,
                        sizeof(dev->mdev.serial));
        strcpy(dev->mdev.bus_info, udev->devpath);
        dev->mdev.hw_revision = le16_to_cpu(udev->descriptor.bcdDevice);
index 554063c07d7a2c4ebb876e2dfa42051f7b20e385..06bffdf8828b5075ccec275b2274ee219a689303 100644 (file)
@@ -79,7 +79,7 @@ static int uvc_mc_init_entity(struct uvc_video_chain *chain,
 
        if (UVC_ENTITY_TYPE(entity) != UVC_TT_STREAMING) {
                v4l2_subdev_init(&entity->subdev, &uvc_subdev_ops);
-               strlcpy(entity->subdev.name, entity->name,
+               strscpy(entity->subdev.name, entity->name,
                        sizeof(entity->subdev.name));
 
                ret = media_entity_pads_init(&entity->subdev.entity,
index ed0f0c0732cbbeabab3d88bfd4e88f74ca5ad2d3..5f535b515c23a7bedddc4bebc12ed9021e8a3d2c 100644 (file)
@@ -33,8 +33,8 @@ static int uvc_meta_v4l2_querycap(struct file *file, void *fh,
        struct uvc_streaming *stream = video_get_drvdata(vfh->vdev);
        struct uvc_video_chain *chain = stream->chain;
 
-       strlcpy(cap->driver, "uvcvideo", sizeof(cap->driver));
-       strlcpy(cap->card, vfh->vdev->name, sizeof(cap->card));
+       strscpy(cap->driver, "uvcvideo", sizeof(cap->driver));
+       strscpy(cap->card, vfh->vdev->name, sizeof(cap->card));
        usb_make_path(stream->dev->udev, cap->bus_info, sizeof(cap->bus_info));
        cap->capabilities = V4L2_CAP_DEVICE_CAPS | V4L2_CAP_STREAMING
                          | chain->caps;
index 18a7384b50ee9706674ba6db4f4fb0b732b31981..b26182ce7462a5eb018b86d75dd0ec2e426a5553 100644 (file)
@@ -591,8 +591,8 @@ static int uvc_ioctl_querycap(struct file *file, void *fh,
        struct uvc_video_chain *chain = handle->chain;
        struct uvc_streaming *stream = handle->stream;
 
-       strlcpy(cap->driver, "uvcvideo", sizeof(cap->driver));
-       strlcpy(cap->card, vdev->name, sizeof(cap->card));
+       strscpy(cap->driver, "uvcvideo", sizeof(cap->driver));
+       strscpy(cap->card, vdev->name, sizeof(cap->card));
        usb_make_path(stream->dev->udev, cap->bus_info, sizeof(cap->bus_info));
        cap->capabilities = V4L2_CAP_DEVICE_CAPS | V4L2_CAP_STREAMING
                          | chain->caps;
@@ -618,7 +618,7 @@ static int uvc_ioctl_enum_fmt(struct uvc_streaming *stream,
        fmt->flags = 0;
        if (format->flags & UVC_FMT_FLAG_COMPRESSED)
                fmt->flags |= V4L2_FMT_FLAG_COMPRESSED;
-       strlcpy(fmt->description, format->name, sizeof(fmt->description));
+       strscpy(fmt->description, format->name, sizeof(fmt->description));
        fmt->description[sizeof(fmt->description) - 1] = 0;
        fmt->pixelformat = format->fcc;
        return 0;
@@ -859,7 +859,7 @@ static int uvc_ioctl_enum_input(struct file *file, void *fh,
 
        memset(input, 0, sizeof(*input));
        input->index = index;
-       strlcpy(input->name, iterm->name, sizeof(input->name));
+       strscpy(input->name, iterm->name, sizeof(input->name));
        if (UVC_ENTITY_TYPE(iterm) == UVC_ITT_CAMERA)
                input->type = V4L2_INPUT_TYPE_CAMERA;
 
@@ -939,7 +939,7 @@ static int uvc_ioctl_query_ext_ctrl(struct file *file, void *fh,
 
        qec->id = qc.id;
        qec->type = qc.type;
-       strlcpy(qec->name, qc.name, sizeof(qec->name));
+       strscpy(qec->name, qc.name, sizeof(qec->name));
        qec->minimum = qc.minimum;
        qec->maximum = qc.maximum;
        qec->step = qc.step;
index b8886102c5ed6325b6ef36eddc34bca80e1a5859..0ba98583c7360b6342ee1739ae8927c667897a6a 100644 (file)
@@ -702,9 +702,9 @@ static int zr364xx_vidioc_querycap(struct file *file, void *priv,
 {
        struct zr364xx_camera *cam = video_drvdata(file);
 
-       strlcpy(cap->driver, DRIVER_DESC, sizeof(cap->driver));
-       strlcpy(cap->card, cam->udev->product, sizeof(cap->card));
-       strlcpy(cap->bus_info, dev_name(&cam->udev->dev),
+       strscpy(cap->driver, DRIVER_DESC, sizeof(cap->driver));
+       strscpy(cap->card, cam->udev->product, sizeof(cap->card));
+       strscpy(cap->bus_info, dev_name(&cam->udev->dev),
                sizeof(cap->bus_info));
        cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |
                            V4L2_CAP_READWRITE |
index b518b92d6d96e5cc3bd3047bded18d54a52f979b..a443cfa050b68db1f24c992d90294d38d70eb45e 100644 (file)
@@ -100,7 +100,7 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 _min, s32 _max, s32 _
        qctrl->step = step;
        qctrl->default_value = def;
        qctrl->reserved[0] = qctrl->reserved[1] = 0;
-       strlcpy(qctrl->name, name, sizeof(qctrl->name));
+       strscpy(qctrl->name, name, sizeof(qctrl->name));
        return 0;
 }
 EXPORT_SYMBOL(v4l2_ctrl_query_fill);
@@ -186,7 +186,7 @@ struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev,
        /* Setup the i2c board info with the device type and
           the device address. */
        memset(&info, 0, sizeof(info));
-       strlcpy(info.type, client_type, sizeof(info.type));
+       strscpy(info.type, client_type, sizeof(info.type));
        info.addr = addr;
 
        return v4l2_i2c_new_subdev_board(v4l2_dev, adapter, &info, probe_addrs);
@@ -255,7 +255,7 @@ void v4l2_spi_subdev_init(struct v4l2_subdev *sd, struct spi_device *spi,
        v4l2_set_subdevdata(sd, spi);
        spi_set_drvdata(spi, sd);
        /* initialize name */
-       strlcpy(sd->name, spi->dev.driver->name, sizeof(sd->name));
+       strscpy(sd->name, spi->dev.driver->name, sizeof(sd->name));
 }
 EXPORT_SYMBOL_GPL(v4l2_spi_subdev_init);
 
index 599c1cbff3b9e9e4cc584b3a4b395d11094ec995..ee006d34c19f08934cd1b0889563eb33fd73dd6b 100644 (file)
@@ -2722,7 +2722,7 @@ int v4l2_query_ext_ctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_query_ext_ctr
                qc->id = id;
        else
                qc->id = ctrl->id;
-       strlcpy(qc->name, ctrl->name, sizeof(qc->name));
+       strscpy(qc->name, ctrl->name, sizeof(qc->name));
        qc->flags = user_flags(ctrl);
        qc->type = ctrl->type;
        qc->elem_size = ctrl->elem_size;
@@ -2754,7 +2754,7 @@ int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc)
        qc->id = qec.id;
        qc->type = qec.type;
        qc->flags = qec.flags;
-       strlcpy(qc->name, qec.name, sizeof(qc->name));
+       strscpy(qc->name, qec.name, sizeof(qc->name));
        switch (qc->type) {
        case V4L2_CTRL_TYPE_INTEGER:
        case V4L2_CTRL_TYPE_BOOLEAN:
@@ -2813,7 +2813,7 @@ int v4l2_querymenu(struct v4l2_ctrl_handler *hdl, struct v4l2_querymenu *qm)
        if (ctrl->type == V4L2_CTRL_TYPE_MENU) {
                if (ctrl->qmenu[i] == NULL || ctrl->qmenu[i][0] == '\0')
                        return -EINVAL;
-               strlcpy(qm->name, ctrl->qmenu[i], sizeof(qm->name));
+               strscpy(qm->name, ctrl->qmenu[i], sizeof(qm->name));
        } else {
                qm->value = ctrl->qmenu_int[i];
        }
@@ -3442,7 +3442,7 @@ int __v4l2_ctrl_s_ctrl_string(struct v4l2_ctrl *ctrl, const char *s)
 
        /* It's a driver bug if this happens. */
        WARN_ON(ctrl->type != V4L2_CTRL_TYPE_STRING);
-       strlcpy(ctrl->p_new.p_char, s, ctrl->maximum + 1);
+       strscpy(ctrl->p_new.p_char, s, ctrl->maximum + 1);
        return set_ctrl(NULL, ctrl, 0);
 }
 EXPORT_SYMBOL(__v4l2_ctrl_s_ctrl_string);
index 3940e55c72f1f7754bc04a44b295f66432537d46..098562901f2533cfca5b8f5081819f5b328b2827 100644 (file)
@@ -245,7 +245,7 @@ int v4l2_device_register_subdev_nodes(struct v4l2_device *v4l2_dev)
                }
 
                video_set_drvdata(vdev, sd);
-               strlcpy(vdev->name, sd->name, sizeof(vdev->name));
+               strscpy(vdev->name, sd->name, sizeof(vdev->name));
                vdev->v4l2_dev = v4l2_dev;
                vdev->fops = &v4l2_subdev_fops;
                vdev->release = v4l2_device_release_subdev_node;
index 215b4804ada29a5d8b037c96ad6bc1ebfd968eaa..1697932af5ea19bb8af5a1c906b8fa615ccf1560 100644 (file)
@@ -640,7 +640,7 @@ static struct v4l2_flash *__v4l2_flash_init(
        v4l2_subdev_init(sd, &v4l2_flash_subdev_ops);
        sd->internal_ops = &v4l2_flash_subdev_internal_ops;
        sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
-       strlcpy(sd->name, config->dev_name, sizeof(sd->name));
+       strscpy(sd->name, config->dev_name, sizeof(sd->name));
 
        ret = media_entity_pads_init(&sd->entity, 0, NULL);
        if (ret < 0)
index 54afc9c7ee6ea162b96a83f44389ae98dc9293d1..7de041bae84fb2f2b08705904b304ad61cb9af25 100644 (file)
@@ -121,7 +121,7 @@ int v4l2_video_std_construct(struct v4l2_standard *vs,
        vs->id = id;
        v4l2_video_std_frame_period(id, &vs->frameperiod);
        vs->framelines = (id & V4L2_STD_525_60) ? 525 : 625;
-       strlcpy(vs->name, name, sizeof(vs->name));
+       strscpy(vs->name, name, sizeof(vs->name));
        return 0;
 }
 EXPORT_SYMBOL(v4l2_video_std_construct);
@@ -1352,7 +1352,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
        }
 
        if (descr)
-               WARN_ON(strlcpy(fmt->description, descr, sz) >= sz);
+               WARN_ON(strscpy(fmt->description, descr, sz) >= sz);
        fmt->flags = flags;
 }
 
@@ -2391,7 +2391,7 @@ static int v4l_dbg_g_chip_info(const struct v4l2_ioctl_ops *ops,
                        p->flags |= V4L2_CHIP_FL_WRITABLE;
                if (ops->vidioc_g_register)
                        p->flags |= V4L2_CHIP_FL_READABLE;
-               strlcpy(p->name, vfd->v4l2_dev->name, sizeof(p->name));
+               strscpy(p->name, vfd->v4l2_dev->name, sizeof(p->name));
                if (ops->vidioc_g_chip_info)
                        return ops->vidioc_g_chip_info(file, fh, arg);
                if (p->match.addr)
@@ -2408,7 +2408,7 @@ static int v4l_dbg_g_chip_info(const struct v4l2_ioctl_ops *ops,
                                p->flags |= V4L2_CHIP_FL_WRITABLE;
                        if (sd->ops->core && sd->ops->core->g_register)
                                p->flags |= V4L2_CHIP_FL_READABLE;
-                       strlcpy(p->name, sd->name, sizeof(p->name));
+                       strscpy(p->name, sd->name, sizeof(p->name));
                        return 0;
                }
                break;
index 2b63fa6b6fc9a7391b2c80846298b6282563e25e..792f41dffe2329b97d76fab2029c7a99ff47e713 100644 (file)
@@ -273,7 +273,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg)
                        p->flags |= V4L2_CHIP_FL_WRITABLE;
                if (sd->ops->core && sd->ops->core->g_register)
                        p->flags |= V4L2_CHIP_FL_READABLE;
-               strlcpy(p->name, sd->name, sizeof(p->name));
+               strscpy(p->name, sd->name, sizeof(p->name));
                return 0;
        }
 #endif
index a90b2eb112f9a4724610dcc98d9ddaa0a491c66c..874d290f962268987bdd39749c6371b7837712b6 100644 (file)
@@ -2304,9 +2304,9 @@ static int bcm2048_vidioc_querycap(struct file *file, void *priv,
 {
        struct bcm2048_device *bdev = video_get_drvdata(video_devdata(file));
 
-       strlcpy(capability->driver, BCM2048_DRIVER_NAME,
+       strscpy(capability->driver, BCM2048_DRIVER_NAME,
                sizeof(capability->driver));
-       strlcpy(capability->card, BCM2048_DRIVER_CARD,
+       strscpy(capability->card, BCM2048_DRIVER_CARD,
                sizeof(capability->card));
        snprintf(capability->bus_info, 32, "I2C: 0x%X", bdev->client->addr);
        capability->device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO |
index 95942768639cdeb7108cb569f238f9b10b2bf324..7c09efc6c29984c978cda1ab57f23109a0e05b49 100644 (file)
@@ -1801,7 +1801,7 @@ vpfe_ipipe_init(struct vpfe_ipipe_device *ipipe, struct platform_device *pdev)
 
        v4l2_subdev_init(sd, &ipipe_v4l2_ops);
        sd->internal_ops = &ipipe_v4l2_internal_ops;
-       strlcpy(sd->name, "DAVINCI IPIPE", sizeof(sd->name));
+       strscpy(sd->name, "DAVINCI IPIPE", sizeof(sd->name));
        sd->grp_id = 1 << 16;   /* group ID for davinci subdevs */
        v4l2_set_subdevdata(sd, ipipe);
        sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
index 11c9edfbdbe39139a12637d4bece8fe1c47c17e9..a53231b08d30ee390e9565cfc52c185023692778 100644 (file)
@@ -1020,7 +1020,7 @@ int vpfe_ipipeif_init(struct vpfe_ipipeif_device *ipipeif,
        v4l2_subdev_init(sd, &ipipeif_v4l2_ops);
 
        sd->internal_ops = &ipipeif_v4l2_internal_ops;
-       strlcpy(sd->name, "DAVINCI IPIPEIF", sizeof(sd->name));
+       strscpy(sd->name, "DAVINCI IPIPEIF", sizeof(sd->name));
        sd->grp_id = 1 << 16;   /* group ID for davinci subdevs */
 
        v4l2_set_subdevdata(sd, ipipeif);
index 745e33fa6beaec740144984c7e8804a1420e7367..39eb0819ab4e2c670c25e20e2ce3a2a786c70014 100644 (file)
@@ -2038,7 +2038,7 @@ int vpfe_isif_init(struct vpfe_isif_device *isif, struct platform_device *pdev)
        isif->video_out.ops = &isif_video_ops;
        v4l2_subdev_init(sd, &isif_v4l2_ops);
        sd->internal_ops = &isif_v4l2_internal_ops;
-       strlcpy(sd->name, "DAVINCI ISIF", sizeof(sd->name));
+       strscpy(sd->name, "DAVINCI ISIF", sizeof(sd->name));
        sd->grp_id = 1 << 16;   /* group ID for davinci subdevs */
        v4l2_set_subdevdata(sd, isif);
        sd->flags |= V4L2_SUBDEV_FL_HAS_EVENTS | V4L2_SUBDEV_FL_HAS_DEVNODE;
index 2b797474a34463d9743ed1a148f7a004c56c6a62..aac6dbfc646f625564e65a394c69faf14605f4e2 100644 (file)
@@ -1903,7 +1903,7 @@ int vpfe_resizer_init(struct vpfe_resizer_device *vpfe_rsz,
 
        v4l2_subdev_init(sd, &resizer_v4l2_ops);
        sd->internal_ops = &resizer_v4l2_internal_ops;
-       strlcpy(sd->name, "DAVINCI RESIZER CROP", sizeof(sd->name));
+       strscpy(sd->name, "DAVINCI RESIZER CROP", sizeof(sd->name));
        sd->grp_id = 1 << 16;   /* group ID for davinci subdevs */
        v4l2_set_subdevdata(sd, vpfe_rsz);
        sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
@@ -1927,7 +1927,7 @@ int vpfe_resizer_init(struct vpfe_resizer_device *vpfe_rsz,
 
        v4l2_subdev_init(sd, &resizer_v4l2_ops);
        sd->internal_ops = &resizer_v4l2_internal_ops;
-       strlcpy(sd->name, "DAVINCI RESIZER A", sizeof(sd->name));
+       strscpy(sd->name, "DAVINCI RESIZER A", sizeof(sd->name));
        sd->grp_id = 1 << 16;   /* group ID for davinci subdevs */
        v4l2_set_subdevdata(sd, vpfe_rsz);
        sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
@@ -1949,7 +1949,7 @@ int vpfe_resizer_init(struct vpfe_resizer_device *vpfe_rsz,
 
        v4l2_subdev_init(sd, &resizer_v4l2_ops);
        sd->internal_ops = &resizer_v4l2_internal_ops;
-       strlcpy(sd->name, "DAVINCI RESIZER B", sizeof(sd->name));
+       strscpy(sd->name, "DAVINCI RESIZER B", sizeof(sd->name));
        sd->grp_id = 1 << 16;   /* group ID for davinci subdevs */
        v4l2_set_subdevdata(sd, vpfe_rsz);
        sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
index 1269a983455e57c5434b71dc145f07f1a088623c..5e42490331b7620f6eaa56b73e7259597f4f941a 100644 (file)
@@ -618,9 +618,9 @@ static int vpfe_querycap(struct file *file, void  *priv,
                cap->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
        cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT |
                            V4L2_CAP_STREAMING | V4L2_CAP_DEVICE_CAPS;
-       strlcpy(cap->driver, CAPTURE_DRV_NAME, sizeof(cap->driver));
-       strlcpy(cap->bus_info, "VPFE", sizeof(cap->bus_info));
-       strlcpy(cap->card, vpfe_dev->cfg->card_name, sizeof(cap->card));
+       strscpy(cap->driver, CAPTURE_DRV_NAME, sizeof(cap->driver));
+       strscpy(cap->bus_info, "VPFE", sizeof(cap->bus_info));
+       strscpy(cap->card, vpfe_dev->cfg->card_name, sizeof(cap->card));
 
        return 0;
 }
index 256039ce561e6c89f4cc4e123f6046ff59308c3e..b37e1186eb2f9fb6680a852eefbd66bd93b203c4 100644 (file)
@@ -73,8 +73,8 @@ static int vidioc_querycap(struct file *file, void *fh,
 {
        struct capture_priv *priv = video_drvdata(file);
 
-       strlcpy(cap->driver, "imx-media-capture", sizeof(cap->driver));
-       strlcpy(cap->card, "imx-media-capture", sizeof(cap->card));
+       strscpy(cap->driver, "imx-media-capture", sizeof(cap->driver));
+       strscpy(cap->card, "imx-media-capture", sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info),
                 "platform:%s", priv->src_sd->name);
 
index b0be80f05767869b9947a64dabd657ea18a129c4..1931d1b038dc89e96a423d43ab5fcb15e88d9cc7 100644 (file)
@@ -498,14 +498,14 @@ static int imx_media_probe(struct platform_device *pdev)
 
        dev_set_drvdata(dev, imxmd);
 
-       strlcpy(imxmd->md.model, "imx-media", sizeof(imxmd->md.model));
+       strscpy(imxmd->md.model, "imx-media", sizeof(imxmd->md.model));
        imxmd->md.ops = &imx_media_md_ops;
        imxmd->md.dev = dev;
 
        mutex_init(&imxmd->mutex);
 
        imxmd->v4l2_dev.mdev = &imxmd->md;
-       strlcpy(imxmd->v4l2_dev.name, "imx-media",
+       strscpy(imxmd->v4l2_dev.name, "imx-media",
                sizeof(imxmd->v4l2_dev.name));
 
        media_device_init(&imxmd->md);
index b1036baebb0357e741e729053b164a3c99d4d618..960f43fddfc1a2b57c7c86ac847ffb7e82b70153 100644 (file)
@@ -989,7 +989,7 @@ static int iss_register_entities(struct iss_device *iss)
        int ret;
 
        iss->media_dev.dev = iss->dev;
-       strlcpy(iss->media_dev.model, "TI OMAP4 ISS",
+       strscpy(iss->media_dev.model, "TI OMAP4 ISS",
                sizeof(iss->media_dev.model));
        iss->media_dev.hw_revision = iss->revision;
        iss->media_dev.ops = &iss_media_ops;
index d86ef8a031f2878726c57d834e159a957609e990..caf4fab5a229c4e3ec0ac905e1fabe4139864fe4 100644 (file)
@@ -507,7 +507,7 @@ static int ipipe_init_entities(struct iss_ipipe_device *ipipe)
 
        v4l2_subdev_init(sd, &ipipe_v4l2_ops);
        sd->internal_ops = &ipipe_v4l2_internal_ops;
-       strlcpy(sd->name, "OMAP4 ISS ISP IPIPE", sizeof(sd->name));
+       strscpy(sd->name, "OMAP4 ISS ISP IPIPE", sizeof(sd->name));
        sd->grp_id = BIT(16);   /* group ID for iss subdevs */
        v4l2_set_subdevdata(sd, ipipe);
        sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
index cb88b2bd0d82bee09659f3668c1c13dfca2abc29..5f33506fb1b9e6d9b690dc8ee2c0956f0f42ac26 100644 (file)
@@ -738,7 +738,7 @@ static int ipipeif_init_entities(struct iss_ipipeif_device *ipipeif)
 
        v4l2_subdev_init(sd, &ipipeif_v4l2_ops);
        sd->internal_ops = &ipipeif_v4l2_internal_ops;
-       strlcpy(sd->name, "OMAP4 ISS ISP IPIPEIF", sizeof(sd->name));
+       strscpy(sd->name, "OMAP4 ISS ISP IPIPEIF", sizeof(sd->name));
        sd->grp_id = BIT(16);   /* group ID for iss subdevs */
        v4l2_set_subdevdata(sd, ipipeif);
        sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
index 4bbfa20b3c380ffd3933c7466c977b6a433755a7..27f0d7168e508718223ae06bf6dbd3a3b2142274 100644 (file)
@@ -781,7 +781,7 @@ static int resizer_init_entities(struct iss_resizer_device *resizer)
 
        v4l2_subdev_init(sd, &resizer_v4l2_ops);
        sd->internal_ops = &resizer_v4l2_internal_ops;
-       strlcpy(sd->name, "OMAP4 ISS ISP resizer", sizeof(sd->name));
+       strscpy(sd->name, "OMAP4 ISS ISP resizer", sizeof(sd->name));
        sd->grp_id = BIT(16);   /* group ID for iss subdevs */
        v4l2_set_subdevdata(sd, resizer);
        sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
index 16478fe9e3f8ad3e07cdfbc84db734d4834f6530..124f304907b65639d4ee156e08d33c4c4469304d 100644 (file)
@@ -534,9 +534,9 @@ iss_video_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
 {
        struct iss_video *video = video_drvdata(file);
 
-       strlcpy(cap->driver, ISS_VIDEO_DRIVER_NAME, sizeof(cap->driver));
-       strlcpy(cap->card, video->video.name, sizeof(cap->card));
-       strlcpy(cap->bus_info, "media", sizeof(cap->bus_info));
+       strscpy(cap->driver, ISS_VIDEO_DRIVER_NAME, sizeof(cap->driver));
+       strscpy(cap->card, video->video.name, sizeof(cap->card));
+       strscpy(cap->bus_info, "media", sizeof(cap->bus_info));
 
        if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
                cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
@@ -573,7 +573,7 @@ iss_video_enum_format(struct file *file, void *fh, struct v4l2_fmtdesc *f)
 
                if (index == 0) {
                        f->pixelformat = info->pixelformat;
-                       strlcpy(f->description, info->description,
+                       strscpy(f->description, info->description,
                                sizeof(f->description));
                        return 0;
                }
@@ -1053,7 +1053,7 @@ iss_video_enum_input(struct file *file, void *fh, struct v4l2_input *input)
        if (input->index > 0)
                return -EINVAL;
 
-       strlcpy(input->name, "camera", sizeof(input->name));
+       strscpy(input->name, "camera", sizeof(input->name));
        input->type = V4L2_INPUT_TYPE_CAMERA;
 
        return 0;
index a6b9ebd20263c37d4a2363a6be56ff78666059c1..e69a43ae74c2e17e3b93a3ebe73954daaefd3593 100644 (file)
@@ -706,7 +706,7 @@ zoran_register_i2c (struct zoran *zr)
 {
        zr->i2c_algo = zoran_i2c_bit_data_template;
        zr->i2c_algo.data = zr;
-       strlcpy(zr->i2c_adapter.name, ZR_DEVNAME(zr),
+       strscpy(zr->i2c_adapter.name, ZR_DEVNAME(zr),
                sizeof(zr->i2c_adapter.name));
        i2c_set_adapdata(&zr->i2c_adapter, &zr->v4l2_dev);
        zr->i2c_adapter.algo_data = &zr->i2c_algo;
@@ -1145,7 +1145,7 @@ static struct videocodec_master *zoran_setup_videocodec(struct zoran *zr,
        m->type = 0;
 
        m->flags = CODEC_FLAG_ENCODER | CODEC_FLAG_DECODER;
-       strlcpy(m->name, ZR_DEVNAME(zr), sizeof(m->name));
+       strscpy(m->name, ZR_DEVNAME(zr), sizeof(m->name));
        m->data = zr;
 
        switch (type)
index d7842224fff6351e5d9a9befa01760f965969fc5..e30c3ef31a9bb1db0c78c4fe4c259d38928c7646 100644 (file)
@@ -1510,8 +1510,8 @@ static int zoran_querycap(struct file *file, void *__fh, struct v4l2_capability
        struct zoran_fh *fh = __fh;
        struct zoran *zr = fh->zr;
 
-       strlcpy(cap->card, ZR_DEVNAME(zr), sizeof(cap->card));
-       strlcpy(cap->driver, "zoran", sizeof(cap->driver));
+       strscpy(cap->card, ZR_DEVNAME(zr), sizeof(cap->card));
+       strscpy(cap->driver, "zoran", sizeof(cap->driver));
        snprintf(cap->bus_info, sizeof(cap->bus_info), "PCI:%s",
                 pci_name(zr->pci_dev));
        cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_CAPTURE |