From: j.anaszewski@samsung.com (Jacek Anaszewski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/6] [media] s5p-jpeg: only fill driver's name in capabilities driver field
Date: Fri, 17 Jun 2016 08:45:17 +0200 [thread overview]
Message-ID: <57639C7D.2030706@samsung.com> (raw)
In-Reply-To: <1466113235-25909-5-git-send-email-javier@osg.samsung.com>
Hi Javier,
On 06/16/2016 11:40 PM, Javier Martinez Canillas wrote:
> The driver fills in both the struct v4l2_capability driver and card fields
> the same values, that is the driver's name plus the information if the dev
> is a decoder or an encoder.
>
> But the driver field has a fixed length of 16 bytes so the filled data is
> truncated:
>
> Driver Info (not using libv4l2):
> Driver name : s5p-jpeg decode
> Card type : s5p-jpeg decoder
> Bus info : platform:11f50000.jpeg
> Driver version: 4.7.0
>
> Also, this field should only contain the driver's name so use just that.
> The information if the device is a decoder or an encoder is in the card
> type field anyways.
>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
> ---
>
> drivers/media/platform/s5p-jpeg/jpeg-core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c
> index e3ff3d4bd72e..f9fb52a53e79 100644
> --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
> +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
> @@ -1246,12 +1246,12 @@ static int s5p_jpeg_querycap(struct file *file, void *priv,
> struct s5p_jpeg_ctx *ctx = fh_to_ctx(priv);
>
> if (ctx->mode == S5P_JPEG_ENCODE) {
> - strlcpy(cap->driver, S5P_JPEG_M2M_NAME " encoder",
> + strlcpy(cap->driver, S5P_JPEG_M2M_NAME,
> sizeof(cap->driver));
> strlcpy(cap->card, S5P_JPEG_M2M_NAME " encoder",
> sizeof(cap->card));
> } else {
> - strlcpy(cap->driver, S5P_JPEG_M2M_NAME " decoder",
> + strlcpy(cap->driver, S5P_JPEG_M2M_NAME,
> sizeof(cap->driver));
> strlcpy(cap->card, S5P_JPEG_M2M_NAME " decoder",
> sizeof(cap->card));
>
Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>
--
Best regards,
Jacek Anaszewski
WARNING: multiple messages have this Message-ID (diff)
From: Jacek Anaszewski <j.anaszewski@samsung.com>
To: Javier Martinez Canillas <javier@osg.samsung.com>
Cc: linux-kernel@vger.kernel.org,
Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
Andrzej Pietrasiewicz <andrzej.p@samsung.com>,
linux-arm-kernel@lists.infradead.org,
linux-media@vger.kernel.org
Subject: Re: [PATCH 4/6] [media] s5p-jpeg: only fill driver's name in capabilities driver field
Date: Fri, 17 Jun 2016 08:45:17 +0200 [thread overview]
Message-ID: <57639C7D.2030706@samsung.com> (raw)
In-Reply-To: <1466113235-25909-5-git-send-email-javier@osg.samsung.com>
Hi Javier,
On 06/16/2016 11:40 PM, Javier Martinez Canillas wrote:
> The driver fills in both the struct v4l2_capability driver and card fields
> the same values, that is the driver's name plus the information if the dev
> is a decoder or an encoder.
>
> But the driver field has a fixed length of 16 bytes so the filled data is
> truncated:
>
> Driver Info (not using libv4l2):
> Driver name : s5p-jpeg decode
> Card type : s5p-jpeg decoder
> Bus info : platform:11f50000.jpeg
> Driver version: 4.7.0
>
> Also, this field should only contain the driver's name so use just that.
> The information if the device is a decoder or an encoder is in the card
> type field anyways.
>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
> ---
>
> drivers/media/platform/s5p-jpeg/jpeg-core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c
> index e3ff3d4bd72e..f9fb52a53e79 100644
> --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
> +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
> @@ -1246,12 +1246,12 @@ static int s5p_jpeg_querycap(struct file *file, void *priv,
> struct s5p_jpeg_ctx *ctx = fh_to_ctx(priv);
>
> if (ctx->mode == S5P_JPEG_ENCODE) {
> - strlcpy(cap->driver, S5P_JPEG_M2M_NAME " encoder",
> + strlcpy(cap->driver, S5P_JPEG_M2M_NAME,
> sizeof(cap->driver));
> strlcpy(cap->card, S5P_JPEG_M2M_NAME " encoder",
> sizeof(cap->card));
> } else {
> - strlcpy(cap->driver, S5P_JPEG_M2M_NAME " decoder",
> + strlcpy(cap->driver, S5P_JPEG_M2M_NAME,
> sizeof(cap->driver));
> strlcpy(cap->card, S5P_JPEG_M2M_NAME " decoder",
> sizeof(cap->card));
>
Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>
--
Best regards,
Jacek Anaszewski
next prev parent reply other threads:[~2016-06-17 6:45 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-16 21:40 [PATCH 0/6] [media] Fixes and improvements for VIDIOC_QUERYCAP in Samsung media drivers Javier Martinez Canillas
2016-06-16 21:40 ` Javier Martinez Canillas
2016-06-16 21:40 ` [PATCH 1/6] [media] s5p-mfc: set capablity bus_info as required by VIDIOC_QUERYCAP Javier Martinez Canillas
2016-06-16 21:40 ` Javier Martinez Canillas
2016-06-17 7:11 ` Hans Verkuil
2016-06-17 7:11 ` Hans Verkuil
2016-06-29 19:43 ` Shuah Khan
2016-06-29 19:43 ` Shuah Khan
2016-06-16 21:40 ` [PATCH 2/6] [media] s5p-mfc: improve v4l2_capability driver and card fields Javier Martinez Canillas
2016-06-16 21:40 ` Javier Martinez Canillas
2016-06-17 7:12 ` Hans Verkuil
2016-06-17 7:12 ` Hans Verkuil
2016-06-29 19:45 ` Shuah Khan
2016-06-29 19:45 ` Shuah Khan
2016-06-16 21:40 ` [PATCH 3/6] [media] s5p-jpeg: set capablity bus_info as required by VIDIOC_QUERYCAP Javier Martinez Canillas
2016-06-16 21:40 ` Javier Martinez Canillas
2016-06-17 6:45 ` Jacek Anaszewski
2016-06-17 6:45 ` Jacek Anaszewski
2016-06-17 7:12 ` Hans Verkuil
2016-06-17 7:12 ` Hans Verkuil
2016-06-29 19:46 ` Shuah Khan
2016-06-29 19:46 ` Shuah Khan
2016-06-16 21:40 ` [PATCH 4/6] [media] s5p-jpeg: only fill driver's name in capabilities driver field Javier Martinez Canillas
2016-06-16 21:40 ` Javier Martinez Canillas
2016-06-17 6:45 ` Jacek Anaszewski [this message]
2016-06-17 6:45 ` Jacek Anaszewski
2016-06-17 7:13 ` Hans Verkuil
2016-06-17 7:13 ` Hans Verkuil
2016-06-29 19:47 ` Shuah Khan
2016-06-29 19:47 ` Shuah Khan
2016-06-16 21:40 ` [PATCH 5/6] [media] gsc-m2m: add device name sufix to bus_info capatiliby field Javier Martinez Canillas
2016-06-16 21:40 ` Javier Martinez Canillas
2016-06-17 7:13 ` Hans Verkuil
2016-06-17 7:13 ` Hans Verkuil
2016-06-16 21:40 ` [PATCH 6/6] [media] gsc-m2m: improve v4l2_capability driver and card fields Javier Martinez Canillas
2016-06-16 21:40 ` Javier Martinez Canillas
2016-06-17 7:13 ` Hans Verkuil
2016-06-17 7:13 ` 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=57639C7D.2030706@samsung.com \
--to=j.anaszewski@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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 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.