From patchwork Tue Jan 16 08:42:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 763519 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9EF65125B7 for ; Tue, 16 Jan 2024 08:42:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="jJ4u1BvS" Received: from pendragon.ideasonboard.com (89-27-53-110.bb.dnainternet.fi [89.27.53.110]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 04DF822DD; Tue, 16 Jan 2024 09:41:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1705394495; bh=p2EOdPLaQPnEOQE+Ys3XsdsuuzbeOl7KpEvbUfX2bFo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jJ4u1BvS6xQ7PoxkxC/VEtvOYMPZ/I4nGB3uuarqkn2RTWb23R+kMuxxf8AuA52m1 iAYhfEwcMl/CzHY3mqW4BiJ+XM2nEE3UbwW9LlpzEdi1C3dvXqYtw2jOvAeNZ+CljS w7oZDSspbCffsj/eBlZrWkwFwmWhLin54x6Vo9xE= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: Alexander Shiyan , Fabio Estevam , Frieder Schrempf , Jacopo Mondi , Kieran Bingham , Marek Vasut , Martin Kepplinger , Rui Miguel Silva , Sakari Ailus , Tim Harvey , Purism Kernel Team Subject: [PATCH v2 5/7] media: mc: Rename pad variable to clarify intent Date: Tue, 16 Jan 2024 10:42:38 +0200 Message-ID: <20240116084240.14228-6-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240116084240.14228-1-laurent.pinchart@ideasonboard.com> References: <20240116084240.14228-1-laurent.pinchart@ideasonboard.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The pad local variable in the media_pipeline_explore_next_link() function is used to store the pad through which the entity has been reached. Rename it to origin to reflect that and make the code easier to read. This will be even more important in subsequent commits when expanding the function with additional logic. Signed-off-by: Laurent Pinchart Acked-by: Sakari Ailus --- drivers/media/mc/mc-entity.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c index c2d8f59b62c1..5907925ffd89 100644 --- a/drivers/media/mc/mc-entity.c +++ b/drivers/media/mc/mc-entity.c @@ -605,13 +605,13 @@ static int media_pipeline_explore_next_link(struct media_pipeline *pipe, struct media_pipeline_walk *walk) { struct media_pipeline_walk_entry *entry = media_pipeline_walk_top(walk); - struct media_pad *pad; + struct media_pad *origin; struct media_link *link; struct media_pad *local; struct media_pad *remote; int ret; - pad = entry->pad; + origin = entry->pad; link = list_entry(entry->links, typeof(*link), list); media_pipeline_walk_pop(walk); @@ -621,7 +621,7 @@ static int media_pipeline_explore_next_link(struct media_pipeline *pipe, link->sink->entity->name, link->sink->index); /* Get the local pad and remote pad. */ - if (link->source->entity == pad->entity) { + if (link->source->entity == origin->entity) { local = link->source; remote = link->sink; } else { @@ -633,8 +633,9 @@ static int media_pipeline_explore_next_link(struct media_pipeline *pipe, * Skip links that originate from a different pad than the incoming pad * that is not connected internally in the entity to the incoming pad. */ - if (pad != local && - !media_entity_has_pad_interdep(pad->entity, pad->index, local->index)) { + if (origin != local && + !media_entity_has_pad_interdep(origin->entity, origin->index, + local->index)) { dev_dbg(walk->mdev->dev, "media pipeline: skipping link (no route)\n"); return 0;