diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-10 16:20:42 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-11 13:32:17 -0400 |
commit | cc1e6315e83db0e517dd9279050b88adc83a7eba (patch) | |
tree | 2fab5c7b2a4f3f50a045357a41c419fccc975de2 /drivers/media/pci/cx88 | |
parent | c0decac19da3906d9b66291e57b7759489e1170f (diff) |
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>
Diffstat (limited to 'drivers/media/pci/cx88')
-rw-r--r-- | drivers/media/pci/cx88/cx88-alsa.c | 6 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88-blackbird.c | 4 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88-cards.c | 2 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88-video.c | 8 |
4 files changed, 10 insertions, 10 deletions
diff --git a/drivers/media/pci/cx88/cx88-alsa.c b/drivers/media/pci/cx88/cx88-alsa.c index 89a65478ae36..b683cbe13dee 100644 --- a/drivers/media/pci/cx88/cx88-alsa.c +++ b/drivers/media/pci/cx88/cx88-alsa.c | |||
@@ -616,7 +616,7 @@ static int snd_cx88_pcm(struct cx88_audio_dev *chip, int device, | |||
616 | if (err < 0) | 616 | if (err < 0) |
617 | return err; | 617 | return err; |
618 | pcm->private_data = chip; | 618 | pcm->private_data = chip; |
619 | strcpy(pcm->name, name); | 619 | strscpy(pcm->name, name, sizeof(pcm->name)); |
620 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cx88_pcm_ops); | 620 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cx88_pcm_ops); |
621 | 621 | ||
622 | return 0; | 622 | return 0; |
@@ -968,12 +968,12 @@ static int cx88_audio_initdev(struct pci_dev *pci, | |||
968 | goto error; | 968 | goto error; |
969 | } | 969 | } |
970 | 970 | ||
971 | strcpy(card->driver, "CX88x"); | 971 | strscpy(card->driver, "CX88x", sizeof(card->driver)); |
972 | sprintf(card->shortname, "Conexant CX%x", pci->device); | 972 | sprintf(card->shortname, "Conexant CX%x", pci->device); |
973 | sprintf(card->longname, "%s at %#llx", | 973 | sprintf(card->longname, "%s at %#llx", |
974 | card->shortname, | 974 | card->shortname, |
975 | (unsigned long long)pci_resource_start(pci, 0)); | 975 | (unsigned long long)pci_resource_start(pci, 0)); |
976 | strcpy(card->mixername, "CX88"); | 976 | strscpy(card->mixername, "CX88", sizeof(card->mixername)); |
977 | 977 | ||
978 | dprintk(0, "%s/%i: ALSA support for cx2388x boards\n", | 978 | dprintk(0, "%s/%i: ALSA support for cx2388x boards\n", |
979 | card->driver, devno); | 979 | card->driver, devno); |
diff --git a/drivers/media/pci/cx88/cx88-blackbird.c b/drivers/media/pci/cx88/cx88-blackbird.c index cf4e926cc388..199756547f03 100644 --- a/drivers/media/pci/cx88/cx88-blackbird.c +++ b/drivers/media/pci/cx88/cx88-blackbird.c | |||
@@ -803,7 +803,7 @@ static int vidioc_querycap(struct file *file, void *priv, | |||
803 | struct cx8802_dev *dev = video_drvdata(file); | 803 | struct cx8802_dev *dev = video_drvdata(file); |
804 | struct cx88_core *core = dev->core; | 804 | struct cx88_core *core = dev->core; |
805 | 805 | ||
806 | strcpy(cap->driver, "cx88_blackbird"); | 806 | strscpy(cap->driver, "cx88_blackbird", sizeof(cap->driver)); |
807 | sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); | 807 | sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); |
808 | return cx88_querycap(file, core, cap); | 808 | return cx88_querycap(file, core, cap); |
809 | } | 809 | } |
@@ -995,7 +995,7 @@ static int vidioc_g_tuner(struct file *file, void *priv, | |||
995 | if (t->index != 0) | 995 | if (t->index != 0) |
996 | return -EINVAL; | 996 | return -EINVAL; |
997 | 997 | ||
998 | strcpy(t->name, "Television"); | 998 | strscpy(t->name, "Television", sizeof(t->name)); |
999 | t->capability = V4L2_TUNER_CAP_NORM; | 999 | t->capability = V4L2_TUNER_CAP_NORM; |
1000 | t->rangehigh = 0xffffffffUL; | 1000 | t->rangehigh = 0xffffffffUL; |
1001 | call_all(core, tuner, g_tuner, t); | 1001 | call_all(core, tuner, g_tuner, t); |
diff --git a/drivers/media/pci/cx88/cx88-cards.c b/drivers/media/pci/cx88/cx88-cards.c index 07e1483e987d..382af90fd4a9 100644 --- a/drivers/media/pci/cx88/cx88-cards.c +++ b/drivers/media/pci/cx88/cx88-cards.c | |||
@@ -3693,7 +3693,7 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr) | |||
3693 | core->height = 240; | 3693 | core->height = 240; |
3694 | core->field = V4L2_FIELD_INTERLACED; | 3694 | core->field = V4L2_FIELD_INTERLACED; |
3695 | 3695 | ||
3696 | strcpy(core->v4l2_dev.name, core->name); | 3696 | strscpy(core->v4l2_dev.name, core->name, sizeof(core->v4l2_dev.name)); |
3697 | if (v4l2_device_register(NULL, &core->v4l2_dev)) { | 3697 | if (v4l2_device_register(NULL, &core->v4l2_dev)) { |
3698 | kfree(core); | 3698 | kfree(core); |
3699 | return NULL; | 3699 | return NULL; |
diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c index f5d0624023da..df4e7a0686e0 100644 --- a/drivers/media/pci/cx88/cx88-video.c +++ b/drivers/media/pci/cx88/cx88-video.c | |||
@@ -842,7 +842,7 @@ static int vidioc_querycap(struct file *file, void *priv, | |||
842 | struct cx8800_dev *dev = video_drvdata(file); | 842 | struct cx8800_dev *dev = video_drvdata(file); |
843 | struct cx88_core *core = dev->core; | 843 | struct cx88_core *core = dev->core; |
844 | 844 | ||
845 | strcpy(cap->driver, "cx8800"); | 845 | strscpy(cap->driver, "cx8800", sizeof(cap->driver)); |
846 | sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); | 846 | sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); |
847 | return cx88_querycap(file, core, cap); | 847 | return cx88_querycap(file, core, cap); |
848 | } | 848 | } |
@@ -897,7 +897,7 @@ int cx88_enum_input(struct cx88_core *core, struct v4l2_input *i) | |||
897 | if (!INPUT(n).type) | 897 | if (!INPUT(n).type) |
898 | return -EINVAL; | 898 | return -EINVAL; |
899 | i->type = V4L2_INPUT_TYPE_CAMERA; | 899 | i->type = V4L2_INPUT_TYPE_CAMERA; |
900 | strcpy(i->name, iname[INPUT(n).type]); | 900 | strscpy(i->name, iname[INPUT(n).type], sizeof(i->name)); |
901 | if ((INPUT(n).type == CX88_VMUX_TELEVISION) || | 901 | if ((INPUT(n).type == CX88_VMUX_TELEVISION) || |
902 | (INPUT(n).type == CX88_VMUX_CABLE)) | 902 | (INPUT(n).type == CX88_VMUX_CABLE)) |
903 | i->type = V4L2_INPUT_TYPE_TUNER; | 903 | i->type = V4L2_INPUT_TYPE_TUNER; |
@@ -952,7 +952,7 @@ static int vidioc_g_tuner(struct file *file, void *priv, | |||
952 | if (t->index != 0) | 952 | if (t->index != 0) |
953 | return -EINVAL; | 953 | return -EINVAL; |
954 | 954 | ||
955 | strcpy(t->name, "Television"); | 955 | strscpy(t->name, "Television", sizeof(t->name)); |
956 | t->capability = V4L2_TUNER_CAP_NORM; | 956 | t->capability = V4L2_TUNER_CAP_NORM; |
957 | t->rangehigh = 0xffffffffUL; | 957 | t->rangehigh = 0xffffffffUL; |
958 | call_all(core, tuner, g_tuner, t); | 958 | call_all(core, tuner, g_tuner, t); |
@@ -1065,7 +1065,7 @@ static int radio_g_tuner(struct file *file, void *priv, | |||
1065 | if (unlikely(t->index > 0)) | 1065 | if (unlikely(t->index > 0)) |
1066 | return -EINVAL; | 1066 | return -EINVAL; |
1067 | 1067 | ||
1068 | strcpy(t->name, "Radio"); | 1068 | strscpy(t->name, "Radio", sizeof(t->name)); |
1069 | 1069 | ||
1070 | call_all(core, tuner, g_tuner, t); | 1070 | call_all(core, tuner, g_tuner, t); |
1071 | return 0; | 1071 | return 0; |