Re: [PATCH 4/7] media: v4l2: Make colorspace validity checks more future-proof

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 30, 2022 at 12:46:16PM +0300, Sakari Ailus wrote:
> On Wed, Jun 29, 2022 at 03:50:47PM +0200, Hans Verkuil wrote:
> > > @@ -585,8 +585,8 @@ static inline bool v4l2_is_hsv_enc_valid(__u8 hsv_enc)
> > >  
> > >  static inline bool v4l2_is_quant_valid(__u8 quantization)
> > >  {
> > > -	return quantization == V4L2_QUANTIZATION_FULL_RANGE ||
> > > -	       quantization == V4L2_QUANTIZATION_LIM_RANGE;
> > > +	return quantization > V4L2_QUANTIZATION_DEFAULT &&
> > > +	       quantization < V4L2_QUANTIZATION_LAST;
> > 
> > There are only two quantization ranges: full and limited. And I very sincerely
> > hope there will never be a third!
> 
> For consistency of the checks and definitions I prefer it how it's in the
> patch. There's no functional difference though.

I'm ready to send a pull request for this patch once you and Hans agree
on how this should be done :-) I also have a slight preference for
consistency. Hans, what do you think ?

-- 
Regards,

Laurent Pinchart



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux