public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Tarang Raval <tarang.raval@siliconsignals.io>
Cc: "Sakari Ailus" <sakari.ailus@linux.intel.com>,
	"Matthias Fend" <matthias.fend@emfend.at>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Hans Verkuil" <hverkuil@kernel.org>,
	"Hans de Goede" <hansg@kernel.org>,
	"Ricardo Ribalda" <ribalda@chromium.org>,
	"André Apitzsch" <git@apitzsch.eu>,
	"Benjamin Mugnier" <benjamin.mugnier@foss.st.com>,
	"Sylvain Petinot" <sylvain.petinot@foss.st.com>,
	"Dongcheng Yan" <dongcheng.yan@intel.com>,
	"Bryan O'Donoghue" <bryan.odonoghue@linaro.org>,
	"Alan Stern" <stern@rowland.harvard.edu>,
	"Jingjing Xiong" <jingjing.xiong@intel.com>,
	"Heimir Thor Sverrisson" <heimir.sverrisson@gmail.com>,
	"Mehdi Djait" <mehdi.djait@linux.intel.com>,
	"Vladimir Zapolskiy" <vladimir.zapolskiy@linaro.org>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
	"Hardevsinh Palaniya" <hardevsinh.palaniya@siliconsignals.io>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Hao Yao" <hao.yao@intel.com>,
	"bsp-development.geo@leica-geosystems.com"
	<bsp-development.geo@leica-geosystems.com>
Subject: Re: [PATCH v5 2/2] media: i2c: add Himax HM1246 image sensor driver
Date: Wed, 5 Nov 2025 08:47:27 +0200	[thread overview]
Message-ID: <aQry_1Q9-QsSnNa4@smile.fi.intel.com> (raw)
In-Reply-To: <PN3P287MB182902DE83B03F13D23CE9578BC5A@PN3P287MB1829.INDP287.PROD.OUTLOOK.COM>

On Wed, Nov 05, 2025 at 05:53:30AM +0000, Tarang Raval wrote:

...

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

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



-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2025-11-05  6:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-04 10:31 [PATCH v5 0/2] media: add Himax HM1246 image sensor Matthias Fend
2025-11-04 10:31 ` [PATCH v5 1/2] media: dt-bindings: i2c: " Matthias Fend
2025-11-04 10:31 ` [PATCH v5 2/2] media: i2c: add Himax HM1246 image sensor driver Matthias Fend
2025-11-04 13:28   ` Andy Shevchenko
2025-11-05  5:53     ` Tarang Raval
2025-11-05  6:47       ` Andy Shevchenko [this message]
2025-11-05  7:17         ` Tarang Raval
2025-11-05 16:59     ` Matthias Fend
2025-11-05 17:56       ` Andy Shevchenko
2025-11-11 12:23     ` Sakari Ailus
2025-11-12 10:33       ` Matthias Fend
2025-11-11 11:22   ` Sakari Ailus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aQry_1Q9-QsSnNa4@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=benjamin.mugnier@foss.st.com \
    --cc=bryan.odonoghue@linaro.org \
    --cc=bsp-development.geo@leica-geosystems.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dongcheng.yan@intel.com \
    --cc=git@apitzsch.eu \
    --cc=hansg@kernel.org \
    --cc=hao.yao@intel.com \
    --cc=hardevsinh.palaniya@siliconsignals.io \
    --cc=heimir.sverrisson@gmail.com \
    --cc=hverkuil@kernel.org \
    --cc=jingjing.xiong@intel.com \
    --cc=krzk+dt@kernel.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=matthias.fend@emfend.at \
    --cc=mchehab@kernel.org \
    --cc=mehdi.djait@linux.intel.com \
    --cc=ribalda@chromium.org \
    --cc=robh@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=stern@rowland.harvard.edu \
    --cc=sylvain.petinot@foss.st.com \
    --cc=tarang.raval@siliconsignals.io \
    --cc=vladimir.zapolskiy@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox