public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] media: v4l2-subdev: Support const-awareness in state accessors
@ 2024-05-06 17:52 Laurent Pinchart
  2024-05-06 17:52 ` [PATCH 1/2] media: v4l2-subdev: Provide const-aware subdev " Laurent Pinchart
  2024-05-06 17:52 ` [PATCH 2/2] media: rkisp1: Mark subdev state pointers as const Laurent Pinchart
  0 siblings, 2 replies; 6+ messages in thread
From: Laurent Pinchart @ 2024-05-06 17:52 UTC (permalink / raw)
  To: linux-media
  Cc: linux-renesas-soc, Sakari Ailus, Tomi Valkeinen, Hans Verkuil,
	Dafna Hirschfeld, linux-rockchip

Hello,

This small patch series comes from a mild annoyance I experienced during
a recent patch review, where I wanted to ask for a pointer to a
v4l2_subdev_state used to access the state in a read-only fashion to be
made const. This wasn't possible as the state accessors functions take a
non-const state pointer, in order to return pointers to mutable formats
and selection rectangles.

Patch 1/2 improves the state accessors to support const states, in the
same wait as the recently introduced container_of_const() macro.
Bikeshedding of the internal macro and function names is expected. Patch
2/2 then shows how this can be used in one driver.

Laurent Pinchart (2):
  media: v4l2-subdev: Provide const-aware subdev state accessors
  media: rkisp1: Mark subdev state pointers as const

 .../platform/rockchip/rkisp1/rkisp1-isp.c     |  8 +--
 .../platform/rockchip/rkisp1/rkisp1-resizer.c |  8 +--
 drivers/media/v4l2-core/v4l2-subdev.c         | 24 +++----
 include/media/v4l2-subdev.h                   | 66 +++++++++++++------
 4 files changed, 65 insertions(+), 41 deletions(-)


base-commit: e695668af8523b059127dfa8b261c76e7c9cde10
-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-05-14 20:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-06 17:52 [PATCH 0/2] media: v4l2-subdev: Support const-awareness in state accessors Laurent Pinchart
2024-05-06 17:52 ` [PATCH 1/2] media: v4l2-subdev: Provide const-aware subdev " Laurent Pinchart
2024-05-06 21:53   ` Sakari Ailus
2024-05-07  6:04     ` Laurent Pinchart
2024-05-06 17:52 ` [PATCH 2/2] media: rkisp1: Mark subdev state pointers as const Laurent Pinchart
2024-05-14 20:07   ` Nicolas Dufresne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox