Linux Media Controller development
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org, "Keke Li" <keke.li@amlogic.com>,
	"Hans Verkuil" <hverkuil@kernel.org>,
	"Nicolas Dufresne" <nicolas.dufresne@collabora.com>,
	"Tomi Valkeinen" <tomi.valkeinen@ideasonboard.com>,
	"Jonas Karlman" <jonas@kwiboo.se>,
	"Mehdi Djait" <mehdi.djait@linux.intel.com>,
	"Daniel Scally" <dan.scally+renesas@ideasonboard.com>,
	"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Subject: Re: [PATCH v2 0/3] Drop control handler argument support for v4l2_get_link_freq()
Date: Thu, 21 Aug 2025 16:30:52 +0300	[thread overview]
Message-ID: <aKcfjNOvUqlSJ_IH@kekkonen.localdomain> (raw)
In-Reply-To: <20250821132709.GA1484@pendragon.ideasonboard.com>

Hi Laurent,

On Thu, Aug 21, 2025 at 04:27:09PM +0300, Laurent Pinchart wrote:
> On Thu, Aug 21, 2025 at 04:24:04PM +0300, Sakari Ailus wrote:
> > On Thu, Aug 21, 2025 at 04:01:25PM +0300, Laurent Pinchart wrote:
> > > On Thu, Aug 21, 2025 at 03:56:20PM +0300, Sakari Ailus wrote:
> > > > On Thu, Aug 21, 2025 at 03:41:48PM +0300, Laurent Pinchart wrote:
> > > > > On Thu, Aug 21, 2025 at 03:12:04PM +0300, Sakari Ailus wrote:
> > > > > > Hi folks,
> > > > > > 
> > > > > > This set removes the workaround from v4l2_get_link_freq() that allowed
> > > > > > calling it on a control handler. The Amlogic c3-mipi-csi2 driver is
> > > > > > converted in the process as well.
> > > > > > 
> > > > > > As a result there's also no definition of v4l2_get_link_freq() without
> > > > > > CONFIG_MEDIA_CONTROLLER but that should be fine now. The Amlogic patch is
> > > > > > untested.
> > > > > 
> > > > > Could you please cherry-pick
> > > > > https://lore.kernel.org/linux-media/20250821000944.27849-2-laurent.pinchart@ideasonboard.com/
> > > > > and include it in this series ?
> > > > 
> > > > If a pad is const, I'd expect the container sub-device would be, too. I'll
> > > > see if anything breaks if media_entity_to_v4l2_subdev() would switch to use
> > > > container_of_const().
> > > 
> > > pad->entity will still not be const, so media_entity_to_v4l2_subdev()
> > > will return a non-const pointer anyway.
> > 
> > It may be technically correct but const suggests the argument (and what is
> > referred from that) is const henceforth, but that's not the case.
> 
> Yes, and that's why I'm adding a const here. The function retrieves the
> link frequency, it should not change the state of the pad, entity or
> subdev. That's the meaning conveyed by the API change. Internally, due
> to the nature of the C language, we go from a const struct media_pad to
> a non-const sturct media_entity. That's fine, it's inside the
> v4l2_get_link_freq() function, and it means the function must simply be
> careful not to break the API contract. It doesn't change the nature of
> the contract.

I'd like to have a third opinion here. Hans?

> 
> > I simply wouldn't change this. 
> 

-- 
Regards,

Sakari Ailus

  reply	other threads:[~2025-08-21 13:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-21 12:12 [PATCH v2 0/3] Drop control handler argument support for v4l2_get_link_freq() Sakari Ailus
2025-08-21 12:12 ` [PATCH v3 1/3] media: amlogic: c3-mipi-csi2: Call v4l2_get_link_freq() on source pad Sakari Ailus
2025-08-21 12:12 ` [PATCH v3 2/3] media: v4l2-common: Drop the workaround from v4l2_get_link_freq() Sakari Ailus
2025-08-21 12:35   ` Laurent Pinchart
2025-08-21 12:12 ` [PATCH v3 3/3] media: v4l2-common: Update v4l2_get_link_freq() documentation Sakari Ailus
2025-08-21 12:40   ` Laurent Pinchart
2025-08-21 12:57     ` Sakari Ailus
2025-08-21 12:41 ` [PATCH v2 0/3] Drop control handler argument support for v4l2_get_link_freq() Laurent Pinchart
2025-08-21 12:56   ` Sakari Ailus
2025-08-21 13:01     ` Laurent Pinchart
2025-08-21 13:24       ` Sakari Ailus
2025-08-21 13:27         ` Laurent Pinchart
2025-08-21 13:30           ` Sakari Ailus [this message]
2025-08-21 13:45             ` Laurent Pinchart
2025-08-22 10:03               ` Hans Verkuil

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=aKcfjNOvUqlSJ_IH@kekkonen.localdomain \
    --to=sakari.ailus@linux.intel.com \
    --cc=dan.scally+renesas@ideasonboard.com \
    --cc=hverkuil@kernel.org \
    --cc=jonas@kwiboo.se \
    --cc=keke.li@amlogic.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mehdi.djait@linux.intel.com \
    --cc=nicolas.dufresne@collabora.com \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=tomi.valkeinen@ideasonboard.com \
    /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