diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-10 08:19:16 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-03-29 10:26:13 -0400 |
commit | 85709cbf152465c77a9c2de48a6f4ef23c8c3d83 (patch) | |
tree | 4dc492b6da48d0d1f9ede150c0c2386f4efb6438 /drivers/media/platform/s5p-g2d | |
parent | 060162c1af5cd807384247cc95a0d5cb016e316a (diff) | |
download | linux-stable-85709cbf152465c77a9c2de48a6f4ef23c8c3d83.tar.gz linux-stable-85709cbf152465c77a9c2de48a6f4ef23c8c3d83.tar.bz2 linux-stable-85709cbf152465c77a9c2de48a6f4ef23c8c3d83.zip |
media: replace strncpy() by strscpy()
The strncpy() function is being deprecated upstream. Replace
it by the safer strscpy().
While here, replace a few occurences of strlcpy() that were
recently added to also use strscpy().
Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform/s5p-g2d')
-rw-r--r-- | drivers/media/platform/s5p-g2d/g2d.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/platform/s5p-g2d/g2d.c b/drivers/media/platform/s5p-g2d/g2d.c index 971c47165010..c8f394e1aff4 100644 --- a/drivers/media/platform/s5p-g2d/g2d.c +++ b/drivers/media/platform/s5p-g2d/g2d.c @@ -297,8 +297,8 @@ static int g2d_release(struct file *file) static int vidioc_querycap(struct file *file, void *priv, struct v4l2_capability *cap) { - strncpy(cap->driver, G2D_NAME, sizeof(cap->driver) - 1); - strncpy(cap->card, G2D_NAME, sizeof(cap->card) - 1); + strscpy(cap->driver, G2D_NAME, sizeof(cap->driver)); + strscpy(cap->card, G2D_NAME, sizeof(cap->card)); cap->bus_info[0] = 0; cap->device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING; cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; @@ -312,7 +312,7 @@ static int vidioc_enum_fmt(struct file *file, void *prv, struct v4l2_fmtdesc *f) return -EINVAL; fmt = &formats[f->index]; f->pixelformat = fmt->fourcc; - strncpy(f->description, fmt->name, sizeof(f->description) - 1); + strscpy(f->description, fmt->name, sizeof(f->description)); return 0; } |