On Wed, Dec 03, 2014 at 12:14:49PM +0100, Sylwester Nawrocki wrote:
> Hi Hans,
> 
> 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.

Good point. check_crop() does that for the [sg]_crop as well.

-- 
Sakari Ailus
e-mail: sakari.ai...@iki.fi     XMPP: sai...@retiisi.org.uk
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to