media: replace strcpy() by strscpy()

The strcpy() function is being deprecated upstream. Replace
it by the safer strscpy().

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
Mauro Carvalho Chehab 2018-09-10 16:20:42 -04:00
parent c0decac19d
commit cc1e6315e8
83 changed files with 225 additions and 199 deletions

View File

@ -451,7 +451,7 @@ static int vidioc_querycap(struct file *file, void *fh, struct v4l2_capability *
struct video_device *vdev = video_devdata(file); struct video_device *vdev = video_devdata(file);
struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
strcpy((char *)cap->driver, "saa7146 v4l2"); strscpy((char *)cap->driver, "saa7146 v4l2", sizeof(cap->driver));
strscpy((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)); sprintf((char *)cap->bus_info, "PCI:%s", pci_name(dev->pci));
cap->device_caps = cap->device_caps =

View File

@ -2422,7 +2422,7 @@ static int dvb_frontend_handle_ioctl(struct file *file,
struct dvb_frontend_info *info = parg; struct dvb_frontend_info *info = parg;
memset(info, 0, sizeof(*info)); memset(info, 0, sizeof(*info));
strcpy(info->name, fe->ops.info.name); strscpy(info->name, fe->ops.info.name, sizeof(info->name));
info->symbol_rate_min = fe->ops.info.symbol_rate_min; info->symbol_rate_min = fe->ops.info.symbol_rate_min;
info->symbol_rate_max = fe->ops.info.symbol_rate_max; info->symbol_rate_max = fe->ops.info.symbol_rate_max;
info->symbol_rate_tolerance = fe->ops.info.symbol_rate_tolerance; info->symbol_rate_tolerance = fe->ops.info.symbol_rate_tolerance;

View File

@ -815,17 +815,20 @@ struct dvb_frontend *mt312_attach(const struct mt312_config *config,
switch (state->id) { switch (state->id) {
case ID_VP310: case ID_VP310:
strcpy(state->frontend.ops.info.name, "Zarlink VP310 DVB-S"); strscpy(state->frontend.ops.info.name, "Zarlink VP310 DVB-S",
sizeof(state->frontend.ops.info.name));
state->xtal = MT312_PLL_CLK; state->xtal = MT312_PLL_CLK;
state->freq_mult = 9; state->freq_mult = 9;
break; break;
case ID_MT312: case ID_MT312:
strcpy(state->frontend.ops.info.name, "Zarlink MT312 DVB-S"); strscpy(state->frontend.ops.info.name, "Zarlink MT312 DVB-S",
sizeof(state->frontend.ops.info.name));
state->xtal = MT312_PLL_CLK; state->xtal = MT312_PLL_CLK;
state->freq_mult = 6; state->freq_mult = 6;
break; break;
case ID_ZL10313: case ID_ZL10313:
strcpy(state->frontend.ops.info.name, "Zarlink ZL10313 DVB-S"); strscpy(state->frontend.ops.info.name, "Zarlink ZL10313 DVB-S",
sizeof(state->frontend.ops.info.name));
state->xtal = MT312_PLL_CLK_10_111; state->xtal = MT312_PLL_CLK_10_111;
state->freq_mult = 9; state->freq_mult = 9;
break; break;

View File

@ -288,8 +288,9 @@ struct dvb_frontend *zl10039_attach(struct dvb_frontend *fe,
state->id = state->id & 0x0f; state->id = state->id & 0x0f;
switch (state->id) { switch (state->id) {
case ID_ZL10039: case ID_ZL10039:
strcpy(fe->ops.tuner_ops.info.name, strscpy(fe->ops.tuner_ops.info.name,
"Zarlink ZL10039 DVB-S tuner"); "Zarlink ZL10039 DVB-S tuner",
sizeof(fe->ops.tuner_ops.info.name));
break; break;
default: default:
dprintk("Chip ID=%x does not match a known type\n", state->id); dprintk("Chip ID=%x does not match a known type\n", state->id);

View File

@ -247,7 +247,7 @@ void fdtv_frontend_init(struct firedtv *fdtv, const char *name)
dev_err(fdtv->device, "no frontend for model type %d\n", dev_err(fdtv->device, "no frontend for model type %d\n",
fdtv->type); fdtv->type);
} }
strcpy(fi->name, name); strscpy(fi->name, name, sizeof(fi->name));
fdtv->fe.dvb = &fdtv->adapter; fdtv->fe.dvb = &fdtv->adapter;
fdtv->fe.sec_priv = fdtv; fdtv->fe.sec_priv = fdtv;

View File

@ -317,7 +317,7 @@ static int ad5820_probe(struct i2c_client *client,
v4l2_i2c_subdev_init(&coil->subdev, client, &ad5820_ops); v4l2_i2c_subdev_init(&coil->subdev, client, &ad5820_ops);
coil->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; coil->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
coil->subdev.internal_ops = &ad5820_internal_ops; coil->subdev.internal_ops = &ad5820_internal_ops;
strcpy(coil->subdev.name, "ad5820 focus"); strscpy(coil->subdev.name, "ad5820 focus", sizeof(coil->subdev.name));
ret = media_entity_pads_init(&coil->subdev.entity, 0, NULL); ret = media_entity_pads_init(&coil->subdev.entity, 0, NULL);
if (ret < 0) if (ret < 0)

View File

@ -362,7 +362,8 @@ static int lm3560_subdev_init(struct lm3560_flash *flash,
v4l2_i2c_subdev_init(&flash->subdev_led[led_no], client, &lm3560_ops); v4l2_i2c_subdev_init(&flash->subdev_led[led_no], client, &lm3560_ops);
flash->subdev_led[led_no].flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; flash->subdev_led[led_no].flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
strcpy(flash->subdev_led[led_no].name, led_name); strscpy(flash->subdev_led[led_no].name, led_name,
sizeof(flash->subdev_led[led_no].name));
rval = lm3560_init_controls(flash, led_no); rval = lm3560_init_controls(flash, led_no);
if (rval) if (rval)
goto err_out; goto err_out;

View File

@ -278,7 +278,8 @@ static int lm3646_subdev_init(struct lm3646_flash *flash)
v4l2_i2c_subdev_init(&flash->subdev_led, client, &lm3646_ops); v4l2_i2c_subdev_init(&flash->subdev_led, client, &lm3646_ops);
flash->subdev_led.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; flash->subdev_led.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
strcpy(flash->subdev_led.name, LM3646_NAME); strscpy(flash->subdev_led.name, LM3646_NAME,
sizeof(flash->subdev_led.name));
rval = lm3646_init_controls(flash); rval = lm3646_init_controls(flash);
if (rval) if (rval)
goto err_out; goto err_out;

View File

@ -1698,7 +1698,7 @@ static int s5c73m3_probe(struct i2c_client *client,
return ret; return ret;
v4l2_i2c_subdev_init(oif_sd, client, &oif_subdev_ops); v4l2_i2c_subdev_init(oif_sd, client, &oif_subdev_ops);
strcpy(oif_sd->name, "S5C73M3-OIF"); strscpy(oif_sd->name, "S5C73M3-OIF", sizeof(oif_sd->name));
oif_sd->internal_ops = &oif_internal_ops; oif_sd->internal_ops = &oif_internal_ops;
oif_sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; oif_sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;

View File

@ -703,7 +703,7 @@ static int sr030pc30_probe(struct i2c_client *client,
return -ENOMEM; return -ENOMEM;
sd = &info->sd; sd = &info->sd;
strcpy(sd->name, MODULE_NAME); strscpy(sd->name, MODULE_NAME, sizeof(sd->name));
info->pdata = client->dev.platform_data; info->pdata = client->dev.platform_data;
v4l2_i2c_subdev_init(sd, client, &sr030pc30_ops); v4l2_i2c_subdev_init(sd, client, &sr030pc30_ops);

View File

@ -2782,7 +2782,7 @@ static int bttv_g_tuner(struct file *file, void *priv,
t->rxsubchans = V4L2_TUNER_SUB_MONO; t->rxsubchans = V4L2_TUNER_SUB_MONO;
t->capability = V4L2_TUNER_CAP_NORM; t->capability = V4L2_TUNER_CAP_NORM;
bttv_call_all(btv, tuner, g_tuner, t); bttv_call_all(btv, tuner, g_tuner, t);
strcpy(t->name, "Television"); strscpy(t->name, "Television", sizeof(t->name));
t->type = V4L2_TUNER_ANALOG_TV; t->type = V4L2_TUNER_ANALOG_TV;
if (btread(BT848_DSTATUS)&BT848_DSTATUS_HLOC) if (btread(BT848_DSTATUS)&BT848_DSTATUS_HLOC)
t->signal = 0xffff; t->signal = 0xffff;
@ -3257,7 +3257,7 @@ static int radio_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
if (0 != t->index) if (0 != t->index)
return -EINVAL; return -EINVAL;
strcpy(t->name, "Radio"); strscpy(t->name, "Radio", sizeof(t->name));
t->type = V4L2_TUNER_RADIO; t->type = V4L2_TUNER_RADIO;
radio_enable(btv); radio_enable(btv);

View File

@ -1280,7 +1280,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
return -EINVAL; return -EINVAL;
if (0 != t->index) if (0 != t->index)
return -EINVAL; return -EINVAL;
strcpy(t->name, "Television"); strscpy(t->name, "Television", sizeof(t->name));
call_all(dev, tuner, g_tuner, t); call_all(dev, tuner, g_tuner, t);
dprintk(1, "VIDIOC_G_TUNER: tuner type %d\n", t->type); dprintk(1, "VIDIOC_G_TUNER: tuner type %d\n", t->type);

View File

@ -526,7 +526,7 @@ static int snd_cx23885_pcm(struct cx23885_audio_dev *chip, int device,
if (err < 0) if (err < 0)
return err; return err;
pcm->private_data = chip; pcm->private_data = chip;
strcpy(pcm->name, name); strscpy(pcm->name, name, sizeof(pcm->name));
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cx23885_pcm_ops); snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cx23885_pcm_ops);
return 0; return 0;
@ -571,7 +571,7 @@ struct cx23885_audio_dev *cx23885_audio_register(struct cx23885_dev *dev)
if (err < 0) if (err < 0)
goto error; goto error;
strcpy(card->driver, "CX23885"); strscpy(card->driver, "CX23885", sizeof(card->driver));
sprintf(card->shortname, "Conexant CX23885"); sprintf(card->shortname, "Conexant CX23885");
sprintf(card->longname, "%s at %s", card->shortname, dev->name); sprintf(card->longname, "%s at %s", card->shortname, dev->name);

View File

@ -639,7 +639,7 @@ static int vidioc_querycap(struct file *file, void *priv,
struct cx23885_dev *dev = video_drvdata(file); struct cx23885_dev *dev = video_drvdata(file);
struct video_device *vdev = video_devdata(file); struct video_device *vdev = video_devdata(file);
strcpy(cap->driver, "cx23885"); strscpy(cap->driver, "cx23885", sizeof(cap->driver));
strscpy(cap->card, cx23885_boards[dev->board].name, strscpy(cap->card, cx23885_boards[dev->board].name,
sizeof(cap->card)); sizeof(cap->card));
sprintf(cap->bus_info, "PCIe:%s", pci_name(dev->pci)); sprintf(cap->bus_info, "PCIe:%s", pci_name(dev->pci));
@ -731,7 +731,7 @@ int cx23885_enum_input(struct cx23885_dev *dev, struct v4l2_input *i)
i->index = n; i->index = n;
i->type = V4L2_INPUT_TYPE_CAMERA; i->type = V4L2_INPUT_TYPE_CAMERA;
strcpy(i->name, iname[INPUT(n)->type]); strscpy(i->name, iname[INPUT(n)->type], sizeof(i->name));
i->std = CX23885_NORMS; i->std = CX23885_NORMS;
if ((CX23885_VMUX_TELEVISION == INPUT(n)->type) || if ((CX23885_VMUX_TELEVISION == INPUT(n)->type) ||
(CX23885_VMUX_CABLE == INPUT(n)->type)) { (CX23885_VMUX_CABLE == INPUT(n)->type)) {
@ -828,7 +828,7 @@ static int cx23885_query_audinput(struct file *file, void *priv,
memset(i, 0, sizeof(*i)); memset(i, 0, sizeof(*i));
i->index = n; i->index = n;
strcpy(i->name, iname[n]); strscpy(i->name, iname[n], sizeof(i->name));
i->capability = V4L2_AUDCAP_STEREO; i->capability = V4L2_AUDCAP_STEREO;
return 0; return 0;
@ -887,7 +887,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
if (0 != t->index) if (0 != t->index)
return -EINVAL; return -EINVAL;
strcpy(t->name, "Television"); strscpy(t->name, "Television", sizeof(t->name));
call_all(dev, tuner, g_tuner, t); call_all(dev, tuner, g_tuner, t);
return 0; return 0;
@ -1186,7 +1186,8 @@ int cx23885_video_register(struct cx23885_dev *dev)
/* Initialize VBI template */ /* Initialize VBI template */
cx23885_vbi_template = cx23885_video_template; cx23885_vbi_template = cx23885_video_template;
strcpy(cx23885_vbi_template.name, "cx23885-vbi"); strscpy(cx23885_vbi_template.name, "cx23885-vbi",
sizeof(cx23885_vbi_template.name));
dev->tvnorm = V4L2_STD_NTSC_M; dev->tvnorm = V4L2_STD_NTSC_M;
dev->fmt = format_by_fourcc(V4L2_PIX_FMT_YUYV); dev->fmt = format_by_fourcc(V4L2_PIX_FMT_YUYV);

View File

@ -674,7 +674,7 @@ static int snd_cx25821_pcm(struct cx25821_audio_dev *chip, int device,
} }
pcm->private_data = chip; pcm->private_data = chip;
pcm->info_flags = 0; pcm->info_flags = 0;
strcpy(pcm->name, name); strscpy(pcm->name, name, sizeof(pcm->name));
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cx25821_pcm_ops); snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cx25821_pcm_ops);
return 0; return 0;
@ -725,7 +725,7 @@ static int cx25821_audio_initdev(struct cx25821_dev *dev)
return err; return err;
} }
strcpy(card->driver, "cx25821"); strscpy(card->driver, "cx25821", sizeof(card->driver));
/* Card "creation" */ /* Card "creation" */
chip = card->private_data; chip = card->private_data;
@ -754,10 +754,10 @@ static int cx25821_audio_initdev(struct cx25821_dev *dev)
goto error; goto error;
} }
strcpy(card->shortname, "cx25821"); strscpy(card->shortname, "cx25821", sizeof(card->shortname));
sprintf(card->longname, "%s at 0x%lx irq %d", chip->dev->name, sprintf(card->longname, "%s at 0x%lx irq %d", chip->dev->name,
chip->iobase, chip->irq); chip->iobase, chip->irq);
strcpy(card->mixername, "CX25821"); strscpy(card->mixername, "CX25821", sizeof(card->mixername));
pr_info("%s/%i: ALSA support for cx25821 boards\n", card->driver, pr_info("%s/%i: ALSA support for cx25821 boards\n", card->driver,
devno); devno);

View File

@ -441,7 +441,7 @@ static int cx25821_vidioc_querycap(struct file *file, void *priv,
V4L2_CAP_READWRITE | V4L2_CAP_STREAMING; V4L2_CAP_READWRITE | V4L2_CAP_STREAMING;
const u32 cap_output = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_READWRITE; const u32 cap_output = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_READWRITE;
strcpy(cap->driver, "cx25821"); strscpy(cap->driver, "cx25821", sizeof(cap->driver));
strscpy(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)); sprintf(cap->bus_info, "PCIe:%s", pci_name(dev->pci));
if (chan->id >= VID_CHANNEL_NUM) if (chan->id >= VID_CHANNEL_NUM)
@ -486,7 +486,7 @@ static int cx25821_vidioc_enum_input(struct file *file, void *priv,
i->type = V4L2_INPUT_TYPE_CAMERA; i->type = V4L2_INPUT_TYPE_CAMERA;
i->std = CX25821_NORMS; i->std = CX25821_NORMS;
strcpy(i->name, "Composite"); strscpy(i->name, "Composite", sizeof(i->name));
return 0; return 0;
} }
@ -534,7 +534,7 @@ static int cx25821_vidioc_enum_output(struct file *file, void *priv,
o->type = V4L2_INPUT_TYPE_CAMERA; o->type = V4L2_INPUT_TYPE_CAMERA;
o->std = CX25821_NORMS; o->std = CX25821_NORMS;
strcpy(o->name, "Composite"); strscpy(o->name, "Composite", sizeof(o->name));
return 0; return 0;
} }

View File

@ -616,7 +616,7 @@ static int snd_cx88_pcm(struct cx88_audio_dev *chip, int device,
if (err < 0) if (err < 0)
return err; return err;
pcm->private_data = chip; pcm->private_data = chip;
strcpy(pcm->name, name); strscpy(pcm->name, name, sizeof(pcm->name));
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cx88_pcm_ops); snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cx88_pcm_ops);
return 0; return 0;
@ -968,12 +968,12 @@ static int cx88_audio_initdev(struct pci_dev *pci,
goto error; goto error;
} }
strcpy(card->driver, "CX88x"); strscpy(card->driver, "CX88x", sizeof(card->driver));
sprintf(card->shortname, "Conexant CX%x", pci->device); sprintf(card->shortname, "Conexant CX%x", pci->device);
sprintf(card->longname, "%s at %#llx", sprintf(card->longname, "%s at %#llx",
card->shortname, card->shortname,
(unsigned long long)pci_resource_start(pci, 0)); (unsigned long long)pci_resource_start(pci, 0));
strcpy(card->mixername, "CX88"); strscpy(card->mixername, "CX88", sizeof(card->mixername));
dprintk(0, "%s/%i: ALSA support for cx2388x boards\n", dprintk(0, "%s/%i: ALSA support for cx2388x boards\n",
card->driver, devno); card->driver, devno);

View File

@ -803,7 +803,7 @@ static int vidioc_querycap(struct file *file, void *priv,
struct cx8802_dev *dev = video_drvdata(file); struct cx8802_dev *dev = video_drvdata(file);
struct cx88_core *core = dev->core; struct cx88_core *core = dev->core;
strcpy(cap->driver, "cx88_blackbird"); strscpy(cap->driver, "cx88_blackbird", sizeof(cap->driver));
sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci));
return cx88_querycap(file, core, cap); return cx88_querycap(file, core, cap);
} }
@ -995,7 +995,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
if (t->index != 0) if (t->index != 0)
return -EINVAL; return -EINVAL;
strcpy(t->name, "Television"); strscpy(t->name, "Television", sizeof(t->name));
t->capability = V4L2_TUNER_CAP_NORM; t->capability = V4L2_TUNER_CAP_NORM;
t->rangehigh = 0xffffffffUL; t->rangehigh = 0xffffffffUL;
call_all(core, tuner, g_tuner, t); call_all(core, tuner, g_tuner, t);

