Re: [PATCH v3 06/10] media: uapi: Add a macro to tell whether an mbus code is metadata

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

 



On Tue, Aug 08, 2023 at 10:14:11AM +0200, Hans Verkuil wrote:
> On 08/08/2023 09:55, Sakari Ailus wrote:
> > Add a macro to tell whether a given mbus code is metadata.
> > 
> > Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
> > ---
> >  include/uapi/linux/media-bus-format.h | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/include/uapi/linux/media-bus-format.h b/include/uapi/linux/media-bus-format.h
> > index 9ee031397372..2486b4178c5f 100644
> > --- a/include/uapi/linux/media-bus-format.h
> > +++ b/include/uapi/linux/media-bus-format.h
> > @@ -182,4 +182,7 @@
> >  #define MEDIA_BUS_FMT_META_20			0x8006
> >  #define MEDIA_BUS_FMT_META_24			0x8007
> >  
> > +#define MEDIA_BUS_FMT_IS_META(code)		\
> > +	((code) & 0xf000 == 0x7000 || (code) & 0xf000 == 0x8000)
> 
> I don't think this is right: == has a higher precedence than &, so this
> actually reads:
> 
> 	code & (0xf000 == 0x7000)

You're right, I'll fix this for v4.

-- 
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