public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Pawel Osciak <pawel@osciak.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	"Andrzej Pietrasiewicz/Poland R&D Center-Linux/./????"
	<andrzej.p@samsung.com>,
	linux-media@vger.kernel.org
Subject: Re: [GIT PATCHES FOR 2.6.38] Videbuf2 framework, NOON010PC30 sensor driver and s5p-fimc updates
Date: Thu, 13 Jan 2011 10:18:17 -0200	[thread overview]
Message-ID: <4D2EED89.9090900@redhat.com> (raw)
In-Reply-To: <AANLkTikt69vKoiMkVjxi877GTLjwmbw=i07Abts6G+-9@mail.gmail.com>

Em 13-01-2011 01:05, Pawel Osciak escreveu:
> Hi Mauro,
> 
> On Wed, Jan 12, 2011 at 10:49, Mauro Carvalho Chehab <mchehab@redhat.com> wrote:
>> Em 12-01-2011 08:25, Marek Szyprowski escreveu:
>>> Hello Mauro,
>>>
>>> I've rebased our fimc and saa patches onto http://linuxtv.org/git/mchehab/experimental.git
>>> vb2_test branch.
>>
>> Thanks!
>>
>> As before, I'll be commenting the patches as I'll be seeing any issues.
>>
>>> Pawel Osciak (2):
>>>       Fix mmap() example in the V4L2 API DocBook
>>
>> In fact, the check for retval < 0 instead of retval == -1 is not a fix. According with
>> mmap man pages:
>>        RETURN VALUE
>>               On  success,  mmap() returns a pointer to the mapped area.  On error, the value MAP_FAILED (that is, (void *) -1) is returned, and errno
>>               is set appropriately.  On success, munmap() returns 0, on failure -1, and errno is set (probably to EINVAL).
>>
>> The change is not wrong, as -1 is lower than 0, but using -1 is more compliant with
>> libc. So, I'll be applying just the CodingStyle fixes on it.
> 
> Sorry, but I think you got it wrong. The example is called "mmap()
> example". But I did not change return value checking of mmap() calls.
> I changed return value checking of ioctl() calls. So I believe the
> patch is correct.

>From ioctl man page:

RETURN VALUE
       Usually, on success zero is returned.  A few ioctl() requests  use  the
       return  value as an output parameter and return a non-negative value on
       success.  On error, -1 is returned, and errno is set appropriately.

So, at least on glibc, it will return -1 for errors, storing the error code at errno
var, and 0 for OK.

Several V4L2 applications do error checks with -1. So, if some non-glibc implementation
is returning a different return value, that means that several V4L applications will
not work properly. Do you know any case where ioctl is implemented on a different way?

Cheers,
Mauro.

  reply	other threads:[~2011-01-13 12:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-03 16:48 [GIT PATCHES FOR 2.6.38] Videbuf2 framework, NOON010PC30 sensor driver and s5p-fimc updates Sylwester Nawrocki
2011-01-11 18:23 ` Mauro Carvalho Chehab
2011-01-11 16:42   ` Pawel Osciak
2011-01-11 19:06     ` Mauro Carvalho Chehab
2011-01-11 20:19 ` Mauro Carvalho Chehab
2011-01-12 10:25   ` Marek Szyprowski
2011-01-12 18:49     ` Mauro Carvalho Chehab
2011-01-13  3:05       ` Pawel Osciak
2011-01-13 12:18         ` Mauro Carvalho Chehab [this message]
2011-01-12 20:23     ` Mauro Carvalho Chehab
2011-01-13  8:46       ` Andrzej Pietrasiewicz
2011-01-13 12:13         ` Andrzej Pietrasiewicz
2011-01-13 13:04           ` Mauro Carvalho Chehab
2011-01-13 12:58         ` Mauro Carvalho Chehab
2011-01-16 15:11           ` Mauro Carvalho Chehab
2011-01-11 21:31 ` Mauro Carvalho Chehab
2011-01-11 21:57 ` Mauro Carvalho Chehab
2011-01-12  2:47   ` Pawel Osciak
2011-01-12 16:19   ` Sylwester Nawrocki
2011-01-11 22:08 ` Mauro Carvalho Chehab

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=4D2EED89.9090900@redhat.com \
    --to=mchehab@redhat.com \
    --cc=andrzej.p@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=pawel@osciak.com \
    --cc=s.nawrocki@samsung.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