From patchwork Thu Jul 8 06:40:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Francois Moine X-Patchwork-Id: 3747 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Thu, 08 Jul 2010 06:40:17 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.17) for (single-drop); Thu, 08 Jul 2010 09:37:38 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OWkmO-0003b9-Rd; Thu, 08 Jul 2010 06:40:17 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753858Ab0GHGjw (ORCPT + 1 other); Thu, 8 Jul 2010 02:39:52 -0400 Received: from smtp5-g21.free.fr ([212.27.42.5]:44122 "EHLO smtp5-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752094Ab0GHGjw convert rfc822-to-8bit (ORCPT ); Thu, 8 Jul 2010 02:39:52 -0400 Received: from tele (unknown [82.245.201.222]) by smtp5-g21.free.fr (Postfix) with ESMTP id D2CB1D48042; Thu, 8 Jul 2010 08:39:43 +0200 (CEST) Date: Thu, 8 Jul 2010 08:40:10 +0200 From: Jean-Francois Moine To: "Justin P. Mattock" 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' Message-ID: <20100708084010.6a15f8c3@tele> In-Reply-To: <1278564378-19855-1-git-send-email-justinmattock@gmail.com> References: <1278564378-19855-1-git-send-email-justinmattock@gmail.com> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Wed, 7 Jul 2010 21:46:18 -0700 "Justin P. Mattock" 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): Cheers. Tested-By: Justin P. Mattock --- 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: