Re: [PATCH v10 07/17] media: mali-c55: Add Mali-C55 ISP driver

Sakari Ailus
2025-06-30T10:29:26Z

On Mon, Jun 30, 2025 at 11:35:19AM +0300, Laurent Pinchart wrote:
> > > > > +#define MALI_C55_ISP_RAW_BYPASS_FR_BYPASS_MASK GENMASK(9, 8)
> > > > > +#define MALI_C55_ISP_RAW_BYPASS_RAW_FR_BYPASS (2 << 8)
> > > > > +#define MALI_C55_ISP_RAW_BYPASS_RGB_FR_BYPASS (1 << 8)
> > > >
> > > > BIT() or make these unsigned.
> > >
> > > It's a 2 bits field, BIT() isn't appropriate.
> >
> > That leaves us with the other alternative, doesn't it?
>
> Absolutely, although unsigned is unnecessary in this case as we're not
> approaching bit 31.

I agree with that, but what I really meant was that the pattern of using
signed integers while shifting left itself is bad. Not everyone is aware
of the problem and if we can steer them to use a different pattern, we can
avoid bugs.

--
Sakari Ailus