All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] Fix compiler/sparse warnings
@ 2018-05-14 13:13 Hans Verkuil
  2018-05-14 13:13 ` [PATCH 1/7] go7007: fix two sparse warnings Hans Verkuil
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Hans Verkuil @ 2018-05-14 13:13 UTC (permalink / raw)
  To: linux-media

From: Hans Verkuil <hans.verkuil@cisco.com>

After upgrading to gcc 8.1 we got new warnings. This series
fixes them.

There is a remaining warning in atomisp, but that's going to
be removed from staging anyway.

Regards,

	Hans

Hans Verkuil (7):
  go7007: fix two sparse warnings
  zoran: fix compiler warning
  s5p-mfc: fix two sparse warnings
  hdpvr: fix compiler warning
  imx: fix compiler warning
  renesas-ceu: fix compiler warning
  soc_camera: fix compiler warning

 drivers/media/platform/renesas-ceu.c                    | 2 +-
 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c            | 4 ++--
 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c            | 4 ++--
 drivers/media/platform/soc_camera/soc_camera_platform.c | 3 ++-
 drivers/media/usb/go7007/go7007-fw.c                    | 3 +++
 drivers/media/usb/go7007/go7007-v4l2.c                  | 2 +-
 drivers/media/usb/hdpvr/hdpvr-video.c                   | 2 +-
 drivers/staging/media/imx/imx-media-capture.c           | 4 ++--
 drivers/staging/media/zoran/zoran_driver.c              | 4 ++--
 9 files changed, 16 insertions(+), 12 deletions(-)

-- 
2.17.0

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/7] go7007: fix two sparse warnings
  2018-05-14 13:13 [PATCH 0/7] Fix compiler/sparse warnings Hans Verkuil
@ 2018-05-14 13:13 ` Hans Verkuil
  2018-05-14 13:13 ` [PATCH 2/7] zoran: fix compiler warning Hans Verkuil
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Hans Verkuil @ 2018-05-14 13:13 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil

From: Hans Verkuil <hans.verkuil@cisco.com>

drivers/media/usb/go7007/go7007-v4l2.c:637:2: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation]
drivers/media/usb/go7007/go7007-fw.c:1507:3: warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/usb/go7007/go7007-fw.c   | 3 +++
 drivers/media/usb/go7007/go7007-v4l2.c | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/go7007/go7007-fw.c b/drivers/media/usb/go7007/go7007-fw.c
index 60bf5f0644d1..87b4fc48ef09 100644
--- a/drivers/media/usb/go7007/go7007-fw.c
+++ b/drivers/media/usb/go7007/go7007-fw.c
@@ -1514,7 +1514,10 @@ static int do_special(struct go7007 *go, u16 type, __le16 *code, int space,
 		case V4L2_PIX_FMT_MPEG4:
 			return gen_mpeg4hdr_to_package(go, code, space,
 								framelen);
+		default:
+			break;
 		}
+		break;
 	case SPECIAL_BRC_CTRL:
 		return brctrl_to_package(go, code, space, framelen);
 	case SPECIAL_CONFIG:
diff --git a/drivers/media/usb/go7007/go7007-v4l2.c b/drivers/media/usb/go7007/go7007-v4l2.c
index 98cd57eaf36a..c55c82f70e54 100644
--- a/drivers/media/usb/go7007/go7007-v4l2.c
+++ b/drivers/media/usb/go7007/go7007-v4l2.c
@@ -634,7 +634,7 @@ static int vidioc_enum_input(struct file *file, void *priv,
 	if (inp->index >= go->board_info->num_inputs)
 		return -EINVAL;
 
-	strncpy(inp->name, go->board_info->inputs[inp->index].name,
+	strlcpy(inp->name, go->board_info->inputs[inp->index].name,
 			sizeof(inp->name));
 
 	/* If this board has a tuner, it will be the first input */
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/7] zoran: fix compiler warning
  2018-05-14 13:13 [PATCH 0/7] Fix compiler/sparse warnings Hans Verkuil
  2018-05-14 13:13 ` [PATCH 1/7] go7007: fix two sparse warnings Hans Verkuil
@ 2018-05-14 13:13 ` Hans Verkuil
  2018-05-14 13:13 ` [PATCH 3/7] s5p-mfc: fix two sparse warnings Hans Verkuil
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Hans Verkuil @ 2018-05-14 13:13 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil

From: Hans Verkuil <hans.verkuil@cisco.com>

