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 30E8722126C; Fri, 8 Aug 2025 07:01:19 +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=1754636489; cv=none; b=mvpWiGNJYeN9XkYAg0bLD8teL0ZAubieotTg55InM6HNxoF8S2iKNaPxQP2Zbi/pQPwFasifRe+y7vBnlrj15bHQeSY3OJ7ihpjpsANtfvaXSxkRVd0d2jKaxEEWnz9zr7NyuLrkFo9SpyRKlPU2Wag+pTBMfn7vCqewwAVuFHs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754636489; c=relaxed/simple; bh=UXy3i9C6bbMdDQOKUIotVBZOhRTB7Eqzu2EusMKX2pM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LyXL/wYeqzc/kgRvABK0j9tmgB4Aq6e1CIXFqzT3uuiid7kWtNDI9pNCMNQH0W8ffHX8Ki5OqVB9Ow+kvsdT1F1Bza7Btemu92JCdwXxmuBV0BGbkrgnSy17/5RvWJWGdnnkeM3wIxhVJoyof77HhKYvt/95eHxMdbvtJmJzAYs= 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=YhsHNtRA; 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="YhsHNtRA" Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id C1DDF1648; Fri, 8 Aug 2025 09:00:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1754636414; bh=UXy3i9C6bbMdDQOKUIotVBZOhRTB7Eqzu2EusMKX2pM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YhsHNtRAKB/7w0xkjzkqhL708Kl0Y+1s7hRwxkpvRT5reM4TWwrB4R4Hpw0WY9rHP ZdK1vg9whwN4ENFB7XeNT3S9xp9YrW78r5VwpFX4fguf4eCByP3rBGw96FfDhMAKG3 n2zy+rkuK6vsoP6JhCOiP8waFB6UgFCVRS5pa2XY= Date: Fri, 8 Aug 2025 10:00:48 +0300 From: Laurent Pinchart To: Hans Verkuil Cc: Jacopo Mondi , Mauro Carvalho Chehab , Devarsh Thakkar , Benoit Parrot , Hans Verkuil , Mike Isely , Hans de Goede , Parthiban Veerasooran , Christian Gromm , Greg Kroah-Hartman , Alex Shi , Yanteng Si , Dongliang Mu , Jonathan Corbet , Tomasz Figa , Marek Szyprowski , Andy Walls , Michael Tretter , Pengutronix Kernel Team , Bin Liu , Matthias Brugger , AngeloGioacchino Del Regno , Dmitry Osipenko , Thierry Reding , Jonathan Hunter , Mirela Rabulea , Shawn Guo , Sascha Hauer , Fabio Estevam , Kieran Bingham , Michal Simek , Ming Qian , Zhou Peng , Xavier Roumegue , Philipp Zabel , Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Sylwester Nawrocki , Jernej Skrabec , Chen-Yu Tsai , Samuel Holland , Daniel Almeida , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Nas Chung , Jackson Lee , Minghsiu Tsai , Houlong Wei , Andrew-CT Chen , Tiffany Lin , Yunfei Dong , Geert Uytterhoeven , Magnus Damm , Mikhail Ulyanov , Jacob Chen , Ezequiel Garcia , Heiko Stuebner , Detlev Casanova , Krzysztof Kozlowski , Alim Akhtar , Sylwester Nawrocki , =?utf-8?Q?=C5=81ukasz?= Stelmach , Andrzej Pietrasiewicz , Jacek Anaszewski , Andrzej Hajda , Fabien Dessenne , Hugues Fruchet , Jean-Christophe Trotin , Maxime Coquelin , Alexandre Torgue , Nicolas Dufresne , Benjamin Gaignard , Steve Longerbeam , Maxime Ripard , Paul Kocialkowski , Niklas =?utf-8?Q?S=C3=B6derlund?= , Robert Foss , Todor Tomov , Vladimir Zapolskiy , Corentin Labbe , Sakari Ailus , Bingbu Cao , Tianshu Qiu , Stanislaw Gruszka , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-tegra@vger.kernel.org, imx@lists.linux.dev, linux-renesas-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-usb@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, mjpeg-users@lists.sourceforge.net Subject: Re: [PATCH 65/65] media: v4l2-ioctl: Stop passing fh pointer to ioctl handlers Message-ID: <20250808070048.GK11583@pendragon.ideasonboard.com> References: <20250802-media-private-data-v1-0-eb140ddd6a9d@ideasonboard.com> <20250802-media-private-data-v1-65-eb140ddd6a9d@ideasonboard.com> <5bda2b73-0538-41d1-b065-9b541a027475@kernel.org> <28ddf35a-3e7a-4470-8305-c64a551fd8c7@kernel.org> <20250807203328.GI11583@pendragon.ideasonboard.com> <7d2f307c-ab21-47b0-afaf-0ba51ffbd215@kernel.org> Precedence: bulk X-Mailing-List: linux-usb@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: <7d2f307c-ab21-47b0-afaf-0ba51ffbd215@kernel.org> On Thu, Aug 07, 2025 at 10:55:59PM +0200, Hans Verkuil wrote: > On 07/08/2025 22:33, Laurent Pinchart wrote: > > On Thu, Aug 07, 2025 at 09:58:34AM +0200, Hans Verkuil wrote: > >> On 07/08/2025 09:26, Hans Verkuil wrote: > >>> On 02/08/2025 11:23, Jacopo Mondi wrote: > >>>> From: Laurent Pinchart > >>>> > >>>> Now that all drivers access the v4l2_fh from the file structure, there > >>>> is no need to pass it as an explicit argument to ioctl handlers. Set the > >>>> argument to NULL in the w__video_do_ioctl(), and drop the name of the > >>>> void *fh argument in the ioctl handler declarations to indicate it is > >>>> not used. > >>>> > >>>> The argument could be removed altogether with a mechanical change > >>>> (probably using coccinelle), but there are plans to pass a new argument > >>>> to the ioctl handlers in the near future. The tree-wide change to remove > >>>> the argument, only to add another one soon after, would be too much > >>>> churn. > >>>> > >>>> Signed-off-by: Laurent Pinchart > >>>> Signed-off-by: Jacopo Mondi > >>>> --- > >>>> drivers/media/v4l2-core/v4l2-ioctl.c | 5 +- > >>>> include/media/v4l2-ioctl.h | 236 +++++++++++++++++------------------ > >>>> 2 files changed, 120 insertions(+), 121 deletions(-) > >>>> > >>>> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c > >>>> index 44c2f5ef3dae407d9786c5278d13efc982be2ff0..248a0b5b56ec7a09f2d4c61114f81aa5a9b8b041 100644 > >>>> --- a/drivers/media/v4l2-core/v4l2-ioctl.c > >>>> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c > >>>> @@ -3078,7 +3078,6 @@ static long __video_do_ioctl(struct file *file, > >>>> bool write_only = false; > >>>> struct v4l2_ioctl_info default_info; > >>>> const struct v4l2_ioctl_info *info; > >>>> - void *fh = file_to_v4l2_fh(file); > >>>> struct v4l2_fh *vfh = NULL; > >>>> int dev_debug = vfd->dev_debug; > >>>> long ret = -ENOTTY; > >>>> @@ -3140,11 +3139,11 @@ static long __video_do_ioctl(struct file *file, > >>>> > >>>> write_only = _IOC_DIR(cmd) == _IOC_WRITE; > >>>> if (info != &default_info) { > >>>> - ret = info->func(ops, file, fh, arg); > >>>> + ret = info->func(ops, file, NULL, arg); > >>>> } else if (!ops->vidioc_default) { > >>>> ret = -ENOTTY; > >>>> } else { > >>>> - ret = ops->vidioc_default(file, fh, > >>>> + ret = ops->vidioc_default(file, NULL, > >>>> vfh ? v4l2_prio_check(vfd->prio, vfh->prio) >= 0 : 0, > >>>> cmd, arg); > >>>> } > >>> > >>> drivers/media/v4l2-core/v4l2-compat-ioctl32.c also calls ops->vidioc_query_ext_ctrl > >>> directly, but still passes the fh as second argument: that needs to be replaced by > >>> a NULL pointer as well. That should be fixed in this patch as well. > > > > Oops, I missed it. Will be fixed in v2. > > > >>> Regarding v4l2-ioctl.c: I would like a follow-up patch that pushes the NULL pointer > >>> down into each ioctl helper function. I.e. drop the 'void *fh' argument in the > >>> struct v4l2_ioctl_info 'func' callback, and all callbacks like v4l_g_fmt() just > >>> replace 'fh' by 'NULL' when they call the vidioc op. > > > > I'll add a patch in v2. > > > >>> Part of it is that the core functions currently suggest that the second argument is > >>> a filehandle (since it's still named 'fh'), which is obviously wrong. And I also think > >>> that the core framework shouldn't use a dummy second argument at all. I admit that > >>> changing all vidioc callbacks in the whole subsystem to drop the second argument is > >>> too much churn, but for this core file I think it is something that should be done. > >> > >> A follow-up on this: I would not be against a large patch that drops the second priv > >> argument from all vidioc ops since it is now unused. If nothing else, it helps ensure > >> that it is really unused by all drivers :-) > > > > I've considered that. We're working on introducing a video_device_state > > that will likely be passed as an argument to the ioctl handlers, and we > > thought that not removing the void *priv argument yet could mean less > > churn in drivers when we add the new argument, taking over the void > > *priv. However, the state should be passed through an explicitly typed > > pointer, so we'll have to patch all drivers anyway. I suppose we could > > drop the void pointer now, and add a new pointer later. What do you > > think ? > > It depends on how what you think is the ETA for the video_device_state :-) > > I think we can shelve this for now, but as mentioned below, at least replace > 'fh' by 'priv' for the test drivers, pci skeleton driver and (I think) uvc. OK, I'll do that. > >> But if you don't want to go there, then there is something that I think need to be addressed: > >> a lot of drivers name the second argument 'fh' or '_fh' or even 'fh0'. Can we add a patch that > >> renames the second arg to 'priv'? > >> > >> At minimum I think this should be done for drivers/media/test-drivers and > >> samples/v4l/v4l2-pci-skeleton.c. These drivers are often used as reference drivers, > >> so they should be up-to-date. > >> > >> I would also suggest to do this for uvc since it is by far the most widely used media > >> driver. > >> > >> I also see the use of 'fh' in v4l2-mem2mem.c in a few places. > >> > >>>> diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h > >>>> index 82695c3a300a73219f262fb556ed61a8f09d273e..223e2c7a3516fc96fb486ab64226163e52f775a6 100644 > >>>> --- a/include/media/v4l2-ioctl.h > >>>> +++ b/include/media/v4l2-ioctl.h > >>>> @@ -293,144 +293,144 @@ struct v4l2_ioctl_ops { > >>>> /* ioctl callbacks */ > >>>> > >>>> /* VIDIOC_QUERYCAP handler */ > >>>> - int (*vidioc_querycap)(struct file *file, void *fh, > >>>> + int (*vidioc_querycap)(struct file *file, void *, > >>>> struct v4l2_capability *cap); > >>>> > >>>> /* VIDIOC_ENUM_FMT handlers */ > >>>> - int (*vidioc_enum_fmt_vid_cap)(struct file *file, void *fh, > >>>> + int (*vidioc_enum_fmt_vid_cap)(struct file *file, void *, > >>>> struct v4l2_fmtdesc *f); > >>>> - int (*vidioc_enum_fmt_vid_overlay)(struct file *file, void *fh, > >>>> + int (*vidioc_enum_fmt_vid_overlay)(struct file *file, void *, > >>>> struct v4l2_fmtdesc *f); > >>>> - int (*vidioc_enum_fmt_vid_out)(struct file *file, void *fh, > >>>> + int (*vidioc_enum_fmt_vid_out)(struct file *file, void *, > >>>> struct v4l2_fmtdesc *f); > >>>> - int (*vidioc_enum_fmt_sdr_cap)(struct file *file, void *fh, > >>>> + int (*vidioc_enum_fmt_sdr_cap)(struct file *file, void *, > >>>> struct v4l2_fmtdesc *f); > >>>> - int (*vidioc_enum_fmt_sdr_out)(struct file *file, void *fh, > >>>> + int (*vidioc_enum_fmt_sdr_out)(struct file *file, void *, > >>>> struct v4l2_fmtdesc *f); > >>>> - int (*vidioc_enum_fmt_meta_cap)(struct file *file, void *fh, > >>>> + int (*vidioc_enum_fmt_meta_cap)(struct file *file, void *, > >>>> struct v4l2_fmtdesc *f); > >>>> - int (*vidioc_enum_fmt_meta_out)(struct file *file, void *fh, > >>>> + int (*vidioc_enum_fmt_meta_out)(struct file *file, void *, > >>>> struct v4l2_fmtdesc *f); > >>>> > >>>> /* VIDIOC_G_FMT handlers */ > >>>> - int (*vidioc_g_fmt_vid_cap)(struct file *file, void *fh, > >>>> + int (*vidioc_g_fmt_vid_cap)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_g_fmt_vid_overlay)(struct file *file, void *fh, > >>>> + int (*vidioc_g_fmt_vid_overlay)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_g_fmt_vid_out)(struct file *file, void *fh, > >>>> + int (*vidioc_g_fmt_vid_out)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_g_fmt_vid_out_overlay)(struct file *file, void *fh, > >>>> + int (*vidioc_g_fmt_vid_out_overlay)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_g_fmt_vbi_cap)(struct file *file, void *fh, > >>>> + int (*vidioc_g_fmt_vbi_cap)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_g_fmt_vbi_out)(struct file *file, void *fh, > >>>> + int (*vidioc_g_fmt_vbi_out)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_g_fmt_sliced_vbi_cap)(struct file *file, void *fh, > >>>> + int (*vidioc_g_fmt_sliced_vbi_cap)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_g_fmt_sliced_vbi_out)(struct file *file, void *fh, > >>>> + int (*vidioc_g_fmt_sliced_vbi_out)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_g_fmt_vid_cap_mplane)(struct file *file, void *fh, > >>>> + int (*vidioc_g_fmt_vid_cap_mplane)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_g_fmt_vid_out_mplane)(struct file *file, void *fh, > >>>> + int (*vidioc_g_fmt_vid_out_mplane)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_g_fmt_sdr_cap)(struct file *file, void *fh, > >>>> + int (*vidioc_g_fmt_sdr_cap)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_g_fmt_sdr_out)(struct file *file, void *fh, > >>>> + int (*vidioc_g_fmt_sdr_out)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_g_fmt_meta_cap)(struct file *file, void *fh, > >>>> + int (*vidioc_g_fmt_meta_cap)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_g_fmt_meta_out)(struct file *file, void *fh, > >>>> + int (*vidioc_g_fmt_meta_out)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> > >>>> /* VIDIOC_S_FMT handlers */ > >>>> - int (*vidioc_s_fmt_vid_cap)(struct file *file, void *fh, > >>>> + int (*vidioc_s_fmt_vid_cap)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_s_fmt_vid_overlay)(struct file *file, void *fh, > >>>> + int (*vidioc_s_fmt_vid_overlay)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_s_fmt_vid_out)(struct file *file, void *fh, > >>>> + int (*vidioc_s_fmt_vid_out)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_s_fmt_vid_out_overlay)(struct file *file, void *fh, > >>>> + int (*vidioc_s_fmt_vid_out_overlay)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_s_fmt_vbi_cap)(struct file *file, void *fh, > >>>> + int (*vidioc_s_fmt_vbi_cap)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_s_fmt_vbi_out)(struct file *file, void *fh, > >>>> + int (*vidioc_s_fmt_vbi_out)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_s_fmt_sliced_vbi_cap)(struct file *file, void *fh, > >>>> + int (*vidioc_s_fmt_sliced_vbi_cap)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_s_fmt_sliced_vbi_out)(struct file *file, void *fh, > >>>> + int (*vidioc_s_fmt_sliced_vbi_out)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_s_fmt_vid_cap_mplane)(struct file *file, void *fh, > >>>> + int (*vidioc_s_fmt_vid_cap_mplane)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_s_fmt_vid_out_mplane)(struct file *file, void *fh, > >>>> + int (*vidioc_s_fmt_vid_out_mplane)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_s_fmt_sdr_cap)(struct file *file, void *fh, > >>>> + int (*vidioc_s_fmt_sdr_cap)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_s_fmt_sdr_out)(struct file *file, void *fh, > >>>> + int (*vidioc_s_fmt_sdr_out)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_s_fmt_meta_cap)(struct file *file, void *fh, > >>>> + int (*vidioc_s_fmt_meta_cap)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_s_fmt_meta_out)(struct file *file, void *fh, > >>>> + int (*vidioc_s_fmt_meta_out)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> > >>>> /* VIDIOC_TRY_FMT handlers */ > >>>> - int (*vidioc_try_fmt_vid_cap)(struct file *file, void *fh, > >>>> + int (*vidioc_try_fmt_vid_cap)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_try_fmt_vid_overlay)(struct file *file, void *fh, > >>>> + int (*vidioc_try_fmt_vid_overlay)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_try_fmt_vid_out)(struct file *file, void *fh, > >>>> + int (*vidioc_try_fmt_vid_out)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_try_fmt_vid_out_overlay)(struct file *file, void *fh, > >>>> + int (*vidioc_try_fmt_vid_out_overlay)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_try_fmt_vbi_cap)(struct file *file, void *fh, > >>>> + int (*vidioc_try_fmt_vbi_cap)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_try_fmt_vbi_out)(struct file *file, void *fh, > >>>> + int (*vidioc_try_fmt_vbi_out)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_try_fmt_sliced_vbi_cap)(struct file *file, void *fh, > >>>> + int (*vidioc_try_fmt_sliced_vbi_cap)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_try_fmt_sliced_vbi_out)(struct file *file, void *fh, > >>>> + int (*vidioc_try_fmt_sliced_vbi_out)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_try_fmt_vid_cap_mplane)(struct file *file, void *fh, > >>>> + int (*vidioc_try_fmt_vid_cap_mplane)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_try_fmt_vid_out_mplane)(struct file *file, void *fh, > >>>> + int (*vidioc_try_fmt_vid_out_mplane)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_try_fmt_sdr_cap)(struct file *file, void *fh, > >>>> + int (*vidioc_try_fmt_sdr_cap)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_try_fmt_sdr_out)(struct file *file, void *fh, > >>>> + int (*vidioc_try_fmt_sdr_out)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_try_fmt_meta_cap)(struct file *file, void *fh, > >>>> + int (*vidioc_try_fmt_meta_cap)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> - int (*vidioc_try_fmt_meta_out)(struct file *file, void *fh, > >>>> + int (*vidioc_try_fmt_meta_out)(struct file *file, void *, > >>>> struct v4l2_format *f); > >>>> > >>>> /* Buffer handlers */ > >>>> - int (*vidioc_reqbufs)(struct file *file, void *fh, > >>>> + int (*vidioc_reqbufs)(struct file *file, void *, > >>>> struct v4l2_requestbuffers *b); > >>>> - int (*vidioc_querybuf)(struct file *file, void *fh, > >>>> + int (*vidioc_querybuf)(struct file *file, void *, > >>>> struct v4l2_buffer *b); > >>>> - int (*vidioc_qbuf)(struct file *file, void *fh, > >>>> + int (*vidioc_qbuf)(struct file *file, void *, > >>>> struct v4l2_buffer *b); > >>>> - int (*vidioc_expbuf)(struct file *file, void *fh, > >>>> + int (*vidioc_expbuf)(struct file *file, void *, > >>>> struct v4l2_exportbuffer *e); > >>>> - int (*vidioc_dqbuf)(struct file *file, void *fh, > >>>> + int (*vidioc_dqbuf)(struct file *file, void *, > >>>> struct v4l2_buffer *b); > >>>> > >>>> - int (*vidioc_create_bufs)(struct file *file, void *fh, > >>>> + int (*vidioc_create_bufs)(struct file *file, void *, > >>>> struct v4l2_create_buffers *b); > >>>> - int (*vidioc_prepare_buf)(struct file *file, void *fh, > >>>> + int (*vidioc_prepare_buf)(struct file *file, void *, > >>>> struct v4l2_buffer *b); > >>>> - int (*vidioc_remove_bufs)(struct file *file, void *fh, > >>>> + int (*vidioc_remove_bufs)(struct file *file, void *, > >>>> struct v4l2_remove_buffers *d); > >>>> > >>>> - int (*vidioc_overlay)(struct file *file, void *fh, unsigned int i); > >>>> - int (*vidioc_g_fbuf)(struct file *file, void *fh, > >>>> + int (*vidioc_overlay)(struct file *file, void *, unsigned int i); > >>>> + int (*vidioc_g_fbuf)(struct file *file, void *, > >>>> struct v4l2_framebuffer *a); > >>>> - int (*vidioc_s_fbuf)(struct file *file, void *fh, > >>>> + int (*vidioc_s_fbuf)(struct file *file, void *, > >>>> const struct v4l2_framebuffer *a); > >>>> > >>>> /* Stream on/off */ > >>>> - int (*vidioc_streamon)(struct file *file, void *fh, > >>>> + int (*vidioc_streamon)(struct file *file, void *, > >>>> enum v4l2_buf_type i); > >>>> - int (*vidioc_streamoff)(struct file *file, void *fh, > >>>> + int (*vidioc_streamoff)(struct file *file, void *, > >>>> enum v4l2_buf_type i); > >>>> > >>>> /* > >>>> @@ -438,135 +438,135 @@ struct v4l2_ioctl_ops { > >>>> * > >>>> * Note: ENUMSTD is handled by videodev.c > >>>> */ > >>>> - int (*vidioc_g_std)(struct file *file, void *fh, v4l2_std_id *norm); > >>>> - int (*vidioc_s_std)(struct file *file, void *fh, v4l2_std_id norm); > >>>> - int (*vidioc_querystd)(struct file *file, void *fh, v4l2_std_id *a); > >>>> + int (*vidioc_g_std)(struct file *file, void *, v4l2_std_id *norm); > >>>> + int (*vidioc_s_std)(struct file *file, void *, v4l2_std_id norm); > >>>> + int (*vidioc_querystd)(struct file *file, void *, v4l2_std_id *a); > >>>> > >>>> /* Input handling */ > >>>> - int (*vidioc_enum_input)(struct file *file, void *fh, > >>>> + int (*vidioc_enum_input)(struct file *file, void *, > >>>> struct v4l2_input *inp); > >>>> - int (*vidioc_g_input)(struct file *file, void *fh, unsigned int *i); > >>>> - int (*vidioc_s_input)(struct file *file, void *fh, unsigned int i); > >>>> + int (*vidioc_g_input)(struct file *file, void *, unsigned int *i); > >>>> + int (*vidioc_s_input)(struct file *file, void *, unsigned int i); > >>>> > >>>> /* Output handling */ > >>>> - int (*vidioc_enum_output)(struct file *file, void *fh, > >>>> + int (*vidioc_enum_output)(struct file *file, void *, > >>>> struct v4l2_output *a); > >>>> - int (*vidioc_g_output)(struct file *file, void *fh, unsigned int *i); > >>>> - int (*vidioc_s_output)(struct file *file, void *fh, unsigned int i); > >>>> + int (*vidioc_g_output)(struct file *file, void *, unsigned int *i); > >>>> + int (*vidioc_s_output)(struct file *file, void *, unsigned int i); > >>>> > >>>> /* Control handling */ > >>>> - int (*vidioc_query_ext_ctrl)(struct file *file, void *fh, > >>>> + int (*vidioc_query_ext_ctrl)(struct file *file, void *, > >>>> struct v4l2_query_ext_ctrl *a); > >>>> - int (*vidioc_g_ext_ctrls)(struct file *file, void *fh, > >>>> + int (*vidioc_g_ext_ctrls)(struct file *file, void *, > >>>> struct v4l2_ext_controls *a); > >>>> - int (*vidioc_s_ext_ctrls)(struct file *file, void *fh, > >>>> + int (*vidioc_s_ext_ctrls)(struct file *file, void *, > >>>> struct v4l2_ext_controls *a); > >>>> - int (*vidioc_try_ext_ctrls)(struct file *file, void *fh, > >>>> + int (*vidioc_try_ext_ctrls)(struct file *file, void *, > >>>> struct v4l2_ext_controls *a); > >>>> - int (*vidioc_querymenu)(struct file *file, void *fh, > >>>> + int (*vidioc_querymenu)(struct file *file, void *, > >>>> struct v4l2_querymenu *a); > >>>> > >>>> /* Audio ioctls */ > >>>> - int (*vidioc_enumaudio)(struct file *file, void *fh, > >>>> + int (*vidioc_enumaudio)(struct file *file, void *, > >>>> struct v4l2_audio *a); > >>>> - int (*vidioc_g_audio)(struct file *file, void *fh, > >>>> + int (*vidioc_g_audio)(struct file *file, void *, > >>>> struct v4l2_audio *a); > >>>> - int (*vidioc_s_audio)(struct file *file, void *fh, > >>>> + int (*vidioc_s_audio)(struct file *file, void *, > >>>> const struct v4l2_audio *a); > >>>> > >>>> /* Audio out ioctls */ > >>>> - int (*vidioc_enumaudout)(struct file *file, void *fh, > >>>> + int (*vidioc_enumaudout)(struct file *file, void *, > >>>> struct v4l2_audioout *a); > >>>> - int (*vidioc_g_audout)(struct file *file, void *fh, > >>>> + int (*vidioc_g_audout)(struct file *file, void *, > >>>> struct v4l2_audioout *a); > >>>> - int (*vidioc_s_audout)(struct file *file, void *fh, > >>>> + int (*vidioc_s_audout)(struct file *file, void *, > >>>> const struct v4l2_audioout *a); > >>>> - int (*vidioc_g_modulator)(struct file *file, void *fh, > >>>> + int (*vidioc_g_modulator)(struct file *file, void *, > >>>> struct v4l2_modulator *a); > >>>> - int (*vidioc_s_modulator)(struct file *file, void *fh, > >>>> + int (*vidioc_s_modulator)(struct file *file, void *, > >>>> const struct v4l2_modulator *a); > >>>> /* Crop ioctls */ > >>>> - int (*vidioc_g_pixelaspect)(struct file *file, void *fh, > >>>> + int (*vidioc_g_pixelaspect)(struct file *file, void *, > >>>> int buf_type, struct v4l2_fract *aspect); > >>>> - int (*vidioc_g_selection)(struct file *file, void *fh, > >>>> + int (*vidioc_g_selection)(struct file *file, void *, > >>>> struct v4l2_selection *s); > >>>> - int (*vidioc_s_selection)(struct file *file, void *fh, > >>>> + int (*vidioc_s_selection)(struct file *file, void *, > >>>> struct v4l2_selection *s); > >>>> /* Compression ioctls */ > >>>> - int (*vidioc_g_jpegcomp)(struct file *file, void *fh, > >>>> + int (*vidioc_g_jpegcomp)(struct file *file, void *, > >>>> struct v4l2_jpegcompression *a); > >>>> - int (*vidioc_s_jpegcomp)(struct file *file, void *fh, > >>>> + int (*vidioc_s_jpegcomp)(struct file *file, void *, > >>>> const struct v4l2_jpegcompression *a); > >>>> - int (*vidioc_g_enc_index)(struct file *file, void *fh, > >>>> + int (*vidioc_g_enc_index)(struct file *file, void *, > >>>> struct v4l2_enc_idx *a); > >>>> - int (*vidioc_encoder_cmd)(struct file *file, void *fh, > >>>> + int (*vidioc_encoder_cmd)(struct file *file, void *, > >>>> struct v4l2_encoder_cmd *a); > >>>> - int (*vidioc_try_encoder_cmd)(struct file *file, void *fh, > >>>> + int (*vidioc_try_encoder_cmd)(struct file *file, void *, > >>>> struct v4l2_encoder_cmd *a); > >>>> - int (*vidioc_decoder_cmd)(struct file *file, void *fh, > >>>> + int (*vidioc_decoder_cmd)(struct file *file, void *, > >>>> struct v4l2_decoder_cmd *a); > >>>> - int (*vidioc_try_decoder_cmd)(struct file *file, void *fh, > >>>> + int (*vidioc_try_decoder_cmd)(struct file *file, void *, > >>>> struct v4l2_decoder_cmd *a); > >>>> > >>>> /* Stream type-dependent parameter ioctls */ > >>>> - int (*vidioc_g_parm)(struct file *file, void *fh, > >>>> + int (*vidioc_g_parm)(struct file *file, void *, > >>>> struct v4l2_streamparm *a); > >>>> - int (*vidioc_s_parm)(struct file *file, void *fh, > >>>> + int (*vidioc_s_parm)(struct file *file, void *, > >>>> struct v4l2_streamparm *a); > >>>> > >>>> /* Tuner ioctls */ > >>>> - int (*vidioc_g_tuner)(struct file *file, void *fh, > >>>> + int (*vidioc_g_tuner)(struct file *file, void *, > >>>> struct v4l2_tuner *a); > >>>> - int (*vidioc_s_tuner)(struct file *file, void *fh, > >>>> + int (*vidioc_s_tuner)(struct file *file, void *, > >>>> const struct v4l2_tuner *a); > >>>> - int (*vidioc_g_frequency)(struct file *file, void *fh, > >>>> + int (*vidioc_g_frequency)(struct file *file, void *, > >>>> struct v4l2_frequency *a); > >>>> - int (*vidioc_s_frequency)(struct file *file, void *fh, > >>>> + int (*vidioc_s_frequency)(struct file *file, void *, > >>>> const struct v4l2_frequency *a); > >>>> - int (*vidioc_enum_freq_bands)(struct file *file, void *fh, > >>>> + int (*vidioc_enum_freq_bands)(struct file *file, void *, > >>>> struct v4l2_frequency_band *band); > >>>> > >>>> /* Sliced VBI cap */ > >>>> - int (*vidioc_g_sliced_vbi_cap)(struct file *file, void *fh, > >>>> + int (*vidioc_g_sliced_vbi_cap)(struct file *file, void *, > >>>> struct v4l2_sliced_vbi_cap *a); > >>>> > >>>> /* Log status ioctl */ > >>>> - int (*vidioc_log_status)(struct file *file, void *fh); > >>>> + int (*vidioc_log_status)(struct file *file, void *); > >>>> > >>>> - int (*vidioc_s_hw_freq_seek)(struct file *file, void *fh, > >>>> + int (*vidioc_s_hw_freq_seek)(struct file *file, void *, > >>>> const struct v4l2_hw_freq_seek *a); > >>>> > >>>> /* Debugging ioctls */ > >>>> #ifdef CONFIG_VIDEO_ADV_DEBUG > >>>> - int (*vidioc_g_register)(struct file *file, void *fh, > >>>> + int (*vidioc_g_register)(struct file *file, void *, > >>>> struct v4l2_dbg_register *reg); > >>>> - int (*vidioc_s_register)(struct file *file, void *fh, > >>>> + int (*vidioc_s_register)(struct file *file, void *, > >>>> const struct v4l2_dbg_register *reg); > >>>> > >>>> - int (*vidioc_g_chip_info)(struct file *file, void *fh, > >>>> + int (*vidioc_g_chip_info)(struct file *file, void *, > >>>> struct v4l2_dbg_chip_info *chip); > >>>> #endif > >>>> > >>>> - int (*vidioc_enum_framesizes)(struct file *file, void *fh, > >>>> + int (*vidioc_enum_framesizes)(struct file *file, void *, > >>>> struct v4l2_frmsizeenum *fsize); > >>>> > >>>> - int (*vidioc_enum_frameintervals)(struct file *file, void *fh, > >>>> + int (*vidioc_enum_frameintervals)(struct file *file, void *, > >>>> struct v4l2_frmivalenum *fival); > >>>> > >>>> /* DV Timings IOCTLs */ > >>>> - int (*vidioc_s_dv_timings)(struct file *file, void *fh, > >>>> + int (*vidioc_s_dv_timings)(struct file *file, void *, > >>>> struct v4l2_dv_timings *timings); > >>>> - int (*vidioc_g_dv_timings)(struct file *file, void *fh, > >>>> + int (*vidioc_g_dv_timings)(struct file *file, void *, > >>>> struct v4l2_dv_timings *timings); > >>>> - int (*vidioc_query_dv_timings)(struct file *file, void *fh, > >>>> + int (*vidioc_query_dv_timings)(struct file *file, void *, > >>>> struct v4l2_dv_timings *timings); > >>>> - int (*vidioc_enum_dv_timings)(struct file *file, void *fh, > >>>> + int (*vidioc_enum_dv_timings)(struct file *file, void *, > >>>> struct v4l2_enum_dv_timings *timings); > >>>> - int (*vidioc_dv_timings_cap)(struct file *file, void *fh, > >>>> + int (*vidioc_dv_timings_cap)(struct file *file, void *, > >>>> struct v4l2_dv_timings_cap *cap); > >>>> - int (*vidioc_g_edid)(struct file *file, void *fh, > >>>> + int (*vidioc_g_edid)(struct file *file, void *, > >>>> struct v4l2_edid *edid); > >>>> - int (*vidioc_s_edid)(struct file *file, void *fh, > >>>> + int (*vidioc_s_edid)(struct file *file, void *, > >>>> struct v4l2_edid *edid); > >>>> > >>>> int (*vidioc_subscribe_event)(struct v4l2_fh *fh, > >>>> @@ -575,7 +575,7 @@ struct v4l2_ioctl_ops { > >>>> const struct v4l2_event_subscription *sub); > >>>> > >>>> /* For other private ioctls */ > >>>> - long (*vidioc_default)(struct file *file, void *fh, > >>>> + long (*vidioc_default)(struct file *file, void *, > >>>> bool valid_prio, unsigned int cmd, void *arg); > >>>> }; > >>>> -- Regards, Laurent Pinchart