diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-10 22:20:42 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-11 19:32:17 +0200 |
commit | cc1e6315e83db0e517dd9279050b88adc83a7eba (patch) | |
tree | 2fab5c7b2a4f3f50a045357a41c419fccc975de2 /drivers/media/radio | |
parent | media: use strscpy() instead of strlcpy() (diff) | |
download | linux-cc1e6315e83db0e517dd9279050b88adc83a7eba.tar.xz linux-cc1e6315e83db0e517dd9279050b88adc83a7eba.zip |
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/radio')
-rw-r--r-- | drivers/media/radio/dsbr100.c | 2 | ||||
-rw-r--r-- | drivers/media/radio/radio-ma901.c | 2 | ||||
-rw-r--r-- | drivers/media/radio/radio-mr800.c | 2 | ||||
-rw-r--r-- | drivers/media/radio/si470x/radio-si470x-common.c | 2 | ||||
-rw-r--r-- | drivers/media/radio/wl128x/fmdrv_v4l2.c | 4 |
5 files changed, 6 insertions, 6 deletions
diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c index a6f207b448be..c9d51a5f2838 100644 --- a/drivers/media/radio/dsbr100.c +++ b/drivers/media/radio/dsbr100.c @@ -191,7 +191,7 @@ static int vidioc_g_tuner(struct file *file, void *priv, return -EINVAL; dsbr100_getstat(radio); - strcpy(v->name, "FM"); + strscpy(v->name, "FM", sizeof(v->name)); v->type = V4L2_TUNER_RADIO; v->rangelow = FREQ_MIN * FREQ_MUL; v->rangehigh = FREQ_MAX * FREQ_MUL; diff --git a/drivers/media/radio/radio-ma901.c b/drivers/media/radio/radio-ma901.c index 0a59d97d4627..5cb153727841 100644 --- a/drivers/media/radio/radio-ma901.c +++ b/drivers/media/radio/radio-ma901.c @@ -222,7 +222,7 @@ static int vidioc_g_tuner(struct file *file, void *priv, * 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->rangelow = FREQ_MIN * FREQ_MUL; v->rangehigh = FREQ_MAX * FREQ_MUL; diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c index e7c35b184e21..ab1324f68199 100644 --- a/drivers/media/radio/radio-mr800.c +++ b/drivers/media/radio/radio-mr800.c @@ -291,7 +291,7 @@ static int vidioc_g_tuner(struct file *file, void *priv, if (retval) return retval; - strcpy(v->name, "FM"); + strscpy(v->name, "FM", sizeof(v->name)); v->type = V4L2_TUNER_RADIO; v->rangelow = FREQ_MIN * FREQ_MUL; v->rangehigh = FREQ_MAX * FREQ_MUL; diff --git a/drivers/media/radio/si470x/radio-si470x-common.c b/drivers/media/radio/si470x/radio-si470x-common.c index c40e1753f34b..1d7ab5462c77 100644 --- a/drivers/media/radio/si470x/radio-si470x-common.c +++ b/drivers/media/radio/si470x/radio-si470x-common.c @@ -622,7 +622,7 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv, } /* driver constants */ - strcpy(tuner->name, "FM"); + strscpy(tuner->name, "FM", sizeof(tuner->name)); tuner->type = V4L2_TUNER_RADIO; tuner->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_RDS | V4L2_TUNER_CAP_RDS_BLOCK_IO | diff --git a/drivers/media/radio/wl128x/fmdrv_v4l2.c b/drivers/media/radio/wl128x/fmdrv_v4l2.c index c5f433b24713..e25fd4d4d280 100644 --- a/drivers/media/radio/wl128x/fmdrv_v4l2.c +++ b/drivers/media/radio/wl128x/fmdrv_v4l2.c @@ -249,7 +249,7 @@ static int fm_v4l2_vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *audio) { memset(audio, 0, sizeof(*audio)); - strcpy(audio->name, "Radio"); + strscpy(audio->name, "Radio", sizeof(audio->name)); audio->capability = V4L2_AUDCAP_STEREO; return 0; @@ -293,7 +293,7 @@ static int fm_v4l2_vidioc_g_tuner(struct file *file, void *priv, if (ret != 0) return ret; - strcpy(tuner->name, "FM"); + strscpy(tuner->name, "FM", sizeof(tuner->name)); tuner->type = V4L2_TUNER_RADIO; /* Store rangelow and rangehigh freq in unit of 62.5 Hz */ tuner->rangelow = bottom_freq * 16; |