In file included from media-git/include/linux/bitmap.h:9,
                 from media-git/include/linux/cpumask.h:12,
                 from media-git/arch/x86/include/asm/cpumask.h:5,
                 from media-git/arch/x86/include/asm/msr.h:11,
                 from media-git/arch/x86/include/asm/processor.h:21,
                 from media-git/arch/x86/include/asm/cpufeature.h:5,
                 from media-git/arch/x86/include/asm/thread_info.h:53,
                 from media-git/include/linux/thread_info.h:38,
                 from media-git/arch/x86/include/asm/preempt.h:7,
                 from media-git/include/linux/preempt.h:81,
                 from media-git/include/linux/spinlock.h:51,
                 from media-git/include/linux/seqlock.h:36,
                 from media-git/include/linux/time.h:6,
                 from media-git/include/linux/stat.h:19,
                 from media-git/include/linux/module.h:10,
                 from media-git/drivers/staging/media/zoran/zoran_driver.c:44:
In function 'strncpy',
    inlined from 'zoran_querycap' at media-git/drivers/staging/media/zoran/zoran_driver.c:1512:2:
media-git/include/linux/string.h:246:9: warning: '__builtin_strncpy' output may be truncated copying 31 bytes from a string of length 31 [-Wstringop-truncation]
  return __builtin_strncpy(p, q, size);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/staging/media/zoran/zoran_driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/zoran/zoran_driver.c b/drivers/staging/media/zoran/zoran_driver.c
index 14f9c0e26a1c..d2e13fffbc6b 100644
--- a/drivers/staging/media/zoran/zoran_driver.c
+++ b/drivers/staging/media/zoran/zoran_driver.c
@@ -1509,8 +1509,8 @@ static int zoran_querycap(struct file *file, void *__fh, struct v4l2_capability
 	struct zoran_fh *fh = __fh;
 	struct zoran *zr = fh->zr;
 
-	strncpy(cap->card, ZR_DEVNAME(zr), sizeof(cap->card)-1);
-	strncpy(cap->driver, "zoran", sizeof(cap->driver)-1);
+	strlcpy(cap->card, ZR_DEVNAME(zr), sizeof(cap->card));
+	strlcpy(cap->driver, "zoran", sizeof(cap->driver));
 	snprintf(cap->bus_info, sizeof(cap->bus_info), "PCI:%s",
 		 pci_name(zr->pci_dev));
 	cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_CAPTURE |
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/7] s5p-mfc: fix two sparse warnings
  2018-05-14 13:13 [PATCH 0/7] Fix compiler/sparse warnings Hans Verkuil
  2018-05-14 13:13 ` [PATCH 1/7] go7007: fix two sparse warnings Hans Verkuil
  2018-05-14 13:13 ` [PATCH 2/7] zoran: fix compiler warning Hans Verkuil
