From: Hans Verkuil <hansverk@cisco.com>
To: Prabhakar Lad <prabhakar.csengg@gmail.com>
Cc: LMML <linux-media@vger.kernel.org>,
Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [PATCH] v4l2-compliance: fix function pointer prototype
Date: Tue, 01 Apr 2014 16:26:00 +0200 [thread overview]
Message-ID: <533ACC78.8000102@cisco.com> (raw)
In-Reply-To: <CA+V-a8vcXgMW8EURZn25rfOrmyRMb4MNVbb5FuGn2J-pumSXGg@mail.gmail.com>
On 04/01/14 16:06, Prabhakar Lad wrote:
> Hi Hans,
>
> On Tue, Apr 1, 2014 at 7:20 PM, Hans Verkuil <hansverk@cisco.com> wrote:
>> Hi Prabhakar,
>>
>> On 04/01/14 15:45, Lad, Prabhakar wrote:
>>> From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
>>>
>>> There was a conflict between the mmap function pointer prototype of
>>> struct v4l_fd and the actual function used. Make sure it is in sync
>>> with the prototype of v4l2_mmap.
>>
>> The prototype of v4l2_mmap uses int64_t, so I don't understand this
>> patch.
>>
> Actual prototype of mmap is,
>
> void *mmap(void *addr, size_t length, int prot, int flags, int fd,
> off_t offset);
>
> But where as the prototype in v4l_fd mmap the last parameter type is int64_t
> but that should have been off_t and same applies with test_mmap().
The problem is that v4l2_mmap (in lib/include/libv4l2.h) uses int64_t.
So the function pointer uses int64_t as well as does test_mmap.
I don't see how the current v4l-utils tree can cause a compile error.
For the record, I know you can't assign mmap to fd->mmap, you would
have to make a wrapper. Unfortunately mmap and v4l2_mmap do not have
the same prototype and I had to pick one (I'm not sure why they don't
use the same prototype).
Most applications would typically have to use v4l2_mmap, so I went with
that one.
Regards,
Hans
next prev parent reply other threads:[~2014-04-01 14:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-01 13:45 [PATCH] v4l2-compliance: fix function pointer prototype Lad, Prabhakar
2014-04-01 13:50 ` Hans Verkuil
2014-04-01 14:06 ` Prabhakar Lad
2014-04-01 14:26 ` Hans Verkuil [this message]
2014-04-01 14:42 ` Hans Verkuil
2014-04-01 14:48 ` Prabhakar Lad
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=533ACC78.8000102@cisco.com \
--to=hansverk@cisco.com \
--cc=hans.verkuil@cisco.com \
--cc=linux-media@vger.kernel.org \
--cc=prabhakar.csengg@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).