From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: linux-media@vger.kernel.org
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>, hans@jjverkuil.nl
Subject: [PATCH 1/3] media: v4l2-subdev: Make media_entity_to_v4l2_subdev() const-aware
Date: Thu, 2 Oct 2025 13:32:53 +0300 [thread overview]
Message-ID: <20251002103256.2081947-2-sakari.ailus@linux.intel.com> (raw)
In-Reply-To: <20251002103256.2081947-1-sakari.ailus@linux.intel.com>
Retain the constness of the object in media_entity_to_v4l2_subdev(), by
switching to container_of_const().
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
include/media/v4l2-subdev.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index e0bb58cb6d04..a37d9a847196 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -1103,7 +1103,7 @@ struct v4l2_subdev {
typeof(ent) __me_sd_ent = (ent); \
\
__me_sd_ent ? \
- container_of(__me_sd_ent, struct v4l2_subdev, entity) : \
+ container_of_const(__me_sd_ent, struct v4l2_subdev, entity) : \
NULL; \
})
--
2.47.3
next prev parent reply other threads:[~2025-10-02 10:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-02 10:32 [PATCH 0/3] Switch to container_of_const() in macros Sakari Ailus
2025-10-02 10:32 ` Sakari Ailus [this message]
2025-10-02 10:32 ` [PATCH 2/3] media: v4l2-dev: Make macros to obtain containers const-aware Sakari Ailus
2025-10-02 10:32 ` [PATCH 3/3] media: mc: " Sakari Ailus
2025-10-02 10:32 ` [PATCH 3/3] media: v4l2-dev: " Sakari Ailus
2025-10-02 10:45 ` 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=20251002103256.2081947-2-sakari.ailus@linux.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=hans@jjverkuil.nl \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.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