Re: [PATCH v5 2/2] media: i2c: add Himax HM1246 image sensor driver
From: Tarang Raval
Date: Wed Nov 05 2025 - 02:17:59 EST
Hi Andy,
> > > > +static inline struct hm1246 *to_hm1246(struct v4l2_subdev *sd)
>
> > > > + return container_of_const(sd, struct hm1246, sd);
> > >
> > > It's unclear and confusing that _const() variant is used here.
> > > Either const qualifier is missed somewhere, or _const is redundant.
> >
> > The use of container_of_const() here is intentional and follows the direction
> > taken across multiple recent sensor drivers suggested by Sakari.
> > (e.g. ov2735, vd56g3, vd55g1, ov64a40, imx283).
> >
> > AFAIK, using container_of_const() is a no-op for non-const
> > arguments,
>
> I believe you want to say that it has no additional effect on the result or so.
> Because it may not be a no-op, otherwise code won't work as expected.
Yes, that's what I meant.
Best Regards,
Tarang