Message ID | 20240508214045.24716-1-laurent.pinchart+renesas@ideasonboard.com (mailing list archive) |
---|---|
Headers |
Received: from sy.mirrors.kernel.org ([147.75.48.161]) by linuxtv.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from <linux-media+bounces-11174-patchwork=linuxtv.org@vger.kernel.org>) id 1s4p2I-0001Sp-2K for patchwork@linuxtv.org; Wed, 08 May 2024 21:41:15 +0000 Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B717DB20A32 for <patchwork@linuxtv.org>; Wed, 8 May 2024 21:41:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 82518131BA5; Wed, 8 May 2024 21:40:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="lsz0/nHU" X-Original-To: linux-media@vger.kernel.org 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 4E88613175F; Wed, 8 May 2024 21:40:56 +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=1715204458; cv=none; b=bFui7pBRZiqzad2scEWlHO0GIHiU+pGsleIrtg3WzdhFTGZqyBdQnLwwqU3XR2vUN0dV0GJdTe0uiymd9ARj0hdmETe+OdL4vKqnJtCKeqPWGbr7uNkd9DdpnBKd/OQfWavHnvSE3T54bYs+z4dED0w78KtHhEfW+UKzZoS94mA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715204458; c=relaxed/simple; bh=sKGmOtVcUTdHHHyght00SZYPiUDaOQWYdoTQwpgcyyg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gk/6dh1CjzAJvpFlPkZNsOamdekQgIdDt3vIO9L16GPHVcBKtuTnSvkkLSmGOksYvHMSu2D2AqG+xB3UF+0Ne+PLKvpQ0h3o2roInaxQ1m7guGCNNGwMJZAL9E4WrHJNtXTQgAxknMSHMJyXFnntGICzXSOiD2zGoGkVtZUIrGM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (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=lsz0/nHU; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3452716D4; Wed, 8 May 2024 23:40:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1715204451; bh=sKGmOtVcUTdHHHyght00SZYPiUDaOQWYdoTQwpgcyyg=; h=From:To:Cc:Subject:Date:From; b=lsz0/nHUncOxIpC2IejWW9n8yIBAo7kjYj8/+8Xdgulg3KUt29Gv6coeUwpnboovS kzln6X1JucIsAY+sj7OuEuW+P37MbHgU2MTlaF8tTTfHHssmmoPTAuA+p3VDArffzi jM4zrwi2JYVgiCOMNSkNvWow8qjRq1eJro0DxBVA= From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> To: linux-media@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Sakari Ailus <sakari.ailus@iki.fi>, Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>, Hans Verkuil <hverkuil-cisco@xs4all.nl>, Dafna Hirschfeld <dafna@fastmail.com>, linux-rockchip@lists.infradead.org Subject: [PATCH v4 0/3] media: v4l2-subdev: Support const-awareness in state accessors Date: Thu, 9 May 2024 00:40:42 +0300 Message-ID: <20240508214045.24716-1-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 2.43.2 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: <linux-media.vger.kernel.org> List-Subscribe: <mailto:linux-media+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-media+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-LSpam-Score: -2.6 (--) X-LSpam-Report: No, score=-2.6 required=5.0 tests=ARC_SIGNED=0.001,ARC_VALID=-0.1,BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,DMARC_MISSING=0.001,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no |
Series |
media: v4l2-subdev: Support const-awareness in state accessors
|
|
Message
Laurent Pinchart
May 8, 2024, 9:40 p.m. UTC
This small patch series comes from a mild annoyance I experienced during a recent patch review, where I wanted to ask for a pointer to a v4l2_subdev_state used to access the state in a read-only fashion to be made const. This wasn't possible as the state accessors functions take a non-const state pointer, in order to return pointers to mutable formats and selection rectangles. Patch 1/3 first fixes a small documentation mistake. Patch 2/3 improves the state accessors to support const states, in the same wait as the recently introduced container_of_const() macro. The internal macro name has been subject to a bit of bikeshedding already, so I think we're reaching a final version. Patch 3/3 then shows how this can be used in one driver. Compared to v3, patch 1/3 is new, and patch 2/3 renames the new macro and updates documentation. Laurent Pinchart (3): media: v4l2-subdev: Fix v4l2_subdev_state_get_format() documentation media: v4l2-subdev: Provide const-aware subdev state accessors media: rkisp1: Mark subdev state pointers as const .../platform/rockchip/rkisp1/rkisp1-isp.c | 8 +-- .../platform/rockchip/rkisp1/rkisp1-resizer.c | 8 +-- include/media/v4l2-subdev.h | 50 +++++++++++++------ 3 files changed, 42 insertions(+), 24 deletions(-) base-commit: e695668af8523b059127dfa8b261c76e7c9cde10