From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Hans Verkuil <hansverk@cisco.com>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>,
Hans Verkuil <hverkuil@xs4all.nl>,
linux-media@vger.kernel.org,
Prabhakar Lad <prabhakar.csengg@gmail.com>,
Philipp Zabel <p.zabel@pengutronix.de>
Subject: Re: [PATCH 1/2] v4l2 subdevs: replace get/set_crop by get/set_selection
Date: Wed, 03 Dec 2014 15:07 +0200 [thread overview]
Message-ID: <4935990.RSvd8chebE@avalon> (raw)
In-Reply-To: <547EF165.9030409@cisco.com>
Hi Hans,
On Wednesday 03 December 2014 12:17:57 Hans Verkuil wrote:
> On 12/03/14 12:14, Sylwester Nawrocki wrote:
> > On 02/12/14 13:21, Hans Verkuil wrote:
> >> -static int s5k6aa_set_crop(struct v4l2_subdev *sd, struct v4l2_subdev_fh
> >> *fh,
> >> - struct v4l2_subdev_crop *crop)
> >> +static int s5k6aa_set_selection(struct v4l2_subdev *sd,
> >> + struct v4l2_subdev_fh *fh,
> >> + struct v4l2_subdev_selection *sel)
> >> {
> >> struct s5k6aa *s5k6aa = to_s5k6aa(sd);
> >> struct v4l2_mbus_framefmt *mf;
> >> unsigned int max_x, max_y;
> >> struct v4l2_rect *crop_r;
> >>
> >> + if (sel->pad || sel->target != V4L2_SEL_TGT_CROP)
> >> + return -EINVAL;
> >> +
> >
> > Isn't checking sel->pad redundant here ? There is already the pad index
> > validation in check_selection() in v4l2-subdev.c and this driver has only
> > one pad.
>
> If it is called from a bridge driver, then it hasn't gone through
> check_selection().
>
> That said, if it is called from a bridge driver, then one might expect
> correct usage of pad.
>
> Laurent, do you have an opinion on this?
I would expect the pad to be valid when called from a bridge driver. We could
double-check that in subdev drivers as a debugging help, but I'm not sure if
it's worth it.
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2014-12-03 13:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-02 12:21 [PATCH 1/2] v4l2 subdevs: replace get/set_crop by get/set_selection Hans Verkuil
2014-12-02 12:21 ` [PATCH 2/2] v4l2-subdev: drop get/set_crop pad ops Hans Verkuil
2014-12-02 12:33 ` Laurent Pinchart
2014-12-02 12:44 ` [PATCH 1/2] v4l2 subdevs: replace get/set_crop by get/set_selection Laurent Pinchart
2014-12-03 0:50 ` Prabhakar Lad
2014-12-03 11:06 ` Sakari Ailus
2014-12-03 14:04 ` Hans Verkuil
2014-12-08 0:17 ` Laurent Pinchart
2014-12-08 1:27 ` Sakari Ailus
2014-12-03 11:14 ` Sylwester Nawrocki
2014-12-03 11:17 ` Hans Verkuil
2014-12-03 11:49 ` Sylwester Nawrocki
2014-12-03 12:37 ` Hans Verkuil
2014-12-03 13:07 ` Laurent Pinchart [this message]
2014-12-03 11:19 ` Sakari Ailus
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=4935990.RSvd8chebE@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=hansverk@cisco.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=prabhakar.csengg@gmail.com \
--cc=s.nawrocki@samsung.com \
/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).