Commit fd185724 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

media: s5p-mfc: fix two sparse warnings

media-git/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c: In function 'vidioc_querycap':
media-git/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c:1317:2: warning: 'strncpy' output may be truncated copying 31 bytes from a string of length 31 [-Wstringop-truncation]
  strncpy(cap->card, dev->vfd_enc->name, sizeof(cap->card) - 1);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
media-git/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c: In function 'vidioc_querycap':
media-git/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c:275:2: warning: 'strncpy' output may be truncated copying 31 bytes from a string of length 31 [-Wstringop-truncation]
  strncpy(cap->card, dev->vfd_dec->name, sizeof(cap->card) - 1);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent ba17f780
...@@ -271,8 +271,8 @@ static int vidioc_querycap(struct file *file, void *priv, ...@@ -271,8 +271,8 @@ static int vidioc_querycap(struct file *file, void *priv,
{ {
struct s5p_mfc_dev *dev = video_drvdata(file); struct s5p_mfc_dev *dev = video_drvdata(file);
strncpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver) - 1); strlcpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver));
strncpy(cap->card, dev->vfd_dec->name, sizeof(cap->card) - 1); strlcpy(cap->card, dev->vfd_dec->name, sizeof(cap->card));
snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
dev_name(&dev->plat_dev->dev)); dev_name(&dev->plat_dev->dev));
/* /*
......
...@@ -1313,8 +1313,8 @@ static int vidioc_querycap(struct file *file, void *priv, ...@@ -1313,8 +1313,8 @@ static int vidioc_querycap(struct file *file, void *priv,
{ {
struct s5p_mfc_dev *dev = video_drvdata(file); struct s5p_mfc_dev *dev = video_drvdata(file);
strncpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver) - 1); strlcpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver));
strncpy(cap->card, dev->vfd_enc->name, sizeof(cap->card) - 1); strlcpy(cap->card, dev->vfd_enc->name, sizeof(cap->card));
snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
dev_name(&dev->plat_dev->dev)); dev_name(&dev->plat_dev->dev));
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment