public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Daniel Scally <djrscally@gmail.com>
Cc: linux-media@vger.kernel.org, sakari.ailus@linux.intel.com,
	paul.elder@ideasonboard.com
Subject: Re: [PATCH 2/2] media: entity: Use dedicated data link iterator
Date: Wed, 22 Jun 2022 12:18:29 +0300	[thread overview]
Message-ID: <YrLeZbtx4WvtD1fY@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20220621163457.766496-3-djrscally@gmail.com>

Hi Dan,

Thank you for the patch.

On Tue, Jun 21, 2022 at 05:34:57PM +0100, Daniel Scally wrote:
> Where iteration over links for an entity is clearly assuming that
> all of those links are data links, use the new iterator to guarantee
> that that assumption is met.
> 
> Signed-off-by: Daniel Scally <djrscally@gmail.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/mc/mc-entity.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c
> index 11f5207f73aa..f46690fd141d 100644
> --- a/drivers/media/mc/mc-entity.c
> +++ b/drivers/media/mc/mc-entity.c
> @@ -449,7 +449,7 @@ __must_check int __media_pipeline_start(struct media_entity *entity,
>  		bitmap_zero(active, entity->num_pads);
>  		bitmap_fill(has_no_links, entity->num_pads);
>  
> -		list_for_each_entry(link, &entity->links, list) {
> +		for_each_media_entity_data_link(entity, link) {
>  			struct media_pad *pad = link->sink->entity == entity
>  						? link->sink : link->source;
>  
> @@ -888,7 +888,7 @@ media_entity_find_link(struct media_pad *source, struct media_pad *sink)
>  {
>  	struct media_link *link;
>  
> -	list_for_each_entry(link, &source->entity->links, list) {
> +	for_each_media_entity_data_link(source->entity, link) {
>  		if (link->source->entity == source->entity &&
>  		    link->source->index == source->index &&
>  		    link->sink->entity == sink->entity &&
> @@ -904,7 +904,7 @@ struct media_pad *media_entity_remote_pad(const struct media_pad *pad)
>  {
>  	struct media_link *link;
>  
> -	list_for_each_entry(link, &pad->entity->links, list) {
> +	for_each_media_entity_data_link(pad->entity, link) {
>  		if (!(link->flags & MEDIA_LNK_FL_ENABLED))
>  			continue;
>  

-- 
Regards,

Laurent Pinchart

      reply	other threads:[~2022-06-22  9:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-21 16:34 [PATCH 0/2] Add iterator for an entity's data links Daniel Scally
2022-06-21 16:34 ` [PATCH 1/2] media: media-entity.h: Add iterator for entity " Daniel Scally
2022-06-22  9:08   ` Jacopo Mondi
2022-06-22  9:17     ` Laurent Pinchart
2022-06-22  9:22       ` Jacopo Mondi
2022-06-22  9:30         ` Daniel Scally
2022-06-22  9:40     ` Daniel Scally
2022-06-22  9:16   ` Laurent Pinchart
2022-06-21 16:34 ` [PATCH 2/2] media: entity: Use dedicated data link iterator Daniel Scally
2022-06-22  9:18   ` Laurent Pinchart [this message]

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=YrLeZbtx4WvtD1fY@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=djrscally@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=paul.elder@ideasonboard.com \
    --cc=sakari.ailus@linux.intel.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