From: Steve Longerbeam <slongerbeam@gmail.com>
To: Hans Verkuil <hverkuil@xs4all.nl>, linux-media@vger.kernel.org
Cc: Hans Verkuil <hans.verkuil@cisco.com>,
Philipp Zabel <p.zabel@pengutronix.de>
Subject: Re: [PATCH 5/7] imx: fix compiler warning
Date: Mon, 14 May 2018 09:03:05 -0700 [thread overview]
Message-ID: <42a74bf5-6c5e-b5d7-d0ae-1eb015e16c32@gmail.com> (raw)
In-Reply-To: <20180514131346.15795-6-hverkuil@xs4all.nl>
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);
>
next prev parent reply other threads:[~2018-05-14 16:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2018-05-14 13:13 ` [PATCH 6/7] renesas-ceu: " Hans Verkuil
2018-05-14 13:13 ` [PATCH 7/7] soc_camera: " Hans Verkuil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42a74bf5-6c5e-b5d7-d0ae-1eb015e16c32@gmail.com \
--to=slongerbeam@gmail.com \
--cc=hans.verkuil@cisco.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).