All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	linux-media@vger.kernel.org
Cc: sadegh abbasi <sadegh612000@yahoo.co.uk>
Subject: Re: [PATCH 2/7] v4l2-ctrls: Don't initialize array tail when setting a control
Date: Thu, 22 Jan 2015 16:07:58 +0100	[thread overview]
Message-ID: <54C1124E.2020104@xs4all.nl> (raw)
In-Reply-To: <1421938126-17747-3-git-send-email-laurent.pinchart@ideasonboard.com>

On 01/22/15 15:48, Laurent Pinchart wrote:
> Setting an array control subset isn't allowed by the control framework,
> which returns an error in prepare_ext_ctrls() if the control size
> specified by userspace is smaller than the total size. There is thus no
> need to initialize the array tail to its default value, as the tail will
> always be empty.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

Regards,

	Hans

> ---
>  drivers/media/v4l2-core/v4l2-ctrls.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
> index 301abb7..adac93e 100644
> --- a/drivers/media/v4l2-core/v4l2-ctrls.c
> +++ b/drivers/media/v4l2-core/v4l2-ctrls.c
> @@ -1518,13 +1518,9 @@ static int user_to_ptr(struct v4l2_ext_control *c,
>  
>  	ctrl->is_new = 1;
>  	if (ctrl->is_ptr && !ctrl->is_string) {
> -		unsigned idx;
> -
>  		ret = copy_from_user(ptr.p, c->ptr, c->size) ? -EFAULT : 0;
>  		if (ret || !ctrl->is_array)
>  			return ret;
> -		for (idx = c->size / ctrl->elem_size; idx < ctrl->elems; idx++)
> -			ctrl->type_ops->init(ctrl, idx, ptr);
>  		return 0;
>  	}
>  
> 


  reply	other threads:[~2015-01-22 15:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-22 14:48 [PATCH 0/7] omap4iss: Add RGB2RGB blending matrix support Laurent Pinchart
2015-01-22 14:48 ` [PATCH 1/7] v4l2-ctrls: Add new S8, S16 and S32 compound control types Laurent Pinchart
2015-01-22 15:07   ` Hans Verkuil
2015-01-22 14:48 ` [PATCH 2/7] v4l2-ctrls: Don't initialize array tail when setting a control Laurent Pinchart
2015-01-22 15:07   ` Hans Verkuil [this message]
2015-01-22 14:48 ` [PATCH 3/7] v4l2-ctrls: Make the control type init op initialize the whole control Laurent Pinchart
2015-01-22 15:12   ` Hans Verkuil
2015-01-22 16:13     ` Laurent Pinchart
2015-01-22 14:48 ` [PATCH 4/7] v4l2-ctrls: Export the standard control type operations Laurent Pinchart
2015-01-22 15:13   ` Hans Verkuil
2015-01-22 14:48 ` [PATCH 5/7] Revert "[media] v4l: omap4iss: Add module debug parameter" Laurent Pinchart
2015-01-22 15:14   ` Hans Verkuil
2015-01-22 14:48 ` [PATCH 6/7] staging: media: omap4iss: Cleanup media entities after unregistration Laurent Pinchart
2015-01-22 14:48 ` [PATCH 7/7] staging: media: omap4iss: ipipe: Expose the RGB2RGB blending matrix Laurent Pinchart

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=54C1124E.2020104@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=sadegh612000@yahoo.co.uk \
    /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.