From: "Justin P. Mattock" <justinmattock@gmail.com>
To: Jean-Francois Moine <moinejf@free.fr>
Cc: linux-media@vger.kernel.org, mchehab@infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH]video:gspca.c Fix warning: case value '7' not in enumerated type 'enum v4l2_memory'
Date: Thu, 08 Jul 2010 00:21:00 -0700 [thread overview]
Message-ID: <4C357C5C.8010602@gmail.com> (raw)
In-Reply-To: <20100708084010.6a15f8c3@tele>
On 07/07/2010 11:40 PM, Jean-Francois Moine wrote:
> On Wed, 7 Jul 2010 21:46:18 -0700
> "Justin P. Mattock"<justinmattock@gmail.com> wrote:
>
>> This fixes a warning I'm seeing when building:
>> CC [M] drivers/media/video/gspca/gspca.o
>> drivers/media/video/gspca/gspca.c: In function 'vidioc_reqbufs':
>> drivers/media/video/gspca/gspca.c:1508:2: warning: case value '7' not
>> in enumerated type 'enum v4l2_memory'
>
> Hi Justin,
>
> I don't agree with your patch: the value GSPCA_MEMORY_READ must not be
> seen by user applications.
>
> The warning may be simply fixed by (change the line numbers):
>
> --- gspca.c~ 2010-07-08 08:15:14.000000000 +0200
> +++ gspca.c 2010-07-08 08:28:52.000000000 +0200
> @@ -1467,7 +1467,8 @@ static int vidioc_reqbufs(struct file *f
> struct gspca_dev *gspca_dev = priv;
> int i, ret = 0, streaming;
>
> - switch (rb->memory) {
> + i = rb->memory; /* (avoid compilation warning) */
> + switch (i) {
> case GSPCA_MEMORY_READ: /* (internal call) */
> case V4L2_MEMORY_MMAP:
> case V4L2_MEMORY_USERPTR:
>
> Cheers.
>
o.k. buddy.. make sense with the userspace etc..
Anyways looks good, builds without a warning..
Tested-By: Justin P. Mattock <justinmattock@gmail.com>
cheers as well,
Justin P. Mattock
prev parent reply other threads:[~2010-07-08 7:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-08 4:46 [PATCH]video:gspca.c Fix warning: case value '7' not in enumerated type 'enum v4l2_memory' Justin P. Mattock
2010-07-08 6:40 ` Jean-Francois Moine
2010-07-08 7:21 ` Justin P. Mattock [this message]
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=4C357C5C.8010602@gmail.com \
--to=justinmattock@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=moinejf@free.fr \
/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