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 0D407C7EE23 for ; Tue, 30 May 2023 02:20:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230082AbjE3CUp (ORCPT ); Mon, 29 May 2023 22:20:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229749AbjE3CUn (ORCPT ); Mon, 29 May 2023 22:20:43 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6614DF1 for ; Mon, 29 May 2023 19:20:34 -0700 (PDT) Received: from pendragon.ideasonboard.com (om126158230151.30.openmobile.ne.jp [126.158.230.151]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id F26ABE4; Tue, 30 May 2023 04:20:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1685413212; bh=Ve6LrV8WEOMyxcHHasNoLTsR98Pmz79pjBQHOn/1bOw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qNzMM5jRurbP2FawR1WU7G/pJVcq4cK9DYv0th3tinyy6Fcp/xlZcbNAMbaRZuSFr IoprsrPSVm6GbgLTm/vVAJ18p+bNZctowECtu01NnAkoeawx9h4JTCkObMkwyTe08j 5LS91/uR0zeOqbfYtU0h5ViJj6Mr/bHLYr40R4qI= Date: Tue, 30 May 2023 05:20:33 +0300 From: Laurent Pinchart To: Sakari Ailus Cc: linux-media@vger.kernel.org, Philipp Zabel , hverkuil@xs4all.nl, Francesco Dolcini , aishwarya.kothari@toradex.com, Robert Foss , Todor Tomov , Hyun Kwon , bingbu.cao@intel.com, niklas.soderlund@ragnatech.se, Kieran Bingham , Benjamin Mugnier , Sylvain Petinot , Eugen Hristev , Nicolas Ferre , Maxime Ripard , Rui Miguel Silva , Fabio Estevam , Bryan O'Donoghue , Sylwester Nawrocki , Dafna Hirschfeld , Hugues Fruchet , Yong Deng , Paul Kocialkowski , "Lad, Prabhakar" , Benoit Parrot , Steve Longerbeam , Thierry Reding , Jonathan Hunter , Sowjanya Komatineni , Marco Felsch Subject: Re: [RESEND PATCH v3 03/32] media: xilinx-vipp: Clean up bound async notifier callback Message-ID: <20230530022033.GC21633@pendragon.ideasonboard.com> References: <20230525091615.2324824-1-sakari.ailus@linux.intel.com> <20230525091615.2324824-4-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230525091615.2324824-4-sakari.ailus@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Hi Sakari, Thank you for the patch. On Thu, May 25, 2023 at 12:15:46PM +0300, Sakari Ailus wrote: > The async notifier bound callback does a lot of checks that have probably > been always unnecessary. Remove the lookup of the async subev that we > already have, as well as the debug print that is already printed by the > framework. > > Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart > --- > drivers/media/platform/xilinx/xilinx-vipp.c | 32 ++++----------------- > 1 file changed, 5 insertions(+), 27 deletions(-) > > diff --git a/drivers/media/platform/xilinx/xilinx-vipp.c b/drivers/media/platform/xilinx/xilinx-vipp.c > index 3123216b3f70e..b309af0c83749 100644 > --- a/drivers/media/platform/xilinx/xilinx-vipp.c > +++ b/drivers/media/platform/xilinx/xilinx-vipp.c > @@ -312,36 +312,14 @@ static int xvip_graph_notify_complete(struct v4l2_async_notifier *notifier) > > static int xvip_graph_notify_bound(struct v4l2_async_notifier *notifier, > struct v4l2_subdev *subdev, > - struct v4l2_async_subdev *unused) > + struct v4l2_async_subdev *asd) > { > - struct xvip_composite_device *xdev = > - container_of(notifier, struct xvip_composite_device, notifier); > - struct xvip_graph_entity *entity; > - struct v4l2_async_subdev *asd; > + struct xvip_graph_entity *entity = to_xvip_entity(asd); > > - /* Locate the entity corresponding to the bound subdev and store the > - * subdev pointer. > - */ > - list_for_each_entry(asd, &xdev->notifier.asd_list, asd_list) { > - entity = to_xvip_entity(asd); > + entity->entity = &subdev->entity; > + entity->subdev = subdev; > > - if (entity->asd.match.fwnode != subdev->fwnode) > - continue; > - > - if (entity->subdev) { > - dev_err(xdev->dev, "duplicate subdev for node %p\n", > - entity->asd.match.fwnode); > - return -EINVAL; > - } > - > - dev_dbg(xdev->dev, "subdev %s bound\n", subdev->name); > - entity->entity = &subdev->entity; > - entity->subdev = subdev; > - return 0; > - } > - > - dev_err(xdev->dev, "no entity for subdev %s\n", subdev->name); > - return -EINVAL; > + return 0; > } > > static const struct v4l2_async_notifier_operations xvip_graph_notify_ops = { -- Regards, Laurent Pinchart