View File

@ -3693,7 +3693,7 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr)
core->height = 240; core->height = 240;
core->field = V4L2_FIELD_INTERLACED; core->field = V4L2_FIELD_INTERLACED;
strcpy(core->v4l2_dev.name, core->name); strscpy(core->v4l2_dev.name, core->name, sizeof(core->v4l2_dev.name));
if (v4l2_device_register(NULL, &core->v4l2_dev)) { if (v4l2_device_register(NULL, &core->v4l2_dev)) {
kfree(core); kfree(core);
return NULL; return NULL;

View File

@ -842,7 +842,7 @@ static int vidioc_querycap(struct file *file, void *priv,
struct cx8800_dev *dev = video_drvdata(file); struct cx8800_dev *dev = video_drvdata(file);
struct cx88_core *core = dev->core; struct cx88_core *core = dev->core;
strcpy(cap->driver, "cx8800"); strscpy(cap->driver, "cx8800", sizeof(cap->driver));
sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci));
return cx88_querycap(file, core, cap); return cx88_querycap(file, core, cap);
} }
@ -897,7 +897,7 @@ int cx88_enum_input(struct cx88_core *core, struct v4l2_input *i)
if (!INPUT(n).type) if (!INPUT(n).type)
return -EINVAL; return -EINVAL;
i->type = V4L2_INPUT_TYPE_CAMERA; i->type = V4L2_INPUT_TYPE_CAMERA;
strcpy(i->name, iname[INPUT(n).type]); strscpy(i->name, iname[INPUT(n).type], sizeof(i->name));
if ((INPUT(n).type == CX88_VMUX_TELEVISION) || if ((INPUT(n).type == CX88_VMUX_TELEVISION) ||
(INPUT(n).type == CX88_VMUX_CABLE)) (INPUT(n).type == CX88_VMUX_CABLE))
i->type = V4L2_INPUT_TYPE_TUNER; i->type = V4L2_INPUT_TYPE_TUNER;
@ -952,7 +952,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
if (t->index != 0) if (t->index != 0)
return -EINVAL; return -EINVAL;
strcpy(t->name, "Television"); strscpy(t->name, "Television", sizeof(t->name));
t->capability = V4L2_TUNER_CAP_NORM; t->capability = V4L2_TUNER_CAP_NORM;
t->rangehigh = 0xffffffffUL; t->rangehigh = 0xffffffffUL;
call_all(core, tuner, g_tuner, t); call_all(core, tuner, g_tuner, t);
@ -1065,7 +1065,7 @@ static int radio_g_tuner(struct file *file, void *priv,
if (unlikely(t->index > 0)) if (unlikely(t->index > 0))
return -EINVAL; return -EINVAL;
strcpy(t->name, "Radio"); strscpy(t->name, "Radio", sizeof(t->name));
call_all(core, tuner, g_tuner, t); call_all(core, tuner, g_tuner, t);
return 0; return 0;

View File

@ -1046,7 +1046,7 @@ static int dm1105_probe(struct pci_dev *pdev,
/* i2c */ /* i2c */
i2c_set_adapdata(&dev->i2c_adap, dev); i2c_set_adapdata(&dev->i2c_adap, dev);
strcpy(dev->i2c_adap.name, DRIVER_NAME); strscpy(dev->i2c_adap.name, DRIVER_NAME, sizeof(dev->i2c_adap.name));
dev->i2c_adap.owner = THIS_MODULE; dev->i2c_adap.owner = THIS_MODULE;
dev->i2c_adap.dev.parent = &pdev->dev; dev->i2c_adap.dev.parent = &pdev->dev;
dev->i2c_adap.algo = &dm1105_algo; dev->i2c_adap.algo = &dm1105_algo;
@ -1057,7 +1057,8 @@ static int dm1105_probe(struct pci_dev *pdev,
goto err_dm1105_hw_exit; goto err_dm1105_hw_exit;
i2c_set_adapdata(&dev->i2c_bb_adap, dev); i2c_set_adapdata(&dev->i2c_bb_adap, dev);
strcpy(dev->i2c_bb_adap.name, DM1105_I2C_GPIO_NAME); strscpy(dev->i2c_bb_adap.name, DM1105_I2C_GPIO_NAME,
sizeof(dev->i2c_bb_adap.name));
dev->i2c_bb_adap.owner = THIS_MODULE; dev->i2c_bb_adap.owner = THIS_MODULE;
dev->i2c_bb_adap.dev.parent = &pdev->dev; dev->i2c_bb_adap.dev.parent = &pdev->dev;
dev->i2c_bb_adap.algo_data = &dev->i2c_bit; dev->i2c_bb_adap.algo_data = &dev->i2c_bit;

View File

@ -307,8 +307,8 @@ static int dt3155_querycap(struct file *filp, void *p,
{ {
struct dt3155_priv *pd = video_drvdata(filp); struct dt3155_priv *pd = video_drvdata(filp);
strcpy(cap->driver, DT3155_NAME); strscpy(cap->driver, DT3155_NAME, sizeof(cap->driver));
strcpy(cap->card, DT3155_NAME " frame grabber"); strscpy(cap->card, DT3155_NAME " frame grabber", sizeof(cap->card));
sprintf(cap->bus_info, "PCI:%s", pci_name(pd->pdev)); sprintf(cap->bus_info, "PCI:%s", pci_name(pd->pdev));
cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |
V4L2_CAP_STREAMING | V4L2_CAP_READWRITE; V4L2_CAP_STREAMING | V4L2_CAP_READWRITE;
@ -322,7 +322,7 @@ static int dt3155_enum_fmt_vid_cap(struct file *filp,
if (f->index) if (f->index)
return -EINVAL; return -EINVAL;
f->pixelformat = V4L2_PIX_FMT_GREY; f->pixelformat = V4L2_PIX_FMT_GREY;
strcpy(f->description, "8-bit Greyscale"); strscpy(f->description, "8-bit Greyscale", sizeof(f->description));
return 0; return 0;
} }

View File

@ -1019,8 +1019,8 @@ static int meyeioc_stilljcapt(int *len)
static int vidioc_querycap(struct file *file, void *fh, static int vidioc_querycap(struct file *file, void *fh,
struct v4l2_capability *cap) struct v4l2_capability *cap)
{ {
strcpy(cap->driver, "meye"); strscpy(cap->driver, "meye", sizeof(cap->driver));
strcpy(cap->card, "meye"); strscpy(cap->card, "meye", sizeof(cap->card));
sprintf(cap->bus_info, "PCI:%s", pci_name(meye.mchip_dev)); sprintf(cap->bus_info, "PCI:%s", pci_name(meye.mchip_dev));
cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |
@ -1035,7 +1035,7 @@ static int vidioc_enum_input(struct file *file, void *fh, struct v4l2_input *i)
if (i->index != 0) if (i->index != 0)
return -EINVAL; return -EINVAL;
strcpy(i->name, "Camera"); strscpy(i->name, "Camera", sizeof(i->name));
i->type = V4L2_INPUT_TYPE_CAMERA; i->type = V4L2_INPUT_TYPE_CAMERA;
return 0; return 0;
@ -1118,12 +1118,12 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *fh,
if (f->index == 0) { if (f->index == 0) {
/* standard YUV 422 capture */ /* standard YUV 422 capture */
f->flags = 0; f->flags = 0;
strcpy(f->description, "YUV422"); strscpy(f->description, "YUV422", sizeof(f->description));
f->pixelformat = V4L2_PIX_FMT_YUYV; f->pixelformat = V4L2_PIX_FMT_YUYV;
} else { } else {
/* compressed MJPEG capture */ /* compressed MJPEG capture */
f->flags = V4L2_FMT_FLAG_COMPRESSED; f->flags = V4L2_FMT_FLAG_COMPRESSED;
strcpy(f->description, "MJPEG"); strscpy(f->description, "MJPEG", sizeof(f->description));
f->pixelformat = V4L2_PIX_FMT_MJPEG; f->pixelformat = V4L2_PIX_FMT_MJPEG;
} }

View File

@ -161,7 +161,7 @@ int ngene_i2c_init(struct ngene *dev, int dev_nr)
i2c_set_adapdata(adap, &(dev->channel[dev_nr])); i2c_set_adapdata(adap, &(dev->channel[dev_nr]));
strcpy(adap->name, "nGene"); strscpy(adap->name, "nGene", sizeof(adap->name));
adap->algo = &ngene_i2c_algo; adap->algo = &ngene_i2c_algo;
adap->algo_data = (void *)&(dev->channel[dev_nr]); adap->algo_data = (void *)&(dev->channel[dev_nr]);

View File

@ -633,7 +633,7 @@ static int pluto2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* i2c */ /* i2c */
i2c_set_adapdata(&pluto->i2c_adap, pluto); i2c_set_adapdata(&pluto->i2c_adap, pluto);
strcpy(pluto->i2c_adap.name, DRIVER_NAME); strscpy(pluto->i2c_adap.name, DRIVER_NAME, sizeof(pluto->i2c_adap.name));
pluto->i2c_adap.owner = THIS_MODULE; pluto->i2c_adap.owner = THIS_MODULE;
pluto->i2c_adap.dev.parent = &pdev->dev; pluto->i2c_adap.dev.parent = &pdev->dev;
pluto->i2c_adap.algo_data = &pluto->i2c_bit; pluto->i2c_adap.algo_data = &pluto->i2c_bit;

View File

@ -1354,7 +1354,7 @@ static int pt1_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
i2c_adap->algo = &pt1_i2c_algo; i2c_adap->algo = &pt1_i2c_algo;
i2c_adap->algo_data = NULL; i2c_adap->algo_data = NULL;
i2c_adap->dev.parent = &pdev->dev; i2c_adap->dev.parent = &pdev->dev;
strcpy(i2c_adap->name, DRIVER_NAME); strscpy(i2c_adap->name, DRIVER_NAME, sizeof(i2c_adap->name));
i2c_set_adapdata(i2c_adap, pt1); i2c_set_adapdata(i2c_adap, pt1);
ret = i2c_add_adapter(i2c_adap); ret = i2c_add_adapter(i2c_adap);
if (ret < 0) if (ret < 0)

View File

@ -901,7 +901,7 @@ static int snd_card_saa7134_pcm(snd_card_saa7134_t *saa7134, int device)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_card_saa7134_capture_ops); snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_card_saa7134_capture_ops);
pcm->private_data = saa7134; pcm->private_data = saa7134;
pcm->info_flags = 0; pcm->info_flags = 0;
strcpy(pcm->name, "SAA7134 PCM"); strscpy(pcm->name, "SAA7134 PCM", sizeof(pcm->name));
return 0; return 0;
} }
@ -1074,7 +1074,7 @@ static int snd_card_saa7134_new_mixer(snd_card_saa7134_t * chip)
unsigned int idx; unsigned int idx;
int err, addr; int err, addr;
strcpy(card->mixername, "SAA7134 Mixer"); strscpy(card->mixername, "SAA7134 Mixer", sizeof(card->mixername));
for (idx = 0; idx < ARRAY_SIZE(snd_saa7134_volume_controls); idx++) { for (idx = 0; idx < ARRAY_SIZE(snd_saa7134_volume_controls); idx++) {
kcontrol = snd_ctl_new1(&snd_saa7134_volume_controls[idx], kcontrol = snd_ctl_new1(&snd_saa7134_volume_controls[idx],
@ -1138,7 +1138,7 @@ static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum)
if (err < 0) if (err < 0)
return err; return err;
strcpy(card->driver, "SAA7134"); strscpy(card->driver, "SAA7134", sizeof(card->driver));
/* Card "creation" */ /* Card "creation" */
@ -1178,7 +1178,7 @@ static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum)
/* End of "creation" */ /* End of "creation" */
strcpy(card->shortname, "SAA7134"); strscpy(card->shortname, "SAA7134", sizeof(card->shortname));
sprintf(card->longname, "%s at 0x%lx irq %d", sprintf(card->longname, "%s at 0x%lx irq %d",
chip->dev->name, chip->iobase, chip->irq); chip->dev->name, chip->iobase, chip->irq);

View File

@ -437,7 +437,7 @@ int saa7134_i2c_register(struct saa7134_dev *dev)
{ {
dev->i2c_adap = saa7134_adap_template; dev->i2c_adap = saa7134_adap_template;
dev->i2c_adap.dev.parent = &dev->pci->dev; dev->i2c_adap.dev.parent = &dev->pci->dev;
strcpy(dev->i2c_adap.name,dev->name); strscpy(dev->i2c_adap.name, dev->name, sizeof(dev->i2c_adap.name));
dev->i2c_adap.algo_data = dev; dev->i2c_adap.algo_data = dev;
i2c_set_adapdata(&dev->i2c_adap, &dev->v4l2_dev); i2c_set_adapdata(&dev->i2c_adap, &dev->v4l2_dev);
i2c_add_adapter(&dev->i2c_adap); i2c_add_adapter(&dev->i2c_adap);

View File

@ -1445,7 +1445,8 @@ int saa7134_enum_input(struct file *file, void *priv, struct v4l2_input *i)
if (card_in(dev, i->index).type == SAA7134_NO_INPUT) if (card_in(dev, i->index).type == SAA7134_NO_INPUT)
return -EINVAL; return -EINVAL;
i->index = n; i->index = n;
strcpy(i->name, saa7134_input_name[card_in(dev, n).type]); strscpy(i->name, saa7134_input_name[card_in(dev, n).type],
sizeof(i->name));
switch (card_in(dev, n).type) { switch (card_in(dev, n).type) {
case SAA7134_INPUT_TV: case SAA7134_INPUT_TV:
case SAA7134_INPUT_TV_MONO: case SAA7134_INPUT_TV_MONO:
@ -1502,7 +1503,7 @@ int saa7134_querycap(struct file *file, void *priv,
unsigned int tuner_type = dev->tuner_type; unsigned int tuner_type = dev->tuner_type;
strcpy(cap->driver, "saa7134"); strscpy(cap->driver, "saa7134", sizeof(cap->driver));
strscpy(cap->card, saa7134_boards[dev->board].name, strscpy(cap->card, saa7134_boards[dev->board].name,
sizeof(cap->card)); sizeof(cap->card));
sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci));
@ -1747,7 +1748,7 @@ int saa7134_g_tuner(struct file *file, void *priv,
if (n == SAA7134_INPUT_MAX) if (n == SAA7134_INPUT_MAX)
return -EINVAL; return -EINVAL;
if (card_in(dev, n).type != SAA7134_NO_INPUT) { if (card_in(dev, n).type != SAA7134_NO_INPUT) {
strcpy(t->name, "Television"); strscpy(t->name, "Television", sizeof(t->name));
t->type = V4L2_TUNER_ANALOG_TV; t->type = V4L2_TUNER_ANALOG_TV;
saa_call_all(dev, tuner, g_tuner, t); saa_call_all(dev, tuner, g_tuner, t);
t->capability = V4L2_TUNER_CAP_NORM | t->capability = V4L2_TUNER_CAP_NORM |
@ -1939,7 +1940,7 @@ static int radio_g_tuner(struct file *file, void *priv,
if (0 != t->index) if (0 != t->index)
return -EINVAL; return -EINVAL;
strcpy(t->name, "Radio"); strscpy(t->name, "Radio", sizeof(t->name));
saa_call_all(dev, tuner, g_tuner, t); saa_call_all(dev, tuner, g_tuner, t);
t->audmode &= V4L2_TUNER_MODE_MONO | V4L2_TUNER_MODE_STEREO; t->audmode &= V4L2_TUNER_MODE_MONO | V4L2_TUNER_MODE_STEREO;

View File

@ -179,7 +179,7 @@ static void saa7164_histogram_reset(struct saa7164_histogram *hg, char *name)
int i; int i;
memset(hg, 0, sizeof(struct saa7164_histogram)); memset(hg, 0, sizeof(struct saa7164_histogram));
strcpy(hg->name, name); strscpy(hg->name, name, sizeof(hg->name));
/* First 30ms x 1ms */ /* First 30ms x 1ms */
for (i = 0; i < 30; i++) for (i = 0; i < 30; i++)

View File

@ -258,7 +258,7 @@ int saa7164_enum_input(struct file *file, void *priv, struct v4l2_input *i)
if (i->index >= 7) if (i->index >= 7)
return -EINVAL; return -EINVAL;
strcpy(i->name, inputs[i->index]); strscpy(i->name, inputs[i->index], sizeof(i->name));
if (i->index == 0) if (i->index == 0)
i->type = V4L2_INPUT_TYPE_TUNER; i->type = V4L2_INPUT_TYPE_TUNER;
@ -325,7 +325,7 @@ int saa7164_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
if (0 != t->index) if (0 != t->index)
return -EINVAL; return -EINVAL;
strcpy(t->name, "tuner"); strscpy(t->name, "tuner", sizeof(t->name));
t->capability = V4L2_TUNER_CAP_NORM | V4L2_TUNER_CAP_STEREO; t->capability = V4L2_TUNER_CAP_NORM | V4L2_TUNER_CAP_STEREO;
t->rangelow = SAA7164_TV_MIN_FREQ; t->rangelow = SAA7164_TV_MIN_FREQ;
t->rangehigh = SAA7164_TV_MAX_FREQ; t->rangehigh = SAA7164_TV_MAX_FREQ;
@ -497,7 +497,7 @@ static int vidioc_querycap(struct file *file, void *priv,
struct saa7164_port *port = fh->port; struct saa7164_port *port = fh->port;
struct saa7164_dev *dev = port->dev; struct saa7164_dev *dev = port->dev;
strcpy(cap->driver, dev->name); strscpy(cap->driver, dev->name, sizeof(cap->driver));
strscpy(cap->card, saa7164_boards[dev->board].name, strscpy(cap->card, saa7164_boards[dev->board].name,
sizeof(cap->card)); sizeof(cap->card));
sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci));

View File

@ -208,7 +208,7 @@ static int vidioc_querycap(struct file *file, void *priv,
struct saa7164_port *port = fh->port; struct saa7164_port *port = fh->port;
struct saa7164_dev *dev = port->dev; struct saa7164_dev *dev = port->dev;
strcpy(cap->driver, dev->name); strscpy(cap->driver, dev->name, sizeof(cap->driver));
strscpy(cap->card, saa7164_boards[dev->board].name, strscpy(cap->card, saa7164_boards[dev->board].name,
sizeof(cap->card)); sizeof(cap->card));
sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci));

View File

@ -191,7 +191,7 @@ static int smi_i2c_init(struct smi_dev *dev)
/* i2c bus 0 */ /* i2c bus 0 */
smi_i2c_cfg(dev, I2C_A_SW_CTL); smi_i2c_cfg(dev, I2C_A_SW_CTL);
i2c_set_adapdata(&dev->i2c_bus[0], dev); i2c_set_adapdata(&dev->i2c_bus[0], dev);
strcpy(dev->i2c_bus[0].name, "SMI-I2C0"); strscpy(dev->i2c_bus[0].name, "SMI-I2C0", sizeof(dev->i2c_bus[0].name));
dev->i2c_bus[0].owner = THIS_MODULE; dev->i2c_bus[0].owner = THIS_MODULE;
dev->i2c_bus[0].dev.parent = &dev->pci_dev->dev; dev->i2c_bus[0].dev.parent = &dev->pci_dev->dev;
dev->i2c_bus[0].algo_data = &dev->i2c_bit[0]; dev->i2c_bus[0].algo_data = &dev->i2c_bit[0];
@ -213,7 +213,7 @@ static int smi_i2c_init(struct smi_dev *dev)
/* i2c bus 1 */ /* i2c bus 1 */
smi_i2c_cfg(dev, I2C_B_SW_CTL); smi_i2c_cfg(dev, I2C_B_SW_CTL);
i2c_set_adapdata(&dev->i2c_bus[1], dev); i2c_set_adapdata(&dev->i2c_bus[1], dev);
strcpy(dev->i2c_bus[1].name, "SMI-I2C1"); strscpy(dev->i2c_bus[1].name, "SMI-I2C1", sizeof(dev->i2c_bus[1].name));
dev->i2c_bus[1].owner = THIS_MODULE; dev->i2c_bus[1].owner = THIS_MODULE;
dev->i2c_bus[1].dev.parent = &dev->pci_dev->dev; dev->i2c_bus[1].dev.parent = &dev->pci_dev->dev;
dev->i2c_bus[1].algo_data = &dev->i2c_bit[1]; dev->i2c_bus[1].algo_data = &dev->i2c_bit[1];

View File

@ -354,7 +354,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
snd_pcm_chip(pcm) = solo_dev; snd_pcm_chip(pcm) = solo_dev;
pcm->info_flags = 0; pcm->info_flags = 0;
strcpy(pcm->name, card->shortname); strscpy(pcm->name, card->shortname, sizeof(pcm->name));
for (i = 0, ss = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; for (i = 0, ss = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream;
ss; ss = ss->next, i++) ss; ss = ss->next, i++)
@ -394,8 +394,8 @@ int solo_g723_init(struct solo_dev *solo_dev)
card = solo_dev->snd_card; card = solo_dev->snd_card;
strcpy(card->driver, SOLO6X10_NAME); strscpy(card->driver, SOLO6X10_NAME, sizeof(card->driver));
strcpy(card->shortname, "SOLO-6x10 Audio"); strscpy(card->shortname, "SOLO-6x10 Audio", sizeof(card->shortname));
sprintf(card->longname, "%s on %s IRQ %d", card->shortname, sprintf(card->longname, "%s on %s IRQ %d", card->shortname,
pci_name(solo_dev->pdev), solo_dev->pdev->irq); pci_name(solo_dev->pdev), solo_dev->pdev->irq);
@ -404,7 +404,7 @@ int solo_g723_init(struct solo_dev *solo_dev)
goto snd_error; goto snd_error;
/* Mixer controls */ /* Mixer controls */
strcpy(card->mixername, "SOLO-6x10"); strscpy(card->mixername, "SOLO-6x10", sizeof(card->mixername));
kctl = snd_solo_capture_volume; kctl = snd_solo_capture_volume;
kctl.count = solo_dev->nr_chans; kctl.count = solo_dev->nr_chans;

View File

@ -775,7 +775,7 @@ static int solo_enc_querycap(struct file *file, void *priv,
struct solo_enc_dev *solo_enc = video_drvdata(file); struct solo_enc_dev *solo_enc = video_drvdata(file);
struct solo_dev *solo_dev = solo_enc->solo_dev; struct solo_dev *solo_dev = solo_enc->solo_dev;
strcpy(cap->driver, SOLO6X10_NAME); strscpy(cap->driver, SOLO6X10_NAME, sizeof(cap->driver));
snprintf(cap->card, sizeof(cap->card), "Softlogic 6x10 Enc %d", snprintf(cap->card, sizeof(cap->card), "Softlogic 6x10 Enc %d",
solo_enc->ch); solo_enc->ch);
snprintf(cap->bus_info, sizeof(cap->bus_info), "PCI:%s", snprintf(cap->bus_info, sizeof(cap->bus_info), "PCI:%s",
@ -834,17 +834,18 @@ static int solo_enc_enum_fmt_cap(struct file *file, void *priv,
switch (dev_type) { switch (dev_type) {
case SOLO_DEV_6010: case SOLO_DEV_6010:
f->pixelformat = V4L2_PIX_FMT_MPEG4; f->pixelformat = V4L2_PIX_FMT_MPEG4;
strcpy(f->description, "MPEG-4 part 2"); strscpy(f->description, "MPEG-4 part 2",
sizeof(f->description));
break; break;
case SOLO_DEV_6110: case SOLO_DEV_6110:
f->pixelformat = V4L2_PIX_FMT_H264; f->pixelformat = V4L2_PIX_FMT_H264;
strcpy(f->description, "H.264"); strscpy(f->description, "H.264", sizeof(f->description));
break; break;
} }
break; break;
case 1: case 1:
f->pixelformat = V4L2_PIX_FMT_MJPEG; f->pixelformat = V4L2_PIX_FMT_MJPEG;
strcpy(f->description, "MJPEG"); strscpy(f->description, "MJPEG", sizeof(f->description));
break; break;
default: default:
return -EINVAL; return -EINVAL;
@ -1126,7 +1127,8 @@ static int solo_s_ctrl(struct v4l2_ctrl *ctrl)
solo_enc->md_thresholds->p_new.p_u16); solo_enc->md_thresholds->p_new.p_u16);
break; break;
case V4L2_CID_OSD_TEXT: case V4L2_CID_OSD_TEXT:
strcpy(solo_enc->osd_text, ctrl->p_new.p_char); strscpy(solo_enc->osd_text, ctrl->p_new.p_char,
sizeof(solo_enc->osd_text));
return solo_osd_print(solo_enc); return solo_osd_print(solo_enc);
default: default:
return -EINVAL; return -EINVAL;

View File

@ -383,8 +383,8 @@ static int solo_querycap(struct file *file, void *priv,
{ {
struct solo_dev *solo_dev = video_drvdata(file); struct solo_dev *solo_dev = video_drvdata(file);
strcpy(cap->driver, SOLO6X10_NAME); strscpy(cap->driver, SOLO6X10_NAME, sizeof(cap->driver));
strcpy(cap->card, "Softlogic 6x10"); strscpy(cap->card, "Softlogic 6x10", sizeof(cap->card));
snprintf(cap->bus_info, sizeof(cap->bus_info), "PCI:%s", snprintf(cap->bus_info, sizeof(cap->bus_info), "PCI:%s",
pci_name(solo_dev->pdev)); pci_name(solo_dev->pdev));
cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |

View File

@ -419,8 +419,8 @@ static int vidioc_querycap(struct file *file, void *priv,
{ {
struct sta2x11_vip *vip = video_drvdata(file); struct sta2x11_vip *vip = video_drvdata(file);
strcpy(cap->driver, KBUILD_MODNAME); strscpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
strcpy(cap->card, KBUILD_MODNAME); strscpy(cap->card, KBUILD_MODNAME, sizeof(cap->card));
snprintf(cap->bus_info, sizeof(cap->bus_info), "PCI:%s", snprintf(cap->bus_info, sizeof(cap->bus_info), "PCI:%s",
pci_name(vip->pdev)); pci_name(vip->pdev));
cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
@ -580,7 +580,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
if (f->index != 0) if (f->index != 0)
return -EINVAL; return -EINVAL;
strcpy(f->description, "4:2:2, packed, UYVY"); strscpy(f->description, "4:2:2, packed, UYVY", sizeof(f->description));
f->pixelformat = V4L2_PIX_FMT_UYVY; f->pixelformat = V4L2_PIX_FMT_UYVY;
f->flags = 0; f->flags = 0;
return 0; return 0;

View File

@ -332,7 +332,7 @@ static int vidioc_g_tuner(struct file *file, void *fh, struct v4l2_tuner *t)
return -EINVAL; return -EINVAL;
memset(t, 0, sizeof(*t)); memset(t, 0, sizeof(*t));
strcpy((char *)t->name, "Television"); strscpy((char *)t->name, "Television", sizeof(t->name));
t->type = V4L2_TUNER_ANALOG_TV; t->type = V4L2_TUNER_ANALOG_TV;
t->capability = V4L2_TUNER_CAP_NORM | V4L2_TUNER_CAP_STEREO | t->capability = V4L2_TUNER_CAP_NORM | V4L2_TUNER_CAP_STEREO |

View File

@ -508,7 +508,8 @@ int ttpci_budget_init(struct budget *budget, struct saa7146_dev *dev,
sizeof(budget->i2c_adap.name)); sizeof(budget->i2c_adap.name));
saa7146_i2c_adapter_prepare(dev, &budget->i2c_adap, SAA7146_I2C_BUS_BIT_RATE_120); saa7146_i2c_adapter_prepare(dev, &budget->i2c_adap, SAA7146_I2C_BUS_BIT_RATE_120);
strcpy(budget->i2c_adap.name, budget->card->name); strscpy(budget->i2c_adap.name, budget->card->name,
sizeof(budget->i2c_adap.name));
if (i2c_add_adapter(&budget->i2c_adap) < 0) { if (i2c_add_adapter(&budget->i2c_adap) < 0) {
ret = -ENOMEM; ret = -ENOMEM;

View File

@ -610,7 +610,7 @@ static int tw5864_querycap(struct file *file, void *priv,
{ {
struct tw5864_input *input = video_drvdata(file); struct tw5864_input *input = video_drvdata(file);
strcpy(cap->driver, "tw5864"); strscpy(cap->driver, "tw5864", sizeof(cap->driver));
snprintf(cap->card, sizeof(cap->card), "TW5864 Encoder %d", snprintf(cap->card, sizeof(cap->card), "TW5864 Encoder %d",
input->nr); input->nr);
sprintf(cap->bus_info, "PCI:%s", pci_name(input->root->pci)); sprintf(cap->bus_info, "PCI:%s", pci_name(input->root->pci));

View File

@ -734,7 +734,7 @@ static int tw68_querycap(struct file *file, void *priv,
{ {
struct tw68_dev *dev = video_drvdata(file); struct tw68_dev *dev = video_drvdata(file);
strcpy(cap->driver, "tw68"); strscpy(cap->driver, "tw68", sizeof(cap->driver));
strscpy(cap->card, "Techwell Capture Card", strscpy(cap->card, "Techwell Capture Card",
sizeof(cap->card)); sizeof(cap->card));
sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci));

View File

@ -2455,7 +2455,8 @@ vpfe_get_pdata(struct platform_device *pdev)
/* we only support camera */ /* we only support camera */
sdinfo->inputs[0].index = i; sdinfo->inputs[0].index = i;
strcpy(sdinfo->inputs[0].name, "Camera"); strscpy(sdinfo->inputs[0].name, "Camera",
sizeof(sdinfo->inputs[0].name));
sdinfo->inputs[0].type = V4L2_INPUT_TYPE_CAMERA; sdinfo->inputs[0].type = V4L2_INPUT_TYPE_CAMERA;
sdinfo->inputs[0].std = V4L2_STD_ALL; sdinfo->inputs[0].std = V4L2_STD_ALL;
sdinfo->inputs[0].capabilities = V4L2_IN_CAP_STD; sdinfo->inputs[0].capabilities = V4L2_IN_CAP_STD;

View File

@ -1238,8 +1238,8 @@ static int isc_querycap(struct file *file, void *priv,
{ {
struct isc_device *isc = video_drvdata(file); struct isc_device *isc = video_drvdata(file);
strcpy(cap->driver, ATMEL_ISC_NAME); strscpy(cap->driver, ATMEL_ISC_NAME, sizeof(cap->driver));
strcpy(cap->card, "Atmel Image Sensor Controller"); strscpy(cap->card, "Atmel Image Sensor Controller", sizeof(cap->card));
snprintf(cap->bus_info, sizeof(cap->bus_info), snprintf(cap->bus_info, sizeof(cap->bus_info),
"platform:%s", isc->v4l2_dev.name); "platform:%s", isc->v4l2_dev.name);
@ -1393,7 +1393,7 @@ static int isc_enum_input(struct file *file, void *priv,
inp->type = V4L2_INPUT_TYPE_CAMERA; inp->type = V4L2_INPUT_TYPE_CAMERA;
inp->std = 0; inp->std = 0;
strcpy(inp->name, "Camera"); strscpy(inp->name, "Camera", sizeof(inp->name));
return 0; return 0;
} }

View File

@ -816,10 +816,12 @@ static int vpbe_display_enum_fmt(struct file *file, void *priv,
fmt->index = index; fmt->index = index;
fmt->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; fmt->type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
if (index == 0) { if (index == 0) {
strcpy(fmt->description, "YUV 4:2:2 - UYVY"); strscpy(fmt->description, "YUV 4:2:2 - UYVY",
sizeof(fmt->description));
fmt->pixelformat = V4L2_PIX_FMT_UYVY; fmt->pixelformat = V4L2_PIX_FMT_UYVY;
} else { } else {
strcpy(fmt->description, "Y/CbCr 4:2:0"); strscpy(fmt->description, "Y/CbCr 4:2:0",
sizeof(fmt->description));
fmt->pixelformat = V4L2_PIX_FMT_NV12; fmt->pixelformat = V4L2_PIX_FMT_NV12;
} }

View File

@ -616,7 +616,7 @@ struct v4l2_subdev *venc_sub_dev_init(struct v4l2_device *v4l2_dev,
v4l2_subdev_init(&venc->sd, &venc_ops); v4l2_subdev_init(&venc->sd, &venc_ops);
strcpy(venc->sd.name, venc_name); strscpy(venc->sd.name, venc_name, sizeof(venc->sd.name));
if (v4l2_device_register_subdev(v4l2_dev, &venc->sd) < 0) { if (v4l2_device_register_subdev(v4l2_dev, &venc->sd) < 0) {
v4l2_err(v4l2_dev, v4l2_err(v4l2_dev,
"vpbe unable to register venc sub device\n"); "vpbe unable to register venc sub device\n");

View File

@ -949,11 +949,13 @@ static int vpif_enum_fmt_vid_cap(struct file *file, void *priv,
/* Fill in the information about format */ /* Fill in the information about format */
if (ch->vpifparams.iface.if_type == VPIF_IF_RAW_BAYER) { if (ch->vpifparams.iface.if_type == VPIF_IF_RAW_BAYER) {
fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
strcpy(fmt->description, "Raw Mode -Bayer Pattern GrRBGb"); strscpy(fmt->description, "Raw Mode -Bayer Pattern GrRBGb",
sizeof(fmt->description));
fmt->pixelformat = V4L2_PIX_FMT_SBGGR8; fmt->pixelformat = V4L2_PIX_FMT_SBGGR8;
} else { } else {
fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
strcpy(fmt->description, "YCbCr4:2:2 Semi-Planar"); strscpy(fmt->description, "YCbCr4:2:2 Semi-Planar",
sizeof(fmt->description));
fmt->pixelformat = V4L2_PIX_FMT_NV16; fmt->pixelformat = V4L2_PIX_FMT_NV16;
} }
return 0; return 0;

View File

@ -602,7 +602,8 @@ static int vpif_enum_fmt_vid_out(struct file *file, void *priv,
/* Fill in the information about format */ /* Fill in the information about format */
fmt->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; fmt->type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
strcpy(fmt->description, "YCbCr4:2:2 YC Planar"); strscpy(fmt->description, "YCbCr4:2:2 YC Planar",
sizeof(fmt->description));
fmt->pixelformat = V4L2_PIX_FMT_YUV422P; fmt->pixelformat = V4L2_PIX_FMT_YUV422P;
fmt->flags = 0; fmt->flags = 0;
return 0; return 0;

View File

@ -565,9 +565,9 @@ static const struct videobuf_queue_ops viu_video_qops = {
static int vidioc_querycap(struct file *file, void *priv, static int vidioc_querycap(struct file *file, void *priv,
struct v4l2_capability *cap) struct v4l2_capability *cap)
{ {
strcpy(cap->driver, "viu"); strscpy(cap->driver, "viu", sizeof(cap->driver));
strcpy(cap->card, "viu"); strscpy(cap->card, "viu", sizeof(cap->card));
strcpy(cap->bus_info, "platform:viu"); strscpy(cap->bus_info, "platform:viu", sizeof(cap->bus_info));
cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |
V4L2_CAP_STREAMING | V4L2_CAP_STREAMING |
V4L2_CAP_VIDEO_OVERLAY | V4L2_CAP_VIDEO_OVERLAY |
@ -941,7 +941,7 @@ static int vidioc_enum_input(struct file *file, void *priv,
inp->type = V4L2_INPUT_TYPE_CAMERA; inp->type = V4L2_INPUT_TYPE_CAMERA;
inp->std = fh->dev->vdev->tvnorms; inp->std = fh->dev->vdev->tvnorms;
strcpy(inp->name, "Camera"); strscpy(inp->name, "Camera", sizeof(inp->name));
return 0; return 0;
} }

View File

@ -341,7 +341,7 @@ static int cafe_smbus_setup(struct cafe_camera *cam)
return -ENOMEM; return -ENOMEM;
adap->owner = THIS_MODULE; adap->owner = THIS_MODULE;
adap->algo = &cafe_smbus_algo; adap->algo = &cafe_smbus_algo;
strcpy(adap->name, "cafe_ccic"); strscpy(adap->name, "cafe_ccic", sizeof(adap->name));
adap->dev.parent = &cam->pdev->dev; adap->dev.parent = &cam->pdev->dev;
i2c_set_adapdata(adap, cam); i2c_set_adapdata(adap, cam);
ret = i2c_add_adapter(adap); ret = i2c_add_adapter(adap);

View File

@ -1303,8 +1303,8 @@ static int mcam_vidioc_querycap(struct file *file, void *priv,
{ {
struct mcam_camera *cam = video_drvdata(file); struct mcam_camera *cam = video_drvdata(file);
strcpy(cap->driver, "marvell_ccic"); strscpy(cap->driver, "marvell_ccic", sizeof(cap->driver));
strcpy(cap->card, "marvell_ccic"); strscpy(cap->card, "marvell_ccic", sizeof(cap->card));
strscpy(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 | cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |
V4L2_CAP_READWRITE | V4L2_CAP_STREAMING; V4L2_CAP_READWRITE | V4L2_CAP_STREAMING;
@ -1421,7 +1421,7 @@ static int mcam_vidioc_enum_input(struct file *filp, void *priv,
return -EINVAL; return -EINVAL;
input->type = V4L2_INPUT_TYPE_CAMERA; input->type = V4L2_INPUT_TYPE_CAMERA;
strcpy(input->name, "Camera"); strscpy(input->name, "Camera", sizeof(input->name));
return 0; return 0;
} }

View File

@ -312,7 +312,7 @@ static int soc_camera_enum_input(struct file *file, void *priv,
/* default is camera */ /* default is camera */
inp->type = V4L2_INPUT_TYPE_CAMERA; inp->type = V4L2_INPUT_TYPE_CAMERA;
inp->std = icd->vdev->tvnorms; inp->std = icd->vdev->tvnorms;
strcpy(inp->name, "Camera"); strscpy(inp->name, "Camera", sizeof(inp->name));
return 0; return 0;
} }

View File

@ -812,7 +812,7 @@ static int viacam_enum_input(struct file *filp, void *priv,
input->type = V4L2_INPUT_TYPE_CAMERA; input->type = V4L2_INPUT_TYPE_CAMERA;
input->std = V4L2_STD_ALL; /* Not sure what should go here */ input->std = V4L2_STD_ALL; /* Not sure what should go here */
strcpy(input->name, "Camera"); strscpy(input->name, "Camera", sizeof(input->name));
return 0; return 0;
} }
@ -990,8 +990,8 @@ out:
static int viacam_querycap(struct file *filp, void *priv, static int viacam_querycap(struct file *filp, void *priv,
struct v4l2_capability *cap) struct v4l2_capability *cap)
{ {
strcpy(cap->driver, "via-camera"); strscpy(cap->driver, "via-camera", sizeof(cap->driver));
strcpy(cap->card, "via-camera"); strscpy(cap->card, "via-camera", sizeof(cap->card));
cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |
V4L2_CAP_READWRITE | V4L2_CAP_STREAMING; V4L2_CAP_READWRITE | V4L2_CAP_STREAMING;
cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;

View File

@ -241,11 +241,11 @@ static int vivid_received(struct cec_adapter *adap, struct cec_msg *msg)
cec_ops_set_osd_string(msg, &disp_ctl, osd); cec_ops_set_osd_string(msg, &disp_ctl, osd);
switch (disp_ctl) { switch (disp_ctl) {
case CEC_OP_DISP_CTL_DEFAULT: case CEC_OP_DISP_CTL_DEFAULT:
strcpy(dev->osd, osd); strscpy(dev->osd, osd, sizeof(dev->osd));
dev->osd_jiffies = jiffies; dev->osd_jiffies = jiffies;
break; break;
case CEC_OP_DISP_CTL_UNTIL_CLEARED: case CEC_OP_DISP_CTL_UNTIL_CLEARED:
strcpy(dev->osd, osd); strscpy(dev->osd, osd, sizeof(dev->osd));
dev->osd_jiffies = 0; dev->osd_jiffies = 0;
break; break;
case CEC_OP_DISP_CTL_CLEAR: case CEC_OP_DISP_CTL_CLEAR:

View File

@ -197,8 +197,8 @@ static int vidioc_querycap(struct file *file, void *priv,
{ {
struct vivid_dev *dev = video_drvdata(file); struct vivid_dev *dev = video_drvdata(file);
strcpy(cap->driver, "vivid"); strscpy(cap->driver, "vivid", sizeof(cap->driver));
strcpy(cap->card, "vivid"); strscpy(cap->card, "vivid", sizeof(cap->card));
snprintf(cap->bus_info, sizeof(cap->bus_info), snprintf(cap->bus_info, sizeof(cap->bus_info),
"platform:%s", dev->v4l2_dev.name); "platform:%s", dev->v4l2_dev.name);

View File

@ -191,7 +191,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
return -EINVAL; return -EINVAL;
dsbr100_getstat(radio); dsbr100_getstat(radio);
strcpy(v->name, "FM"); strscpy(v->name, "FM", sizeof(v->name));
v->type = V4L2_TUNER_RADIO; v->type = V4L2_TUNER_RADIO;
v->rangelow = FREQ_MIN * FREQ_MUL; v->rangelow = FREQ_MIN * FREQ_MUL;
v->rangehigh = FREQ_MAX * FREQ_MUL; v->rangehigh = FREQ_MAX * FREQ_MUL;

View File

@ -222,7 +222,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
* retval = ma901radio_get_stat(radio, &is_stereo, &v->signal); * retval = ma901radio_get_stat(radio, &is_stereo, &v->signal);
*/ */
strcpy(v->name, "FM"); strscpy(v->name, "FM", sizeof(v->name));
v->type = V4L2_TUNER_RADIO; v->type = V4L2_TUNER_RADIO;
v->rangelow = FREQ_MIN * FREQ_MUL; v->rangelow = FREQ_MIN * FREQ_MUL;
v->rangehigh = FREQ_MAX * FREQ_MUL; v->rangehigh = FREQ_MAX * FREQ_MUL;

View File

@ -291,7 +291,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
if (retval) if (retval)
return retval; return retval;
strcpy(v->name, "FM"); strscpy(v->name, "FM", sizeof(v->name));
v->type = V4L2_TUNER_RADIO; v->type = V4L2_TUNER_RADIO;
v->rangelow = FREQ_MIN * FREQ_MUL; v->rangelow = FREQ_MIN * FREQ_MUL;
v->rangehigh = FREQ_MAX * FREQ_MUL; v->rangehigh = FREQ_MAX * FREQ_MUL;

View File

@ -622,7 +622,7 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv,
} }
/* driver constants */ /* driver constants */
strcpy(tuner->name, "FM"); strscpy(tuner->name, "FM", sizeof(tuner->name));
tuner->type = V4L2_TUNER_RADIO; tuner->type = V4L2_TUNER_RADIO;
tuner->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO | tuner->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO |
V4L2_TUNER_CAP_RDS | V4L2_TUNER_CAP_RDS_BLOCK_IO | V4L2_TUNER_CAP_RDS | V4L2_TUNER_CAP_RDS_BLOCK_IO |

View File

@ -249,7 +249,7 @@ static int fm_v4l2_vidioc_g_audio(struct file *file, void *priv,
struct v4l2_audio *audio) struct v4l2_audio *audio)
{ {
memset(audio, 0, sizeof(*audio)); memset(audio, 0, sizeof(*audio));
strcpy(audio->name, "Radio"); strscpy(audio->name, "Radio", sizeof(audio->name));
audio->capability = V4L2_AUDCAP_STEREO; audio->capability = V4L2_AUDCAP_STEREO;
return 0; return 0;
@ -293,7 +293,7 @@ static int fm_v4l2_vidioc_g_tuner(struct file *file, void *priv,
if (ret != 0) if (ret != 0)
return ret; return ret;
strcpy(tuner->name, "FM"); strscpy(tuner->name, "FM", sizeof(tuner->name));
tuner->type = V4L2_TUNER_RADIO; tuner->type = V4L2_TUNER_RADIO;
/* Store rangelow and rangehigh freq in unit of 62.5 Hz */ /* Store rangelow and rangehigh freq in unit of 62.5 Hz */
tuner->rangelow = bottom_freq * 16; tuner->rangelow = bottom_freq * 16;

View File

@ -1218,7 +1218,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
dprintk(1, "%s called\n", __func__); dprintk(1, "%s called\n", __func__);
f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
strcpy(f->description, "Packed YUV2"); strscpy(f->description, "Packed YUV2", sizeof(f->description));
f->flags = 0; f->flags = 0;
f->pixelformat = V4L2_PIX_FMT_UYVY; f->pixelformat = V4L2_PIX_FMT_UYVY;
@ -1349,7 +1349,7 @@ static int vidioc_enum_input(struct file *file, void *priv,
return -EINVAL; return -EINVAL;
input->index = tmp; input->index = tmp;
strcpy(input->name, inames[AUVI_INPUT(tmp).type]); strscpy(input->name, inames[AUVI_INPUT(tmp).type], sizeof(input->name));
if ((AUVI_INPUT(tmp).type == AU0828_VMUX_TELEVISION) || if ((AUVI_INPUT(tmp).type == AU0828_VMUX_TELEVISION) ||
(AUVI_INPUT(tmp).type == AU0828_VMUX_CABLE)) { (AUVI_INPUT(tmp).type == AU0828_VMUX_CABLE)) {
input->type |= V4L2_INPUT_TYPE_TUNER; input->type |= V4L2_INPUT_TYPE_TUNER;
@ -1465,9 +1465,9 @@ static int vidioc_enumaudio(struct file *file, void *priv, struct v4l2_audio *a)
dprintk(1, "%s called\n", __func__); dprintk(1, "%s called\n", __func__);
if (a->index == 0) if (a->index == 0)
strcpy(a->name, "Television"); strscpy(a->name, "Television", sizeof(a->name));
else else
strcpy(a->name, "Line in"); strscpy(a->name, "Line in", sizeof(a->name));
a->capability = V4L2_AUDCAP_STEREO; a->capability = V4L2_AUDCAP_STEREO;
return 0; return 0;
@ -1482,9 +1482,9 @@ static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)
a->index = dev->ctrl_ainput; a->index = dev->ctrl_ainput;
if (a->index == 0) if (a->index == 0)
strcpy(a->name, "Television"); strscpy(a->name, "Television", sizeof(a->name));
else else
strcpy(a->name, "Line in"); strscpy(a->name, "Line in", sizeof(a->name));
a->capability = V4L2_AUDCAP_STEREO; a->capability = V4L2_AUDCAP_STEREO;
return 0; return 0;
@ -1518,7 +1518,7 @@ static int vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
dprintk(1, "%s called std_set %d dev_state %ld\n", __func__, dprintk(1, "%s called std_set %d dev_state %ld\n", __func__,
dev->std_set_in_tuner_core, dev->dev_state); dev->std_set_in_tuner_core, dev->dev_state);
strcpy(t->name, "Auvitek tuner"); strscpy(t->name, "Auvitek tuner", sizeof(t->name));
au0828_init_tuner(dev); au0828_init_tuner(dev);
i2c_gate_ctrl(dev, 1); i2c_gate_ctrl(dev, 1);
@ -1978,7 +1978,7 @@ int au0828_analog_register(struct au0828_dev *dev,
dev->vdev.lock = &dev->lock; dev->vdev.lock = &dev->lock;
dev->vdev.queue = &dev->vb_vidq; dev->vdev.queue = &dev->vb_vidq;
dev->vdev.queue->lock = &dev->vb_queue_lock; dev->vdev.queue->lock = &dev->vb_queue_lock;
strcpy(dev->vdev.name, "au0828a video"); strscpy(dev->vdev.name, "au0828a video", sizeof(dev->vdev.name));
/* Setup the VBI device */ /* Setup the VBI device */
dev->vbi_dev = au0828_video_template; dev->vbi_dev = au0828_video_template;
@ -1986,7 +1986,7 @@ int au0828_analog_register(struct au0828_dev *dev,
dev->vbi_dev.lock = &dev->lock; dev->vbi_dev.lock = &dev->lock;
dev->vbi_dev.queue = &dev->vb_vbiq; dev->vbi_dev.queue = &dev->vb_vbiq;
dev->vbi_dev.queue->lock = &dev->vb_vbi_queue_lock; dev->vbi_dev.queue->lock = &dev->vb_vbi_queue_lock;
strcpy(dev->vbi_dev.name, "au0828a vbi"); strscpy(dev->vbi_dev.name, "au0828a vbi", sizeof(dev->vbi_dev.name));
/* Init entities at the Media Controller */ /* Init entities at the Media Controller */
au0828_analog_create_entities(dev); au0828_analog_create_entities(dev);

View File

@ -219,12 +219,12 @@ static int cpia2_querycap(struct file *file, void *fh, struct v4l2_capability *v
{ {
struct camera_data *cam = video_drvdata(file); struct camera_data *cam = video_drvdata(file);
strcpy(vc->driver, "cpia2"); strscpy(vc->driver, "cpia2", sizeof(vc->driver));
if (cam->params.pnp_id.product == 0x151) if (cam->params.pnp_id.product == 0x151)
strcpy(vc->card, "QX5 Microscope"); strscpy(vc->card, "QX5 Microscope", sizeof(vc->card));
else else
strcpy(vc->card, "CPiA2 Camera"); strscpy(vc->card, "CPiA2 Camera", sizeof(vc->card));
switch (cam->params.pnp_id.device_type) { switch (cam->params.pnp_id.device_type) {
case DEVICE_STV_672: case DEVICE_STV_672:
strcat(vc->card, " (672/"); strcat(vc->card, " (672/");
@ -281,7 +281,7 @@ static int cpia2_enum_input(struct file *file, void *fh, struct v4l2_input *i)
{ {
if (i->index) if (i->index)
return -EINVAL; return -EINVAL;
strcpy(i->name, "Camera"); strscpy(i->name, "Camera", sizeof(i->name));
i->type = V4L2_INPUT_TYPE_CAMERA; i->type = V4L2_INPUT_TYPE_CAMERA;
return 0; return 0;
} }
@ -319,11 +319,11 @@ static int cpia2_enum_fmt_vid_cap(struct file *file, void *fh,
f->flags = V4L2_FMT_FLAG_COMPRESSED; f->flags = V4L2_FMT_FLAG_COMPRESSED;
switch(index) { switch(index) {
case 0: case 0:
strcpy(f->description, "MJPEG"); strscpy(f->description, "MJPEG", sizeof(f->description));
f->pixelformat = V4L2_PIX_FMT_MJPEG; f->pixelformat = V4L2_PIX_FMT_MJPEG;
break; break;
case 1: case 1:
strcpy(f->description, "JPEG"); strscpy(f->description, "JPEG", sizeof(f->description));
f->pixelformat = V4L2_PIX_FMT_JPEG; f->pixelformat = V4L2_PIX_FMT_JPEG;
break; break;
default: default:

View File

@ -679,10 +679,10 @@ static int cx231xx_audio_init(struct cx231xx *dev)
&snd_cx231xx_pcm_capture); &snd_cx231xx_pcm_capture);
pcm->info_flags = 0; pcm->info_flags = 0;
pcm->private_data = dev; pcm->private_data = dev;
strcpy(pcm->name, "Conexant cx231xx Capture"); strscpy(pcm->name, "Conexant cx231xx Capture", sizeof(pcm->name));
strcpy(card->driver, "Cx231xx-Audio"); strscpy(card->driver, "Cx231xx-Audio", sizeof(card->driver));
strcpy(card->shortname, "Cx231xx Audio"); strscpy(card->shortname, "Cx231xx Audio", sizeof(card->shortname));
strcpy(card->longname, "Conexant cx231xx Audio"); strscpy(card->longname, "Conexant cx231xx Audio", sizeof(card->longname));
INIT_WORK(&dev->wq_trigger, audio_trigger); INIT_WORK(&dev->wq_trigger, audio_trigger);

View File

@ -1169,7 +1169,7 @@ int cx231xx_enum_input(struct file *file, void *priv,
i->index = n; i->index = n;
i->type = V4L2_INPUT_TYPE_CAMERA; i->type = V4L2_INPUT_TYPE_CAMERA;
strcpy(i->name, iname[INPUT(n)->type]); strscpy(i->name, iname[INPUT(n)->type], sizeof(i->name));
if ((CX231XX_VMUX_TELEVISION == INPUT(n)->type) || if ((CX231XX_VMUX_TELEVISION == INPUT(n)->type) ||
(CX231XX_VMUX_CABLE == INPUT(n)->type)) (CX231XX_VMUX_CABLE == INPUT(n)->type))
@ -1244,7 +1244,7 @@ int cx231xx_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
if (0 != t->index) if (0 != t->index)
return -EINVAL; return -EINVAL;
strcpy(t->name, "Tuner"); strscpy(t->name, "Tuner", sizeof(t->name));
t->type = V4L2_TUNER_ANALOG_TV; t->type = V4L2_TUNER_ANALOG_TV;
t->capability = V4L2_TUNER_CAP_NORM; t->capability = V4L2_TUNER_CAP_NORM;
@ -1716,7 +1716,7 @@ static int radio_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
if (t->index) if (t->index)
return -EINVAL; return -EINVAL;
strcpy(t->name, "Radio"); strscpy(t->name, "Radio", sizeof(t->name));
call_all(dev, tuner, g_tuner, t); call_all(dev, tuner, g_tuner, t);
@ -2242,7 +2242,8 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
/* Initialize VBI template */ /* Initialize VBI template */
cx231xx_vbi_template = cx231xx_video_template; cx231xx_vbi_template = cx231xx_video_template;
strcpy(cx231xx_vbi_template.name, "cx231xx-vbi"); strscpy(cx231xx_vbi_template.name, "cx231xx-vbi",
sizeof(cx231xx_vbi_template.name));
/* Allocate and fill vbi video_device struct */ /* Allocate and fill vbi video_device struct */
cx231xx_vdev_init(dev, &dev->vbi_dev, &cx231xx_vbi_template, "vbi"); cx231xx_vdev_init(dev, &dev->vbi_dev, &cx231xx_vbi_template, "vbi");

View File

@ -938,11 +938,11 @@ static int em28xx_audio_init(struct em28xx *dev)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_em28xx_pcm_capture); snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_em28xx_pcm_capture);
pcm->info_flags = 0; pcm->info_flags = 0;
pcm->private_data = dev; pcm->private_data = dev;
strcpy(pcm->name, "Empia 28xx Capture"); strscpy(pcm->name, "Empia 28xx Capture", sizeof(pcm->name));
strcpy(card->driver, "Em28xx-Audio"); strscpy(card->driver, "Em28xx-Audio", sizeof(card->driver));
strcpy(card->shortname, "Em28xx Audio"); strscpy(card->shortname, "Em28xx Audio", sizeof(card->shortname));
strcpy(card->longname, "Empia Em28xx Audio"); strscpy(card->longname, "Empia Em28xx Audio", sizeof(card->longname));
INIT_WORK(&adev->wq_trigger, audio_trigger); INIT_WORK(&adev->wq_trigger, audio_trigger);

View File

@ -985,7 +985,8 @@ int em28xx_i2c_register(struct em28xx *dev, unsigned int bus,
dev->i2c_adap[bus] = em28xx_adap_template; dev->i2c_adap[bus] = em28xx_adap_template;
dev->i2c_adap[bus].dev.parent = &dev->intf->dev; dev->i2c_adap[bus].dev.parent = &dev->intf->dev;
strcpy(dev->i2c_adap[bus].name, dev_name(&dev->intf->dev)); strscpy(dev->i2c_adap[bus].name, dev_name(&dev->intf->dev),
sizeof(dev->i2c_adap[bus].name));
dev->i2c_bus[bus].bus = bus; dev->i2c_bus[bus].bus = bus;
dev->i2c_bus[bus].algo_type = algo_type; dev->i2c_bus[bus].algo_type = algo_type;

View File

@ -1675,7 +1675,7 @@ static int vidioc_enum_input(struct file *file, void *priv,
i->type = V4L2_INPUT_TYPE_CAMERA; i->type = V4L2_INPUT_TYPE_CAMERA;
strcpy(i->name, iname[INPUT(n)->type]); strscpy(i->name, iname[INPUT(n)->type], sizeof(i->name));
if (INPUT(n)->type == EM28XX_VMUX_TELEVISION) if (INPUT(n)->type == EM28XX_VMUX_TELEVISION)
i->type = V4L2_INPUT_TYPE_TUNER; i->type = V4L2_INPUT_TYPE_TUNER;
@ -1716,28 +1716,28 @@ static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)
switch (a->index) { switch (a->index) {
case EM28XX_AMUX_VIDEO: case EM28XX_AMUX_VIDEO:
strcpy(a->name, "Television"); strscpy(a->name, "Television", sizeof(a->name));
break; break;
case EM28XX_AMUX_LINE_IN: case EM28XX_AMUX_LINE_IN:
strcpy(a->name, "Line In"); strscpy(a->name, "Line In", sizeof(a->name));
break; break;
case EM28XX_AMUX_VIDEO2: case EM28XX_AMUX_VIDEO2:
strcpy(a->name, "Television alt"); strscpy(a->name, "Television alt", sizeof(a->name));
break; break;
case EM28XX_AMUX_PHONE: case EM28XX_AMUX_PHONE:
strcpy(a->name, "Phone"); strscpy(a->name, "Phone", sizeof(a->name));
break; break;
case EM28XX_AMUX_MIC: case EM28XX_AMUX_MIC:
strcpy(a->name, "Mic"); strscpy(a->name, "Mic", sizeof(a->name));
break; break;
case EM28XX_AMUX_CD: case EM28XX_AMUX_CD:
strcpy(a->name, "CD"); strscpy(a->name, "CD", sizeof(a->name));
break; break;
case EM28XX_AMUX_AUX: case EM28XX_AMUX_AUX:
strcpy(a->name, "Aux"); strscpy(a->name, "Aux", sizeof(a->name));
break; break;
case EM28XX_AMUX_PCM_OUT: case EM28XX_AMUX_PCM_OUT:
strcpy(a->name, "PCM"); strscpy(a->name, "PCM", sizeof(a->name));
break; break;
default: default:
return -EINVAL; return -EINVAL;
@ -1776,7 +1776,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
if (t->index != 0) if (t->index != 0)
return -EINVAL; return -EINVAL;
strcpy(t->name, "Tuner"); strscpy(t->name, "Tuner", sizeof(t->name));
v4l2_device_call_all(&dev->v4l2->v4l2_dev, 0, tuner, g_tuner, t); v4l2_device_call_all(&dev->v4l2->v4l2_dev, 0, tuner, g_tuner, t);
return 0; return 0;
@ -2045,7 +2045,7 @@ static int radio_g_tuner(struct file *file, void *priv,
if (unlikely(t->index > 0)) if (unlikely(t->index > 0))
return -EINVAL; return -EINVAL;
strcpy(t->name, "Radio"); strscpy(t->name, "Radio", sizeof(t->name));
v4l2_device_call_all(&dev->v4l2->v4l2_dev, 0, tuner, g_tuner, t); v4l2_device_call_all(&dev->v4l2->v4l2_dev, 0, tuner, g_tuner, t);

View File

@ -578,8 +578,8 @@ static int vidioc_querycap(struct file *file, void *priv,
{ {
struct hdpvr_device *dev = video_drvdata(file); struct hdpvr_device *dev = video_drvdata(file);
strcpy(cap->driver, "hdpvr"); strscpy(cap->driver, "hdpvr", sizeof(cap->driver));
strcpy(cap->card, "Hauppauge HD PVR"); strscpy(cap->card, "Hauppauge HD PVR", sizeof(cap->card));
usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info)); usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info));
cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_AUDIO | cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_AUDIO |
V4L2_CAP_READWRITE; V4L2_CAP_READWRITE;
@ -1238,7 +1238,8 @@ int hdpvr_register_videodev(struct hdpvr_device *dev, struct device *parent,
/* setup and register video device */ /* setup and register video device */
dev->video_dev = hdpvr_video_template; dev->video_dev = hdpvr_video_template;
strcpy(dev->video_dev.name, "Hauppauge HD PVR"); strscpy(dev->video_dev.name, "Hauppauge HD PVR",
sizeof(dev->video_dev.name));
dev->video_dev.v4l2_dev = &dev->v4l2_dev; dev->video_dev.v4l2_dev = &dev->v4l2_dev;
video_set_drvdata(&dev->video_dev, dev); video_set_drvdata(&dev->video_dev, dev);

View File

@ -571,7 +571,8 @@ static int pulse8_cec_adap_log_addr(struct cec_adapter *adap, u8 log_addr)
memset(osd_str + osd_len, ' ', 4 - osd_len); memset(osd_str + osd_len, ' ', 4 - osd_len);
osd_len = 4; osd_len = 4;
osd_str[osd_len] = '\0'; osd_str[osd_len] = '\0';
strcpy(adap->log_addrs.osd_name, osd_str); strscpy(adap->log_addrs.osd_name, osd_str,
sizeof(adap->log_addrs.osd_name));
} }
err = pulse8_send_and_wait(pulse8, cmd, 1 + osd_len, err = pulse8_send_and_wait(pulse8, cmd, 1 + osd_len,
MSGCODE_COMMAND_ACCEPTED, 0); MSGCODE_COMMAND_ACCEPTED, 0);

View File

@ -1027,7 +1027,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
/* Init video_device structure */ /* Init video_device structure */
pdev->vdev = pwc_template; pdev->vdev = pwc_template;
strcpy(pdev->vdev.name, name); strscpy(pdev->vdev.name, name, sizeof(pdev->vdev.name));
pdev->vdev.queue = &pdev->vb_queue; pdev->vdev.queue = &pdev->vb_queue;
pdev->vdev.queue->lock = &pdev->vb_queue_lock; pdev->vdev.queue->lock = &pdev->vb_queue_lock;
video_set_drvdata(&pdev->vdev, pdev); video_set_drvdata(&pdev->vdev, pdev);

View File

@ -492,7 +492,7 @@ static int pwc_querycap(struct file *file, void *fh, struct v4l2_capability *cap
{ {
struct pwc_device *pdev = video_drvdata(file); struct pwc_device *pdev = video_drvdata(file);
strcpy(cap->driver, PWC_NAME); strscpy(cap->driver, PWC_NAME, sizeof(cap->driver));
strscpy(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)); usb_make_path(pdev->udev, cap->bus_info, sizeof(cap->bus_info));
cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING | cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |

View File

@ -141,7 +141,8 @@ static void rain_irq_work_handler(struct work_struct *work)
!memcmp(rain->cmd, "STA", 3)) { !memcmp(rain->cmd, "STA", 3)) {
rain_process_msg(rain); rain_process_msg(rain);
} else { } else {
strcpy(rain->cmd_reply, rain->cmd); strscpy(rain->cmd_reply, rain->cmd,
sizeof(rain->cmd_reply));
complete(&rain->cmd_done); complete(&rain->cmd_done);
} }
rain->cmd_idx = 0; rain->cmd_idx = 0;

View File

@ -260,7 +260,7 @@ int stk1160_i2c_register(struct stk1160 *dev)
dev->i2c_adap = adap_template; dev->i2c_adap = adap_template;
dev->i2c_adap.dev.parent = dev->dev; dev->i2c_adap.dev.parent = dev->dev;
strcpy(dev->i2c_adap.name, "stk1160"); strscpy(dev->i2c_adap.name, "stk1160", sizeof(dev->i2c_adap.name));
dev->i2c_adap.algo_data = dev; dev->i2c_adap.algo_data = dev;
i2c_set_adapdata(&dev->i2c_adap, &dev->v4l2_dev); i2c_set_adapdata(&dev->i2c_adap, &dev->v4l2_dev);

View File

@ -344,8 +344,8 @@ static int vidioc_querycap(struct file *file,
{ {
struct stk1160 *dev = video_drvdata(file); struct stk1160 *dev = video_drvdata(file);
strcpy(cap->driver, "stk1160"); strscpy(cap->driver, "stk1160", sizeof(cap->driver));
strcpy(cap->card, "stk1160"); strscpy(cap->card, "stk1160", sizeof(cap->card));
usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info)); usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info));
cap->device_caps = cap->device_caps =
V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_CAPTURE |

View File

@ -793,8 +793,8 @@ static int stk_vidioc_querycap(struct file *filp,
{ {
struct stk_camera *dev = video_drvdata(filp); struct stk_camera *dev = video_drvdata(filp);
strcpy(cap->driver, "stk"); strscpy(cap->driver, "stk", sizeof(cap->driver));
strcpy(cap->card, "stk"); strscpy(cap->card, "stk", sizeof(cap->card));
usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info)); usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info));
cap->device_caps = V4L2_CAP_VIDEO_CAPTURE cap->device_caps = V4L2_CAP_VIDEO_CAPTURE
@ -809,7 +809,7 @@ static int stk_vidioc_enum_input(struct file *filp,
if (input->index != 0) if (input->index != 0)
return -EINVAL; return -EINVAL;
strcpy(input->name, "Syntek USB Camera"); strscpy(input->name, "Syntek USB Camera", sizeof(input->name));
input->type = V4L2_INPUT_TYPE_CAMERA; input->type = V4L2_INPUT_TYPE_CAMERA;
return 0; return 0;
} }
@ -859,23 +859,23 @@ static int stk_vidioc_enum_fmt_vid_cap(struct file *filp,
switch (fmtd->index) { switch (fmtd->index) {
case 0: case 0:
fmtd->pixelformat = V4L2_PIX_FMT_RGB565; fmtd->pixelformat = V4L2_PIX_FMT_RGB565;
strcpy(fmtd->description, "r5g6b5"); strscpy(fmtd->description, "r5g6b5", sizeof(fmtd->description));
break; break;
case 1: case 1:
fmtd->pixelformat = V4L2_PIX_FMT_RGB565X; fmtd->pixelformat = V4L2_PIX_FMT_RGB565X;
strcpy(fmtd->description, "r5g6b5BE"); strscpy(fmtd->description, "r5g6b5BE", sizeof(fmtd->description));
break; break;
case 2: case 2:
fmtd->pixelformat = V4L2_PIX_FMT_UYVY; fmtd->pixelformat = V4L2_PIX_FMT_UYVY;
strcpy(fmtd->description, "yuv4:2:2"); strscpy(fmtd->description, "yuv4:2:2", sizeof(fmtd->description));
break; break;
case 3: case 3:
fmtd->pixelformat = V4L2_PIX_FMT_SBGGR8; fmtd->pixelformat = V4L2_PIX_FMT_SBGGR8;
strcpy(fmtd->description, "Raw bayer"); strscpy(fmtd->description, "Raw bayer", sizeof(fmtd->description));
break; break;
case 4: case 4:
fmtd->pixelformat = V4L2_PIX_FMT_YUYV; fmtd->pixelformat = V4L2_PIX_FMT_YUYV;
strcpy(fmtd->description, "yuv4:2:2"); strscpy(fmtd->description, "yuv4:2:2", sizeof(fmtd->description));
break; break;
default: default:
return -EINVAL; return -EINVAL;

View File

@ -429,8 +429,8 @@ static int tm6000_audio_init(struct tm6000_core *dev)
snd_printk(KERN_ERR "cannot create card instance %d\n", devnr); snd_printk(KERN_ERR "cannot create card instance %d\n", devnr);
return rc; return rc;
} }
strcpy(card->driver, "tm6000-alsa"); strscpy(card->driver, "tm6000-alsa", sizeof(card->driver));
strcpy(card->shortname, "TM5600/60x0"); strscpy(card->shortname, "TM5600/60x0", sizeof(card->shortname));
sprintf(card->longname, "TM5600/60x0 Audio at bus %d device %d", sprintf(card->longname, "TM5600/60x0 Audio at bus %d device %d",
dev->udev->bus->busnum, dev->udev->devnum); dev->udev->bus->busnum, dev->udev->devnum);
@ -456,7 +456,7 @@ static int tm6000_audio_init(struct tm6000_core *dev)
pcm->info_flags = 0; pcm->info_flags = 0;
pcm->private_data = chip; pcm->private_data = chip;
strcpy(pcm->name, "Trident TM5600/60x0"); strscpy(pcm->name, "Trident TM5600/60x0", sizeof(pcm->name));
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_tm6000_pcm_ops); snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_tm6000_pcm_ops);

View File

@ -1091,7 +1091,7 @@ static int vidioc_enum_input(struct file *file, void *priv,
else else
i->type = V4L2_INPUT_TYPE_CAMERA; i->type = V4L2_INPUT_TYPE_CAMERA;
strcpy(i->name, iname[dev->vinput[n].type]); strscpy(i->name, iname[dev->vinput[n].type], sizeof(i->name));
i->std = TM6000_STD; i->std = TM6000_STD;
@ -1188,7 +1188,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
if (0 != t->index) if (0 != t->index)
return -EINVAL; return -EINVAL;
strcpy(t->name, "Television"); strscpy(t->name, "Television", sizeof(t->name));
t->type = V4L2_TUNER_ANALOG_TV; t->type = V4L2_TUNER_ANALOG_TV;
t->capability = V4L2_TUNER_CAP_NORM | V4L2_TUNER_CAP_STEREO; t->capability = V4L2_TUNER_CAP_NORM | V4L2_TUNER_CAP_STEREO;
t->rangehigh = 0xffffffffUL; t->rangehigh = 0xffffffffUL;
@ -1268,7 +1268,7 @@ static int radio_g_tuner(struct file *file, void *priv,
return -EINVAL; return -EINVAL;
memset(t, 0, sizeof(*t)); memset(t, 0, sizeof(*t));
strcpy(t->name, "Radio"); strscpy(t->name, "Radio", sizeof(t->name));
t->type = V4L2_TUNER_RADIO; t->type = V4L2_TUNER_RADIO;
t->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO; t->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO;
t->rxsubchans = V4L2_TUNER_SUB_STEREO; t->rxsubchans = V4L2_TUNER_SUB_STEREO;

View File

@ -1686,7 +1686,7 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i
/* i2c */ /* i2c */
memset(&ttusb->i2c_adap, 0, sizeof(struct i2c_adapter)); memset(&ttusb->i2c_adap, 0, sizeof(struct i2c_adapter));
strcpy(ttusb->i2c_adap.name, "TTUSB DEC"); strscpy(ttusb->i2c_adap.name, "TTUSB DEC", sizeof(ttusb->i2c_adap.name));
i2c_set_adapdata(&ttusb->i2c_adap, ttusb); i2c_set_adapdata(&ttusb->i2c_adap, ttusb);

View File

@ -504,9 +504,9 @@ static int vidioc_enum_input(struct file *file, void *priv,
switch (chan) { switch (chan) {
case 0: case 0:
if (usbvision_device_data[usbvision->dev_model].video_channels == 4) { if (usbvision_device_data[usbvision->dev_model].video_channels == 4) {
strcpy(vi->name, "White Video Input"); strscpy(vi->name, "White Video Input", sizeof(vi->name));
} else { } else {
strcpy(vi->name, "Television"); strscpy(vi->name, "Television", sizeof(vi->name));
vi->type = V4L2_INPUT_TYPE_TUNER; vi->type = V4L2_INPUT_TYPE_TUNER;
vi->tuner = chan; vi->tuner = chan;
vi->std = USBVISION_NORMS; vi->std = USBVISION_NORMS;
@ -515,22 +515,23 @@ static int vidioc_enum_input(struct file *file, void *priv,
case 1: case 1:
vi->type = V4L2_INPUT_TYPE_CAMERA; vi->type = V4L2_INPUT_TYPE_CAMERA;
if (usbvision_device_data[usbvision->dev_model].video_channels == 4) if (usbvision_device_data[usbvision->dev_model].video_channels == 4)
strcpy(vi->name, "Green Video Input"); strscpy(vi->name, "Green Video Input", sizeof(vi->name));
else else
strcpy(vi->name, "Composite Video Input"); strscpy(vi->name, "Composite Video Input",
sizeof(vi->name));
vi->std = USBVISION_NORMS; vi->std = USBVISION_NORMS;
break; break;
case 2: case 2:
vi->type = V4L2_INPUT_TYPE_CAMERA; vi->type = V4L2_INPUT_TYPE_CAMERA;
if (usbvision_device_data[usbvision->dev_model].video_channels == 4) if (usbvision_device_data[usbvision->dev_model].video_channels == 4)
strcpy(vi->name, "Yellow Video Input"); strscpy(vi->name, "Yellow Video Input", sizeof(vi->name));
else else
strcpy(vi->name, "S-Video Input"); strscpy(vi->name, "S-Video Input", sizeof(vi->name));
vi->std = USBVISION_NORMS; vi->std = USBVISION_NORMS;
break; break;
case 3: case 3:
vi->type = V4L2_INPUT_TYPE_CAMERA; vi->type = V4L2_INPUT_TYPE_CAMERA;
strcpy(vi->name, "Red Video Input"); strscpy(vi->name, "Red Video Input", sizeof(vi->name));
vi->std = USBVISION_NORMS; vi->std = USBVISION_NORMS;
break; break;
} }
@ -589,9 +590,9 @@ static int vidioc_g_tuner(struct file *file, void *priv,
if (vt->index) /* Only tuner 0 */ if (vt->index) /* Only tuner 0 */
return -EINVAL; return -EINVAL;
if (vt->type == V4L2_TUNER_RADIO) if (vt->type == V4L2_TUNER_RADIO)
strcpy(vt->name, "Radio"); strscpy(vt->name, "Radio", sizeof(vt->name));
else else
strcpy(vt->name, "Television"); strscpy(vt->name, "Television", sizeof(vt->name));
/* Let clients fill in the remainder of this struct */ /* Let clients fill in the remainder of this struct */
call_all(usbvision, tuner, g_tuner, vt); call_all(usbvision, tuner, g_tuner, vt);
@ -814,7 +815,8 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
{ {
if (vfd->index >= USBVISION_SUPPORTED_PALETTES - 1) if (vfd->index >= USBVISION_SUPPORTED_PALETTES - 1)
return -EINVAL; return -EINVAL;
strcpy(vfd->description, usbvision_v4l2_format[vfd->index].desc); strscpy(vfd->description, usbvision_v4l2_format[vfd->index].desc,
sizeof(vfd->description));
vfd->pixelformat = usbvision_v4l2_format[vfd->index].format; vfd->pixelformat = usbvision_v4l2_format[vfd->index].format;
return 0; return 0;
} }

View File

@ -2132,7 +2132,7 @@ static int uvc_probe(struct usb_interface *intf,
if (udev->serial) if (udev->serial)
strscpy(dev->mdev.serial, udev->serial, strscpy(dev->mdev.serial, udev->serial,
sizeof(dev->mdev.serial)); sizeof(dev->mdev.serial));
strcpy(dev->mdev.bus_info, udev->devpath); strscpy(dev->mdev.bus_info, udev->devpath, sizeof(dev->mdev.bus_info));
dev->mdev.hw_revision = le16_to_cpu(udev->descriptor.bcdDevice); dev->mdev.hw_revision = le16_to_cpu(udev->descriptor.bcdDevice);
media_device_init(&dev->mdev); media_device_init(&dev->mdev);

View File

@ -719,7 +719,7 @@ static int zr364xx_vidioc_enum_input(struct file *file, void *priv,
{ {
if (i->index != 0) if (i->index != 0)
return -EINVAL; return -EINVAL;
strcpy(i->name, DRIVER_DESC " Camera"); strscpy(i->name, DRIVER_DESC " Camera", sizeof(i->name));
i->type = V4L2_INPUT_TYPE_CAMERA; i->type = V4L2_INPUT_TYPE_CAMERA;
return 0; return 0;
} }
@ -765,7 +765,7 @@ static int zr364xx_vidioc_enum_fmt_vid_cap(struct file *file,
if (f->index > 0) if (f->index > 0)
return -EINVAL; return -EINVAL;
f->flags = V4L2_FMT_FLAG_COMPRESSED; f->flags = V4L2_FMT_FLAG_COMPRESSED;
strcpy(f->description, formats[0].name); strscpy(f->description, formats[0].name, sizeof(f->description));
f->pixelformat = formats[0].fourcc; f->pixelformat = formats[0].fourcc;
return 0; return 0;
} }

View File

@ -639,7 +639,8 @@ static int vpfe_probe(struct platform_device *pdev)
goto probe_disable_clock; goto probe_disable_clock;
vpfe_dev->media_dev.dev = vpfe_dev->pdev; vpfe_dev->media_dev.dev = vpfe_dev->pdev;
strcpy((char *)&vpfe_dev->media_dev.model, "davinci-media"); strscpy((char *)&vpfe_dev->media_dev.model, "davinci-media",
sizeof(vpfe_dev->media_dev.model));
ret = media_device_register(&vpfe_dev->media_dev); ret = media_device_register(&vpfe_dev->media_dev);
if (ret) { if (ret) {

View File

@ -597,7 +597,7 @@ static int csi2_probe(struct platform_device *pdev)
csi2->sd.dev = &pdev->dev; csi2->sd.dev = &pdev->dev;
csi2->sd.owner = THIS_MODULE; csi2->sd.owner = THIS_MODULE;
csi2->sd.flags = V4L2_SUBDEV_FL_HAS_DEVNODE; csi2->sd.flags = V4L2_SUBDEV_FL_HAS_DEVNODE;
strcpy(csi2->sd.name, DEVICE_NAME); strscpy(csi2->sd.name, DEVICE_NAME, sizeof(csi2->sd.name));
csi2->sd.entity.function = MEDIA_ENT_F_VID_IF_BRIDGE; csi2->sd.entity.function = MEDIA_ENT_F_VID_IF_BRIDGE;
csi2->sd.grp_id = IMX_MEDIA_GRP_ID_CSI2; csi2->sd.grp_id = IMX_MEDIA_GRP_ID_CSI2;

View File

@ -1048,7 +1048,7 @@ static int zr36057_init (struct zoran *zr)
*zr->video_dev = zoran_template; *zr->video_dev = zoran_template;
zr->video_dev->v4l2_dev = &zr->v4l2_dev; zr->video_dev->v4l2_dev = &zr->v4l2_dev;
zr->video_dev->lock = &zr->lock; zr->video_dev->lock = &zr->lock;
strcpy(zr->video_dev->name, ZR_DEVNAME(zr)); strscpy(zr->video_dev->name, ZR_DEVNAME(zr), sizeof(zr->video_dev->name));
/* It's not a mem2mem device, but you can both capture and output from /* It's not a mem2mem device, but you can both capture and output from
one and the same device. This should really be split up into two one and the same device. This should really be split up into two
device nodes, but that's a job for another day. */ device nodes, but that's a job for another day. */