[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2a04c948-82ba-c69f-891e-303db85b66a4@xs4all.nl>
Date: Tue, 8 May 2018 19:22:21 +0200
From: Hans Verkuil <hverkuil@...all.nl>
To: Sami Tolvanen <samitolvanen@...gle.com>
Cc: Mauro Carvalho Chehab <mchehab@...pensource.com>,
Kees Cook <keescook@...omium.org>, linux-media@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] media: v4l2-ioctl: fix function types for
IOCTL_INFO_STD
On 05/08/2018 07:17 PM, Sami Tolvanen wrote:
> On Tue, May 08, 2018 at 10:18:24AM +0200, Hans Verkuil wrote:
>> Just call this v4l_stub_g_fbuf, conform the naming of the other functions.
>>
>> So just replace vidioc_ by v4l_stub_ in all these DEFINE_IOCTL_FNC macros.
>>
>> This way the function name in the big array matches the name in this macro,
>> and the 'stub' part indicates that it is just a stub function.
>
> vidioc_ is actually part of the function name in struct v4l2_ioctl_ops,
I'm stupid, I should have seen that.
> which the stub needs to call. I can change the stub name to start with
> v4l_stub_, but if you prefer to drop vidioc_ entirely from the name,
> the macro still wouldn't end up matching the array. It would have to be
> something like this:
>
> #define DEFINE_IOCTL_FNC(_vidioc) \
> static int v4l_stub_ ## _vidioc( \
> ...
> return ops->vidioc_ ## _vidioc(file, fh, p); \
> ...
> DEFINE_IOCTL_FNC(g_fbuf)
> ...
> static struct v4l2_ioctl_info v4l2_ioctls[] = {
> ...
> IOCTL_INFO(VIDIOC_G_FBUF, v4l_stub_g_fbuf, ...),
This looks good, I would just rename DEFINE_IOCTL_FNC to DEFINE_V4L_STUB_FUNC.
This makes it clear that it defines a v4l stub function.
Regards,
Hans
Powered by blists - more mailing lists