@ 2018-05-14 13:13 ` Hans Verkuil
  2018-05-15  9:53   ` Sylwester Nawrocki
  2018-05-14 13:13 ` [PATCH 4/7] hdpvr: fix compiler warning Hans Verkuil
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 10+ messages in thread
From: Hans Verkuil @ 2018-05-14 13:13 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Sylwester Nawrocki

From: Hans Verkuil <hans.verkuil@cisco.com>

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>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 4 ++--
 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
index 5cf4d9921264..6a3cc4f86c5d 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
@@ -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));
 	/*
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
index 5c0462ca9993..570f391f2cfd 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
@@ -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));
 	/*
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/7] hdpvr: fix compiler warning
  2018-05-14 13:13 [PATCH 0/7] Fix compiler/sparse warnings Hans Verkuil
                   ` (2 preceding siblings ...)
  2018-05-14 13:13 ` [PATCH 3/7] s5p-mfc: fix two sparse warnings Hans Verkuil
@ 2018-05-14 13:13 ` Hans Verkuil
  2018-05-14 13:13 ` [PATCH 5/7] imx: " Hans Verkuil
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Hans Verkuil @ 2018-05-14 13:13 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil

From: Hans Verkuil <hans.verkuil@cisco.com>

In function 'strncpy',
    inlined from 'vidioc_g_audio' at media-git/drivers/media/usb/hdpvr/hdpvr-video.c:876:2:
media-git/include/linux/string.h:246:9: warning: '__builtin_strncpy' specified bound 32 equals destination size [-Wstringop-truncation]
  return __builtin_strncpy(p, q, size);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/usb/hdpvr/hdpvr-video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c
index 77c3d331ff31..1b89c77bad66 100644
--- a/drivers/media/usb/hdpvr/hdpvr-video.c
+++ b/drivers/media/usb/hdpvr/hdpvr-video.c
@@ -873,7 +873,7 @@ static int vidioc_g_audio(struct file *file, void *private_data,
 
 	audio->index = dev->options.audio_input;
 	audio->capability = V4L2_AUDCAP_STEREO;
-	strncpy(audio->name, audio_iname[audio->index], sizeof(audio->name));
+	strlcpy(audio->name, audio_iname[audio->index], sizeof(audio->name));
 	audio->name[sizeof(audio->name) - 1] = '\0';
 	return 0;
 }
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/7] imx: fix compiler warning
  2018-05-14 13:13 [PATCH 0/7] Fix compiler/sparse warnings Hans Verkuil
                   ` (3 preceding siblings ...)
  2018-05-14 13:13 ` [PATCH 4/7] hdpvr: fix compiler warning Hans Verkuil
@ 2018-05-14 13:13 ` Hans Verkuil
  2018-05-14 16:03   ` Steve Longerbeam
  2018-05-14 13:13 ` [PATCH 6/7] renesas-ceu: " Hans Verkuil
  2018-05-14 13:13 ` [PATCH 7/7] soc_camera: " Hans Verkuil
  6 siblings, 1 reply; 10+ messages in thread
From: Hans Verkuil @ 2018-05-14 13:13 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Steve Longerbeam, Philipp Zabel

From: Hans Verkuil <hans.verkuil@cisco.com>

drivers/staging/media/imx/imx-media-capture.c: In function 'vidioc_querycap':
drivers/staging/media/imx/imx-media-capture.c:76:2: warning: 'strncpy' output truncated copying 15 bytes from a string of length 17 [-Wstringop-truncation]
  strncpy(cap->driver, "imx-media-capture", sizeof(cap->driver) - 1);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Steve Longerbeam <slongerbeam@gmail.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/staging/media/imx/imx-media-capture.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c
index 0ccabe04b0e1..4e3fdf8aeef5 100644
--- a/drivers/staging/media/imx/imx-media-capture.c
+++ b/drivers/staging/media/imx/imx-media-capture.c
@@ -73,8 +73,8 @@ static int vidioc_querycap(struct file *file, void *fh,
 {
 	struct capture_priv *priv = video_drvdata(file);
 
-	strncpy(cap->driver, "imx-media-capture", sizeof(cap->driver) - 1);
-	strncpy(cap->card, "imx-media-capture", sizeof(cap->card) - 1);
+	strlcpy(cap->driver, "imx-media-capture", sizeof(cap->driver));
+	strlcpy(cap->card, "imx-media-capture", sizeof(cap->card));
 	snprintf(cap->bus_info, sizeof(cap->bus_info),
 		 "platform:%s", priv->src_sd->name);
 
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 6/7] renesas-ceu: fix compiler warning
  2018-05-14 13:13 [PATCH 0/7] Fix compiler/sparse warnings Hans Verkuil
                   ` (4 preceding siblings ...)
  2018-05-14 13:13 ` [PATCH 5/7] imx: " Hans Verkuil
@ 2018-05-14 13:13 ` Hans Verkuil
  2018-05-14 13:13 ` [PATCH 7/7] soc_camera: " Hans Verkuil
  6 siblings, 0 replies; 10+ messages in thread
From: Hans Verkuil @ 2018-05-14 13:13 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Jacopo Mondi

From: Hans Verkuil <hans.verkuil@cisco.com>

In function 'strncpy',
    inlined from 'ceu_notify_complete' at drivers/media/platform/renesas-ceu.c:1378:2:
include/linux/string.h:246:9: warning: '__builtin_strncpy' output truncated before terminating nul copying 11 bytes from a string of the same length [-Wstringop-truncation]
  return __builtin_strncpy(p, q, size);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Jacopo Mondi <jacopo+renesas@jmondi.org>
---
 drivers/media/platform/renesas-ceu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/renesas-ceu.c b/drivers/media/platform/renesas-ceu.c
index 4879261857fc..fe4fe944592d 100644
--- a/drivers/media/platform/renesas-ceu.c
+++ b/drivers/media/platform/renesas-ceu.c
@@ -1375,7 +1375,7 @@ static int ceu_notify_complete(struct v4l2_async_notifier *notifier)
 		return ret;
 
 	/* Register the video device. */
-	strncpy(vdev->name, DRIVER_NAME, strlen(DRIVER_NAME));
+	strlcpy(vdev->name, DRIVER_NAME, sizeof(vdev->name));
 	vdev->v4l2_dev		= v4l2_dev;
 	vdev->lock		= &ceudev->mlock;
 	vdev->queue		= &ceudev->vb2_vq;
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 7/7] soc_camera: fix compiler warning
  2018-05-14 13:13 [PATCH 0/7] Fix compiler/sparse warnings Hans Verkuil
                   ` (5 preceding siblings ...)
  2018-05-14 13:13 ` [PATCH 6/7] renesas-ceu: " Hans Verkuil
@ 2018-05-14 13:13 ` Hans Verkuil
  6 siblings, 0 replies; 10+ messages in thread
From: Hans Verkuil @ 2018-05-14 13:13 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil

From: Hans Verkuil <hans.verkuil@cisco.com>

