diff options
author | Laurent Pinchart <[email protected]> | 2024-05-09 00:40:43 +0300 |
---|---|---|
committer | Hans Verkuil <[email protected]> | 2024-06-04 08:31:25 +0200 |
commit | 85af84852f115d3c9d4b45b0500315e630baa82c (patch) | |
tree | de5f903cceb731ca2172285291f62f326ad34589 /tools/perf/scripts/python | |
parent | e73412fdeb541e777b3fd50b665781c1856422b5 (diff) |
media: v4l2-subdev: Provide const-aware subdev state accessors
It would be useful to mark instances of v4l2_subdev_state structures as
const when code needs to access them read-only. This isn't currently
possible, as the v4l2_subdev_state_get_*() accessor functions take a
non-const pointer to the state.
Use _Generic() to provide two different versions of the accessors, for
const and non-const states respectively. The former returns a const
pointer to the requested format, rectangle or interval, implementing
const-correctness. The latter returns a non-const pointer, preserving
the current behaviour for drivers.
Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Sakari Ailus <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
[Sakari Ailus: Drop the word "below" from the text.]
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions