Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05B31C433EF for ; Wed, 9 Mar 2022 15:42:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232134AbiCIPn0 (ORCPT ); Wed, 9 Mar 2022 10:43:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231190AbiCIPnZ (ORCPT ); Wed, 9 Mar 2022 10:43:25 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A051239153 for ; Wed, 9 Mar 2022 07:42:26 -0800 (PST) Received: from [IPV6:2a01:e0a:169:7140:3734:287e:1a7f:9772] (unknown [IPv6:2a01:e0a:169:7140:3734:287e:1a7f:9772]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id F1BFA8C4; Wed, 9 Mar 2022 16:42:24 +0100 (CET) Message-ID: <248fbfea-2d71-bd87-33c6-7569537dfc15@gmail.com> Date: Wed, 9 Mar 2022 16:42:22 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v3 1/5] media: entity: Skip non-data links in graph iteration Content-Language: en-US To: Daniel Scally , linux-media@vger.kernel.org, libcamera-devel@lists.libcamera.org Cc: sakari.ailus@linux.intel.com, laurent.pinchart@ideasonboard.com, hanlinchen@chromium.org, tfiga@chromium.org, hdegoede@redhat.com, kieran.bingham@ideasonboard.com, hpa@redhat.com References: <20220302220304.1327896-1-djrscally@gmail.com> <20220302220304.1327896-2-djrscally@gmail.com> From: Jean-Michel Hautbois In-Reply-To: <20220302220304.1327896-2-djrscally@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Hi ! Thanks for the patch ! On 02/03/2022 23:03, Daniel Scally wrote: > When iterating over the media graph, don't follow links that are not > data links. > > Reviewed-by: Laurent Pinchart > Signed-off-by: Daniel Scally Reviewed-by: Jean-Michel Hautbois > --- > > Changes since v2: > > - None > > Changes since v1: > > - Moved to the head of the series > - s/pad-to-pad/data (Sakari) > - Dropped the debug message (Laurent) > > Changes since the rfc: > > - new patch > > drivers/media/mc/mc-entity.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c > index b411f9796191..d0563ee4b28b 100644 > --- a/drivers/media/mc/mc-entity.c > +++ b/drivers/media/mc/mc-entity.c > @@ -295,6 +295,12 @@ static void media_graph_walk_iter(struct media_graph *graph) > > link = list_entry(link_top(graph), typeof(*link), list); > > + /* If the link is not a data link, don't follow it */ > + if ((link->flags & MEDIA_LNK_FL_LINK_TYPE) != MEDIA_LNK_FL_DATA_LINK) { > + link_top(graph) = link_top(graph)->next; > + return; > + } > + > /* The link is not enabled so we do not follow. */ > if (!(link->flags & MEDIA_LNK_FL_ENABLED)) { > link_top(graph) = link_top(graph)->next;