From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (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 6DF651EDA2B for ; Mon, 16 Feb 2026 09:02:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771232559; cv=none; b=Bf1MHH7zRUVaqlvScze6F59CqP8378KPsaeLbmVs4OPRLmbUcqgUytCSuu0ic3s4/1s8jqH/HilYWAYzFYHA3SbGIvcao+48vg/nXIgHmgAcrknJPRCLe3WgZjEvM1MpZ6Hgg4xwYvjF2eXhPweUZ/7rRz7h4rnl6BwTY62l7jY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771232559; c=relaxed/simple; bh=74rH9qbbtUNAnbsKkVjmR80MePEL/wH+oK1kpH0R+d0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uOwFByiOS+1hPHEnh57xPKXkd3QaWjX33Dr8nD67IIsJnF3fp/T3EYyZFMeoq4QLfTMFD2A9DCqJFZ0cVkVc+FSffglua8GpPE7LLzbNGaFWqx+9N6Pq7Cy/eqcdhqY9GZtodj2P/claFHcudMMc2HO8rK5G2ejASZ4dm7SDZyw= 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=dW0rbjm7; arc=none smtp.client-ip=198.175.65.13 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="dW0rbjm7" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1771232558; x=1802768558; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=74rH9qbbtUNAnbsKkVjmR80MePEL/wH+oK1kpH0R+d0=; b=dW0rbjm7KKmGxc9WaN/CKff/C1Ql0RKz5VyhYwB7RDMB+mTA8DjAKToH 7EeHeTG2zxMwzjILbffha2+TtJla1xS0q5BiWnyQpmQn+Q+nWKvq/kg2q YBidya8+rdWhhWzVkxM3eX6iotgftGY+KGdwKCFXD59vD2MNLHz6g26zW RdgAsoel8EUys80acW0IooQGENI2noOuIMHXMg3BWldn/KAXqm3MVUbb5 QoEUlPF7XPa+ok/g6TtAgBXUeW9eqUIl8jst2RdM18Ml8km+PFk56Zmlq lF9KZpaK24Zxb+R7ctYa7ASxaRum25UUpRFXVaTZRq8jhZalxUPaYgErO g==; X-CSE-ConnectionGUID: zDAYNAcESFClP4yU9q1DOw== X-CSE-MsgGUID: rAHqxEdYRqeqgL7Q8FFtVg== X-IronPort-AV: E=McAfee;i="6800,10657,11702"; a="83409136" X-IronPort-AV: E=Sophos;i="6.21,293,1763452800"; d="scan'208";a="83409136" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2026 01:02:37 -0800 X-CSE-ConnectionGUID: OH16iJRmSjSVqXua/GfFtw== X-CSE-MsgGUID: wRKnVeYUSQGhJm3zZxd9Og== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,293,1763452800"; d="scan'208";a="218098060" Received: from pgcooper-mobl3.ger.corp.intel.com (HELO kekkonen.fi.intel.com) ([10.245.244.203]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2026 01:02:31 -0800 Received: from kekkonen.localdomain (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id A916F121D2E; Mon, 16 Feb 2026 11:02:51 +0200 (EET) Date: Mon, 16 Feb 2026 11:02:51 +0200 Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo From: Sakari Ailus To: Mirela Rabulea Cc: linux-media@vger.kernel.org, hans@jjverkuil.nl, laurent.pinchart@ideasonboard.com, Prabhakar , Kate Hsuan , Alexander Shiyan , Dave Stevenson , Tommaso Merciai , Benjamin Mugnier , Sylvain Petinot , Christophe JAILLET , Julien Massot , Naushir Patuck , "Yan, Dongcheng" , "Cao, Bingbu" , "Qiu, Tian Shu" , Stefan Klug , =?iso-8859-1?Q?Andr=E9?= 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" Subject: Re: [PATCH v2 05/14] media: v4l2-subdev: Refactor returning routes Message-ID: References: <20260211090920.1851141-1-sakari.ailus@linux.intel.com> <20260211090920.1851141-6-sakari.ailus@linux.intel.com> <81e543df-a188-4c2b-a24a-b599b27b3954@nxp.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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <81e543df-a188-4c2b-a24a-b599b27b3954@nxp.com> Hi Mirela, On Sun, Feb 15, 2026 at 04:39:58PM +0200, Mirela Rabulea wrote: > Hi Sakari, > > On 2/11/26 11:09, Sakari Ailus wrote: > > Refactor returning the routes by adding a new function that essentially > > does a memcopy and sets the number of the number of the routes in the > Repetition "The number of the number" Fixed for v3. > > routing table. > > > > Signed-off-by: Sakari Ailus > > --- > > drivers/media/v4l2-core/v4l2-subdev.c | 40 +++++++++++++++------------ > > 1 file changed, 22 insertions(+), 18 deletions(-) > > > > diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c > > index b2105c34478e..8a433d074587 100644 > > --- a/drivers/media/v4l2-core/v4l2-subdev.c > > +++ b/drivers/media/v4l2-core/v4l2-subdev.c > > @@ -629,6 +629,19 @@ subdev_ioctl_get_state(struct v4l2_subdev *sd, struct v4l2_subdev_fh *subdev_fh, > > v4l2_subdev_get_unlocked_active_state(sd); > > } > > > > +static void subdev_copy_fix_routes(struct v4l2_subdev_routing *routing, > > + const struct v4l2_subdev_route *src, > > + u32 copy_routes, u32 num_routes) > > +{ > > + struct v4l2_subdev_route *routes = > > + (struct v4l2_subdev_route *)(uintptr_t)routing->routes; > > + > > + for (u32 i = 0; i < copy_routes; i++) > > + routes[i] = src[i]; > > + > > + routing->num_routes = num_routes; > > +} > > The function just copies routes, no fixing, so I agree with Jacopo's > comment, subdev_copy_routes seems like a better name. > > Clear names for src/dest sound better, and also address the case when > copy_routes>num_routes, at the calling place it was > min(state->routing.num_routes, routing->len_routes). I agree. I'll also change the arguments to just include the routing struct and the state -- all the callers already use these. How about calling it copy_routes_state_to_routing()? -- Regards, Sakari Ailus