From mboxrd@z Thu Jan 1 00:00:00 1970 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 A79EB1DBB3A for ; Thu, 16 Apr 2026 14:35:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776350129; cv=none; b=QQUi9pesh1z+vk5hzcgun1Tz9BO8ar+NQCgEjEOxzvLMY79lswtkHhT68zGFZ+MS90aFS0JePaMOjBvJqCTEfo75si1XSlTDQ9jW+v97kWJDtmXa9LXf7ONxnfrfg+C6j34Wd2YIsnq1rmPcoeN9puSWkZQrEqEjRp0J3ylMIpQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776350129; c=relaxed/simple; bh=UxsXATKAGVqqJ9WrJ6GAkmJnh/uE43wH0LOgHImu6wc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MDFhVN/wxJOAAJM8DN/rKe7ROW0UwelQjMSn0oTNRwgT8G+/ZI5zGztfzDppJeRFnZ8SXDzcuEa1mgUAcKpaxT9HLw26b47cXbe6nHK7JliFVtn2Z0apCsPEWwrZcTpngDpVM+c4BGgubE5wLpv0qphds1VnA3i+0j/jQABy7+I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=Nc7wmtRe; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (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="Nc7wmtRe" Received: from killaraus.ideasonboard.com (2001-14ba-703d-e500--2a1.rev.dnainternet.fi [IPv6:2001:14ba:703d:e500::2a1]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id AEE93132; Thu, 16 Apr 2026 16:33:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1776350031; bh=UxsXATKAGVqqJ9WrJ6GAkmJnh/uE43wH0LOgHImu6wc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Nc7wmtRe+5Yggl80oRoX85E6HaRBhpYbLoVwbRjYWOa7f6gwBXLlkNP5qmVqMJjMs bahQLf8CGrvwSiVzbyvGQirqgOlwwoLS24eMnosjpa+hu6FTdVAQ8GUptq1jIBmvHx o3fx7P/rr72qDqkpx0gGYE4SNX+GccpcRTeALNO4= Date: Thu, 16 Apr 2026 17:35:24 +0300 From: Laurent Pinchart To: Sakari Ailus Cc: linux-media@vger.kernel.org, hans@jjverkuil.nl, 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?B?QW5kcsOp?= Apitzsch , 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: Re: [PATCH v4 18/29] media: mc: Simplify link processing in __media_pipeline_start() Message-ID: <20260416143524.GM1775831@killaraus.ideasonboard.com> References: <20260408153939.969381-1-sakari.ailus@linux.intel.com> <20260408153939.969381-19-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-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260408153939.969381-19-sakari.ailus@linux.intel.com> Hi Sakari, Thank you for the patch. On Wed, Apr 08, 2026 at 06:39:27PM +0300, Sakari Ailus wrote: > 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. You can reflow this; * 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. but I find the new comment confusing. I would keep the code as-is, I think it's more readable, and the compiler will deal with optimization. > */ > if (!(link->flags & MEDIA_LNK_FL_ENABLED)) > continue; > > + has_enabled_link = true; > + > if (link->sink != pad) > continue; > -- Regards, Laurent Pinchart