From patchwork Wed Mar 2 22:03:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scally X-Patchwork-Id: 15398 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 87BFEBE08A for ; Wed, 2 Mar 2022 22:03:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3D20861174; Wed, 2 Mar 2022 23:03:18 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="I44u/jpu"; dkim-atps=neutral Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3F18E601F5 for ; Wed, 2 Mar 2022 23:03:15 +0100 (CET) Received: by mail-wr1-x42e.google.com with SMTP id d3so4936943wrf.1 for ; Wed, 02 Mar 2022 14:03:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GHoWxwMyzuEiKYiB4tkgakdxydoJTJ1L6memTFq7bQY=; b=I44u/jpupuxrSxPrnEOPh8ns21kZ9UZQ5Fy9vLxB5XxM26XnG7gCk9Po5De1VeBfzg wwoMS+uggL+SJNdR6GpwRq7Fbi84IL5WvMmiy+GOtXm+wSv0no3NgVW0IaHRkxtfFvVP 09ghhpiXSRds8U3eggpxbNFELwL1WDBp+b+s6hn0nm2gdHI9bTkMjEurS8Yv5om98+P7 ReQJHjxcJtOYb9LxF2W2GUx7VfadwUsG7MdbaobofDz+cdiDf+VV8dxdA9sr7ayNuZv4 LSB2y+6F6/He+jHNn5aLkD9kHzwjl1hCxfsZQh3cBuVV+c/5t6SDsBzMWdsi0EsNwANA rBHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GHoWxwMyzuEiKYiB4tkgakdxydoJTJ1L6memTFq7bQY=; b=ucxmL0EkfEj+9uf92KuwWcG+jb2PE+pEpFp3g9MrFPNpxVXeczz+QSevCUuzKhHDfZ ei4UuFcqywMjqf0nDXnHMPcxino6kslAW1xBGQ3cHvhoDcPgVTXLjMb3cI5cTMRVvHZv eaiMM7U0GtXj7yvWlRVCuU8AkJP3zyGreItRFFoMwJWgJyo/kAgbsLKBQeqb67OGPpgc 3GtCIRfTvNt4+ErPoCpDCyVrKOzYLgb4IRFAU+XqpdUc4KCzI2ZEFUOv7MphS1t0wMqO WmdSSlAmB8B7fJ8t96bd4zrUVHIkydOSzPTMSdTLjiLCIgAJiHqn6sUJq+5b3Oo7H/MR 8qcQ== X-Gm-Message-State: AOAM532tgbymhucBLSxsiyZ2Ib2i7T7LI3DGTMHlpMbrhY2UoAuY+lTJ VZZRx9hvKubhyjHwCTgozHI= X-Google-Smtp-Source: ABdhPJxI+8FVaH+gF7/u1qQtIoi5tjku8H+S2JdkiyDFf7cktaVaYVQJuV9HhMc5hKyGUlmf9nwpKg== X-Received: by 2002:adf:d1e3:0:b0:1ea:7e17:6cff with SMTP id g3-20020adfd1e3000000b001ea7e176cffmr24545717wrd.415.1646258594962; Wed, 02 Mar 2022 14:03:14 -0800 (PST) Received: from localhost.localdomain (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net. [86.13.91.161]) by smtp.gmail.com with ESMTPSA id l16-20020a05600c4f1000b0033383cdeea1sm229258wmq.10.2022.03.02.14.03.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 14:03:14 -0800 (PST) From: Daniel Scally To: linux-media@vger.kernel.org, libcamera-devel@lists.libcamera.org Date: Wed, 2 Mar 2022 22:03:00 +0000 Message-Id: <20220302220304.1327896-2-djrscally@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220302220304.1327896-1-djrscally@gmail.com> References: <20220302220304.1327896-1-djrscally@gmail.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 1/5] media: entity: Skip non-data links in graph iteration X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sakari.ailus@linux.intel.com Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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;