[{"id":22245,"web_url":"https://patchwork.libcamera.org/comment/22245/","msgid":"<248fbfea-2d71-bd87-33c6-7569537dfc15@gmail.com>","date":"2022-03-09T15:42:22","subject":"Re: [libcamera-devel] [PATCH v3 1/5] media: entity: Skip non-data\n\tlinks in graph iteration","submitter":{"id":97,"url":"https://patchwork.libcamera.org/api/people/97/","name":"Nicolas Dufresne via libcamera-devel","email":"libcamera-devel@lists.libcamera.org"},"content":"Hi !\n\nThanks for the patch !\n\nOn 02/03/2022 23:03, Daniel Scally wrote:\n> When iterating over the media graph, don't follow links that are not\n> data links.\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Signed-off-by: Daniel Scally <djrscally@gmail.com>\n\nReviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n\n> ---\n> \n> Changes since v2:\n> \n> \t- None\n> \n> Changes since v1:\n> \n> \t- Moved to the head of the series\n> \t- s/pad-to-pad/data (Sakari)\n> \t- Dropped the debug message (Laurent)\n> \n> Changes since the rfc:\n> \n> \t- new patch\n> \n>   drivers/media/mc/mc-entity.c | 6 ++++++\n>   1 file changed, 6 insertions(+)\n> \n> diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c\n> index b411f9796191..d0563ee4b28b 100644\n> --- a/drivers/media/mc/mc-entity.c\n> +++ b/drivers/media/mc/mc-entity.c\n> @@ -295,6 +295,12 @@ static void media_graph_walk_iter(struct media_graph *graph)\n>   \n>   \tlink = list_entry(link_top(graph), typeof(*link), list);\n>   \n> +\t/* If the link is not a data link, don't follow it */\n> +\tif ((link->flags & MEDIA_LNK_FL_LINK_TYPE) != MEDIA_LNK_FL_DATA_LINK) {\n> +\t\tlink_top(graph) = link_top(graph)->next;\n> +\t\treturn;\n> +\t}\n> +\n>   \t/* The link is not enabled so we do not follow. */\n>   \tif (!(link->flags & MEDIA_LNK_FL_ENABLED)) {\n>   \t\tlink_top(graph) = link_top(graph)->next;","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id E893FBE08A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  9 Mar 2022 15:42:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 665336118B;\n\tWed,  9 Mar 2022 16:42:26 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A8F5060475\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  9 Mar 2022 16:42:25 +0100 (CET)","from [IPV6:2a01:e0a:169:7140:3734:287e:1a7f:9772] (unknown\n\t[IPv6:2a01:e0a:169:7140:3734:287e:1a7f:9772])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id F1BFA8C4;\n\tWed,  9 Mar 2022 16:42:24 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1646840546;\n\tbh=y8YU8wU7dAeFR+DpQiOmdElGp/v8FyLD42R9djdRE6c=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=kEvFcH4VGpQn09sFgm4SNbdMz912k0DyBMspwreVcyVvF0LpdLSEP3V5/rKDyyUZI\n\tKpTHtxL6kz3P0XS5D+9KAEKm3EZ7AbrPolWPObtefr+DwiZF7WkGBGaGaNuZVb0VX6\n\tCRXY2Bctwxi4ZcQ2LBG9mMI9K21hofshJGD/y3voaR8xGQhAQnR3dLTbuwO+TbxVQR\n\tQ5W22EPbgGiOe0my9TnkFP2W3+m+qIWSOjjOZ1DEp8hUasnhzNkksWnG7GfwKiA/dB\n\twfRGCElDJR/WcOmql8Yo7EPcnTiS4oA7si5HTeHmpGp/2qRJ2dGcyCR0sG2wAxa1uU\n\talafuCS8qfgOA==","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\n\tThunderbird/91.5.0","Content-Language":"en-US","To":"Daniel Scally <djrscally@gmail.com>, linux-media@vger.kernel.org,\n\tlibcamera-devel@lists.libcamera.org","References":"<20220302220304.1327896-1-djrscally@gmail.com>\n\t<20220302220304.1327896-2-djrscally@gmail.com>","In-Reply-To":"<20220302220304.1327896-2-djrscally@gmail.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v3 1/5] media: entity: Skip non-data\n\tlinks in graph iteration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Jean-Michel Hautbois via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Jean-Michel Hautbois <jeanmichel.hautbois@gmail.com>","Cc":"sakari.ailus@linux.intel.com","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]