In function 'strncpy',
    inlined from 'soc_camera_platform_probe' at drivers/media/platform/soc_camera/soc_camera_platform.c:162:2:
include/linux/string.h:246:9: warning: '__builtin_strncpy' specified bound 32 equals destination size [-Wstringop-truncation]
  return __builtin_strncpy(p, q, size);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/platform/soc_camera/soc_camera_platform.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/soc_camera/soc_camera_platform.c b/drivers/media/platform/soc_camera/soc_camera_platform.c
index cb4986b8f798..ce00e90d4e3c 100644
--- a/drivers/media/platform/soc_camera/soc_camera_platform.c
+++ b/drivers/media/platform/soc_camera/soc_camera_platform.c
@@ -159,7 +159,8 @@ static int soc_camera_platform_probe(struct platform_device *pdev)
 
 	v4l2_subdev_init(&priv->subdev, &platform_subdev_ops);
 	v4l2_set_subdevdata(&priv->subdev, p);
-	strncpy(priv->subdev.name, dev_name(&pdev->dev), V4L2_SUBDEV_NAME_SIZE);
+	strlcpy(priv->subdev.name, dev_name(&pdev->dev),
+		sizeof(priv->subdev.name));
 
 	return v4l2_device_register_subdev(&ici->v4l2_dev, &priv->subdev);
 }
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 5/7] imx: fix compiler warning
  2018-05-14 13:13 ` [PATCH 5/7] imx: " Hans Verkuil
@ 2018-05-14 16:03   ` Steve Longerbeam
  0 siblings, 0 replies; 10+ messages in thread
From: Steve Longerbeam @ 2018-05-14 16:03 UTC (permalink / raw)
  To: Hans Verkuil, linux-media; +Cc: Hans Verkuil, Philipp Zabel

Acked-by: Steve Longerbeam <steve_longerbeam@mentor.com>


On 05/14/2018 06:13 AM, Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> drivers/staging/media/imx/imx-media-capture.c: In function 'vidioc_querycap':
> drivers/staging/media/imx/imx-media-capture.c:76:2: warning: 'strncpy' output truncated copying 15 bytes from a string of length 17 [-Wstringop-truncation]
>    strncpy(cap->driver, "imx-media-capture", sizeof(cap->driver) - 1);
>    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> Cc: Steve Longerbeam <slongerbeam@gmail.com>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> ---
>   drivers/staging/media/imx/imx-media-capture.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c
> index 0ccabe04b0e1..4e3fdf8aeef5 100644
> --- a/drivers/staging/media/imx/imx-media-capture.c
> +++ b/drivers/staging/media/imx/imx-media-capture.c
> @@ -73,8 +73,8 @@ static int vidioc_querycap(struct file *file, void *fh,
>   {
>   	struct capture_priv *priv = video_drvdata(file);
>   
> -	strncpy(cap->driver, "imx-media-capture", sizeof(cap->driver) - 1);
> -	strncpy(cap->card, "imx-media-capture", sizeof(cap->card) - 1);
> +	strlcpy(cap->driver, "imx-media-capture", sizeof(cap->driver));
> +	strlcpy(cap->card, "imx-media-capture", sizeof(cap->card));
>   	snprintf(cap->bus_info, sizeof(cap->bus_info),
>   		 "platform:%s", priv->src_sd->name);
>   

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/7] s5p-mfc: fix two sparse warnings
  2018-05-14 13:13 ` [PATCH 3/7] s5p-mfc: fix two sparse warnings Hans Verkuil
@ 2018-05-15  9:53   ` Sylwester Nawrocki
  0 siblings, 0 replies; 10+ messages in thread
From: Sylwester Nawrocki @ 2018-05-15  9:53 UTC (permalink / raw)
  To: Hans Verkuil, linux-media; +Cc: Hans Verkuil

On 05/14/2018 03:13 PM, Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
> 
> 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>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-05-15  9:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-14 13:13 [PATCH 0/7] Fix compiler/sparse warnings Hans Verkuil
2018-05-14 13:13 ` [PATCH 1/7] go7007: fix two sparse warnings Hans Verkuil
2018-05-14 13:13 ` [PATCH 2/7] zoran: fix compiler warning Hans Verkuil
2018-05-14 13:13 ` [PATCH 3/7] s5p-mfc: fix two sparse warnings Hans Verkuil
2018-05-15  9:53   ` Sylwester Nawrocki
2018-05-14 13:13 ` [PATCH 4/7] hdpvr: fix compiler warning Hans Verkuil
2018-05-14 13:13 ` [PATCH 5/7] imx: " Hans Verkuil
2018-05-14 16:03   ` Steve Longerbeam
2018-05-14 13:13 ` [PATCH 6/7] renesas-ceu: " Hans Verkuil
2018-05-14 13:13 ` [PATCH 7/7] soc_camera: " Hans Verkuil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.