Skip to contentSkip to conversation

media: mc: Rename pad as origin in __media_pipeline_start()

PATCH Superseded Sakari Ailus 2 participants 2 messages Oct 31, 2024 – Nov 3, 2024

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Sakari Ailus

author maintainer
#0 lore raw

PATCH 1/1 media: mc: Rename pad as origin in __media_pipeline_start()

Rename the pad field in __media_pipeline_start() to both better describe what it is and avoid masking it during the loop.

---
 drivers/media/mc/mc-entity.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/media/mc/mc-entity.c +4 -4
index 96dd0f6ccd0d..0df9fc90cf33 100644
@@ -768,10 +768,10 @@ static int media_pipeline_populate(struct media_pipeline *pipe,
 	return ret;
 }
 
-__must_check int __media_pipeline_start(struct media_pad *pad,
+__must_check int __media_pipeline_start(struct media_pad *origin,
 					struct media_pipeline *pipe)
 {
-	struct media_device *mdev = pad->graph_obj.mdev;
+	struct media_device *mdev = origin->graph_obj.mdev;
 	struct media_pipeline_pad *err_ppad;
 	struct media_pipeline_pad *ppad;
 	int ret;
@@ -782,7 +782,7 @@ __must_check int __media_pipeline_start(struct media_pad *pad,
 	 * If the pad is already part of a pipeline, that pipeline must be the
 	 * same as the pipe given to media_pipeline_start().
 	 */
-	if (WARN_ON(pad->pipe && pad->pipe != pipe))
+	if (WARN_ON(origin->pipe && origin->pipe != pipe))
 		return -EINVAL;
 
 	/*
@@ -799,7 +799,7 @@ __must_check int __media_pipeline_start(struct media_pad *pad,
 	 * with media_pipeline_pad instances for each pad found during graph
 	 * walk.
 	 */
-	ret = media_pipeline_populate(pipe, pad);
+	ret = media_pipeline_populate(pipe, origin);
 	if (ret)
 		return ret;
 
Signature · 1 line
2.39.5
maintainer Reviewed-by on v1 1/1
#1 lore raw

Hi Sakari,

Thank you for the patch.

Quoted 13 lines · Sakari Ailus

Rename the pad field in __media_pipeline_start() to both better describe what it is and avoid masking it during the loop.

---
 drivers/media/mc/mc-entity.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/media/mc/mc-entity.c +0 -0
index 96dd0f6ccd0d..0df9fc90cf33 100644

drivers/media/mc/mc-entity.c static int media_pipeline_populate(struct media_pipeline *pipe, · line 772

Quoted 6 lines
drivers/media/mc/mc-entity.c +1 -1
@@ -768,10 +768,10 @@ static int media_pipeline_populate(struct media_pipeline *pipe,
 	return ret;
 }
 
-__must_check int __media_pipeline_start(struct media_pad *pad,
+__must_check int __media_pipeline_start(struct media_pad *origin,
 					struct media_pipeline *pipe)

You need to also update the documentation in
include/media/media-entity.h. With that fixed,

I believe the media CI builds the documentation, did it fail to catch the issue ?

Quoted 24 lines
drivers/media/mc/mc-entity.c +3 -3
 {
-	struct media_device *mdev = pad->graph_obj.mdev;
+	struct media_device *mdev = origin->graph_obj.mdev;
 	struct media_pipeline_pad *err_ppad;
 	struct media_pipeline_pad *ppad;
 	int ret;
@@ -782,7 +782,7 @@ __must_check int __media_pipeline_start(struct media_pad *pad,
 	 * If the pad is already part of a pipeline, that pipeline must be the
 	 * same as the pipe given to media_pipeline_start().
 	 */
-	if (WARN_ON(pad->pipe && pad->pipe != pipe))
+	if (WARN_ON(origin->pipe && origin->pipe != pipe))
 		return -EINVAL;
 
 	/*
@@ -799,7 +799,7 @@ __must_check int __media_pipeline_start(struct media_pad *pad,
 	 * with media_pipeline_pad instances for each pad found during graph
 	 * walk.
 	 */
-	ret = media_pipeline_populate(pipe, pad);
+	ret = media_pipeline_populate(pipe, origin);
 	if (ret)
 		return ret;
 
Signature · 3 lines
Regards,

Laurent Pinchart