From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (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 79E3B3D6CC6 for ; Wed, 8 Apr 2026 15:40:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775662818; cv=none; b=s+/B6yuL0ORBN+hCRoisaT3tvI31okKdiywnPCLVaUmG2moWAb7qcTrQfXTw721lDqt8AFUOSf1MnRo7nBIXSVkIv8qDy9dvB/whRYF8V3M1VHqgugIesIi9UEdTcSr6x1yS7gMOa9SJgXFqbUUynWHBCidWHUl0Sn84+enuFW0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775662818; c=relaxed/simple; bh=48titW2d7LlKG5Rjz0xkTO+bKjDaoOWXGTHE51po78k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SQvgMLnBKS4ichcaPDhke3qcUQeyy7jLUVfdTUfZfF//63JgyXLNzwPw1IbBolQ0GRZQW05Rzo2/XH8gn6ELusOaucMnZv7k9Fkr/ojBPcchm8kzYdGERVTuFcM6o81POQ41sjGVnNlKh1TDD2PP+aAkbRBIzINO0bMkTbLk68w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=nox7arAC; arc=none smtp.client-ip=198.175.65.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="nox7arAC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1775662813; x=1807198813; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=48titW2d7LlKG5Rjz0xkTO+bKjDaoOWXGTHE51po78k=; b=nox7arAC6+2TOXIIoF+boinSilIPyM7j8g3QYJ7f4QBPGSj9h8qr35Jl WAKwh5p2XZiCrE4te9h8w2MUzr/uzftwPa2wa8ORpAhZ3L28HyjR78P1x 2wczGtc3bwzAeFuArHkEXNEmsWQQ54tpU0RVkRSM8YUqD9b65dQpsJZvT C+zKQVBAD3NbT4QDMg4hhDKaKUgNR6lqVgEIsQr2hRmjlVzb3OY0OlVdx xxR/x0PHcJvmXSZIWKBkVLvAqqaQL6Mes/30/c2U+B/L8B9La4I6zmz/w 1k8TYxN1UVG/ub5sPbSPMwPXo/DUMn9H9pjekovoIpbezFWmDbJ+/i1m1 g==; X-CSE-ConnectionGUID: Kd4m2PPJSHqocJA0/0p3oQ== X-CSE-MsgGUID: EuqkLZ3RRfabM/fOou6WCw== X-IronPort-AV: E=McAfee;i="6800,10657,11753"; a="94038437" X-IronPort-AV: E=Sophos;i="6.23,167,1770624000"; d="scan'208";a="94038437" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2026 08:40:00 -0700 X-CSE-ConnectionGUID: mx/odNuWSmOc6d5930TSlA== X-CSE-MsgGUID: LF96PbxCTvOfy1zQKQdYlA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,167,1770624000"; d="scan'208";a="223740379" Received: from hrotuna-mobl2.ger.corp.intel.com (HELO kekkonen.fi.intel.com) ([10.245.245.104]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2026 08:39:53 -0700 Received: from punajuuri.localdomain (unknown [192.168.240.130]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 285DC122034; Wed, 08 Apr 2026 18:39:51 +0300 (EEST) Received: from sailus by punajuuri.localdomain with local (Exim 4.98.2) (envelope-from ) id 1wAV0F-000000044DS-2PGY; Wed, 08 Apr 2026 18:39:39 +0300 Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo From: Sakari Ailus To: linux-media@vger.kernel.org Cc: hans@jjverkuil.nl, laurent.pinchart@ideasonboard.com, Prabhakar , Kate Hsuan , Dave Stevenson , Tommaso Merciai , Benjamin Mugnier , Sylvain Petinot , Christophe JAILLET , Julien Massot , Naushir Patuck , "Yan, Dongcheng" , "Cao, Bingbu" , "Qiu, Tian Shu" , Stefan Klug , Mirela Rabulea , =?UTF-8?q?Andr=C3=A9=20Apitzsch?= , Heimir Thor Sverrisson , Kieran Bingham , Mehdi Djait , Ricardo Ribalda Delgado , Hans de Goede , Jacopo Mondi , Tomi Valkeinen , David Plowman , "Yu, Ong Hock" , "Ng, Khai Wen" , Jai Luthra , Rishikesh Donadkar Subject: [PATCH v4 18/29] media: mc: Simplify link processing in __media_pipeline_start() Date: Wed, 8 Apr 2026 18:39:27 +0300 Message-ID: <20260408153939.969381-19-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260408153939.969381-1-sakari.ailus@linux.intel.com> References: <20260408153939.969381-1-sakari.ailus@linux.intel.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit There are two conditions checking the ENABLED link flag in the loop going through the links related to an entity. Drop the other one and simplify the remaining code. Signed-off-by: Sakari Ailus Reviewed-by: Michael Riesch --- drivers/media/mc/mc-entity.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c index 3fa0bc687851..6bf4730b89d2 100644 --- a/drivers/media/mc/mc-entity.c +++ b/drivers/media/mc/mc-entity.c @@ -838,17 +838,16 @@ __must_check int __media_pipeline_start(struct media_pad *origin, if (link->sink != pad && link->source != pad) continue; - /* Record if the pad has links and enabled links. */ - if (link->flags & MEDIA_LNK_FL_ENABLED) - has_enabled_link = true; - /* - * Validate the link if it's enabled and has the - * current pad as its sink. + * Ensure the link is enabled and if so, record + * it. Proceed to the next link if the current pad isn't + * the sink pad of the link. */ if (!(link->flags & MEDIA_LNK_FL_ENABLED)) continue; + has_enabled_link = true; + if (link->sink != pad) continue; -- 2.47.3