forked from Minki/linux
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: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
parent
ba17f7805f
commit
fd1857240d
@ -271,8 +271,8 @@ static int vidioc_querycap(struct file *file, void *priv,
|
||||
{
|
||||
struct s5p_mfc_dev *dev = video_drvdata(file);
|
||||
|
||||
strncpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver) - 1);
|
||||
strncpy(cap->card, dev->vfd_dec->name, sizeof(cap->card) - 1);
|
||||
strlcpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver));
|
||||
strlcpy(cap->card, dev->vfd_dec->name, sizeof(cap->card));
|
||||
snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
|
||||
dev_name(&dev->plat_dev->dev));
|
||||
/*
|
||||
|
@ -1313,8 +1313,8 @@ static int vidioc_querycap(struct file *file, void *priv,
|
||||
{
|
||||
struct s5p_mfc_dev *dev = video_drvdata(file);
|
||||
|
||||
strncpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver) - 1);
|
||||
strncpy(cap->card, dev->vfd_enc->name, sizeof(cap->card) - 1);
|
||||
strlcpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver));
|
||||
strlcpy(cap->card, dev->vfd_enc->name, sizeof(cap->card));
|
||||
snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
|
||||
dev_name(&dev->plat_dev->dev));
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user