lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <PN3P287MB182902DE83B03F13D23CE9578BC5A@PN3P287MB1829.INDP287.PROD.OUTLOOK.COM>
Date: Wed, 5 Nov 2025 05:53:30 +0000
From: Tarang Raval <tarang.raval@...iconsignals.io>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, Sakari Ailus
	<sakari.ailus@...ux.intel.com>, Matthias Fend <matthias.fend@...end.at>
CC: Mauro Carvalho Chehab <mchehab@...nel.org>, Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
	Hans Verkuil <hverkuil@...nel.org>, Hans de Goede <hansg@...nel.org>, Ricardo
 Ribalda <ribalda@...omium.org>, André Apitzsch
	<git@...tzsch.eu>, Benjamin Mugnier <benjamin.mugnier@...s.st.com>, Sylvain
 Petinot <sylvain.petinot@...s.st.com>, Dongcheng Yan
	<dongcheng.yan@...el.com>, Bryan O'Donoghue <bryan.odonoghue@...aro.org>,
	Alan Stern <stern@...land.harvard.edu>, Jingjing Xiong
	<jingjing.xiong@...el.com>, Heimir Thor Sverrisson
	<heimir.sverrisson@...il.com>, Mehdi Djait <mehdi.djait@...ux.intel.com>,
	Vladimir Zapolskiy <vladimir.zapolskiy@...aro.org>, Laurent Pinchart
	<laurent.pinchart@...asonboard.com>, Hardevsinh Palaniya
	<hardevsinh.palaniya@...iconsignals.io>, "linux-media@...r.kernel.org"
	<linux-media@...r.kernel.org>, "devicetree@...r.kernel.org"
	<devicetree@...r.kernel.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, Hao Yao <hao.yao@...el.com>,
	"bsp-development.geo@...ca-geosystems.com"
	<bsp-development.geo@...ca-geosystems.com>
Subject: Re: [PATCH v5 2/2] media: i2c: add Himax HM1246 image sensor driver

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, but keeps the helper type-safe and future-proof against 
possible changes in the V4L2 API. This also maintains consistency with 
other upstream drivers and avoids subtle warnings if any of the subdev 
Callbacks later become const-qualified.

But yes, I guess Sakari can give you a better answer.

Best Regards,
Tarang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