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]

 



Hi Hans,

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.

-- 
Sakari Ailus



[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