From patchwork Tue Jan 26 14:09:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 8123051 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 76C78BEEE5 for ; Tue, 26 Jan 2016 14:12:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A044920259 for ; Tue, 26 Jan 2016 14:12:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B112720222 for ; Tue, 26 Jan 2016 14:11:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757309AbcAZOLp (ORCPT ); Tue, 26 Jan 2016 09:11:45 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:54839 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757136AbcAZOLn (ORCPT ); Tue, 26 Jan 2016 09:11:43 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0M4I0B-1a5iGp2CAt-00roXA; Tue, 26 Jan 2016 15:11:04 +0100 From: Arnd Bergmann To: Hans de Goede , Mauro Carvalho Chehab Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Hans Verkuil , Leandro Costantino , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/7] [media] gspca: avoid unused variable warnings Date: Tue, 26 Jan 2016 15:09:57 +0100 Message-Id: <1453817424-3080054-3-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1453817424-3080054-1-git-send-email-arnd@arndb.de> References: <1453817424-3080054-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:CguCPt/JTmi/dwxI6iPwVVeLBkn5F1EfuYe/mpByaXLEsj/myT/ YiGwyf+UkfQy0yYRLlNOt1RcocdhQjh8TrcDI1Fh4NJZwK8b+eNEsaJT8/Ma1xc98Z8ph4l p/Ra6HiR51BqoUbowt5XkONLGFchZvf9BH4NcZIUiUsRLxwsVD/RuDDhGBqmevRyUpSChjf dcdABV35jXeC+r67OBJhw== X-UI-Out-Filterresults: notjunk:1; V01:K0:0+OLaIuJP84=:2V4NMBu7rTJqp9qJMEh10X qPQRImFmY3dqI6EK0i377lLYgSQcS1iP98CNRHAXd7gs/7eNbZniSXudupbzPExWKSejLlJsD 3w+tYznoqDagIXXwLzdh4bPHgymHoaFiFuOwdYXdS04Mzpnv4MGFqtZETu031Qz7CNS0k3a7m ZvzoL4bF97Lwt1JK7NFJw8T63f2Uy57md1W/M0cVKzatJ6VXsUb4tfpi5SteM6jYm0NnJgNue 883g20ogpzzeqq6UqYQ2LkdhXOougIJzwBEuEdJPxu1zM7rV8mAObGH0x9bokPOQLl5wsWIJC iYdisDxa/OAV0WEl/mFO3Judv0XzaRi8OJoWBl+Me0gVaNR1ml3fg9I26VGjQ0KZyY7Z4aG7P B8j9bMwCShPtVq44KHuZdxYaRc+T+RB67JA5u84gUSKRL7Ylfq6ihaKBRufG41jjfgwc6XYYf 1rVQRB9/qQMW0MY6skI+v2fYtbi4P8bKjR/zgYuxbNuedURwaJv/MEUpbpxqa/p/EVP9QS0Hq 6TQzWIimG0GPYLiLpn9WCR0lHWm1SGJuSHcTe+ZA97zQcxxiqft9dZsjUtzYsH57F1aX3IDC2 Z8z23t+kONlJtKgPeIZ1e2muu0mQPMyP/3yhaqmebwmdP5rsqH0viBw2n5lWceZCVt86/3S5J DyJvSqrnD9rbWdo3RZYm0s+Q9vYHjUPgKquIdC5q1qOd3hE48eyVsa5Udw/u6y2uK4Bo= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When CONFIG_INPUT is disabled, multiple gspca backend drivers print compile-time warnings about unused variables: media/usb/gspca/cpia1.c: In function 'sd_stopN': media/usb/gspca/cpia1.c:1627:13: error: unused variable 'sd' [-Werror=unused-variable] media/usb/gspca/konica.c: In function 'sd_stopN': media/usb/gspca/konica.c:246:13: error: unused variable 'sd' [-Werror=unused-variable] This encloses the declarations in #ifdef CONFIG_INPUT, just like the code using them is. Signed-off-by: Arnd Bergmann Fixes: ee186fd96a5f ("[media] gscpa_t613: Add support for the camera button") Fixes: c2f644aeeba3 ("[media] gspca_cpia1: Add support for button") Fixes: b517af722860 ("V4L/DVB: gspca_konica: New gspca subdriver for konica chipset using cams") --- drivers/media/usb/gspca/cpia1.c | 2 ++ drivers/media/usb/gspca/konica.c | 2 ++ drivers/media/usb/gspca/t613.c | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/gspca/cpia1.c b/drivers/media/usb/gspca/cpia1.c index f23df4a9d8c5..e2264dc5d64d 100644 --- a/drivers/media/usb/gspca/cpia1.c +++ b/drivers/media/usb/gspca/cpia1.c @@ -1624,7 +1624,9 @@ static int sd_start(struct gspca_dev *gspca_dev) static void sd_stopN(struct gspca_dev *gspca_dev) { +#if IS_ENABLED(CONFIG_INPUT) struct sd *sd = (struct sd *) gspca_dev; +#endif command_pause(gspca_dev); diff --git a/drivers/media/usb/gspca/konica.c b/drivers/media/usb/gspca/konica.c index 39c96bb4c985..21c52655ef28 100644 --- a/drivers/media/usb/gspca/konica.c +++ b/drivers/media/usb/gspca/konica.c @@ -243,7 +243,9 @@ static int sd_start(struct gspca_dev *gspca_dev) static void sd_stopN(struct gspca_dev *gspca_dev) { +#if IS_ENABLED(CONFIG_INPUT) struct sd *sd = (struct sd *) gspca_dev; +#endif konica_stream_off(gspca_dev); #if IS_ENABLED(CONFIG_INPUT) diff --git a/drivers/media/usb/gspca/t613.c b/drivers/media/usb/gspca/t613.c index e2cc4e5a0ccb..d918c2d31502 100644 --- a/drivers/media/usb/gspca/t613.c +++ b/drivers/media/usb/gspca/t613.c @@ -837,11 +837,12 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, u8 *data, /* isoc packet */ int len) /* iso packet length */ { - struct sd *sd = (struct sd *) gspca_dev; int pkt_type; if (data[0] == 0x5a) { #if IS_ENABLED(CONFIG_INPUT) + struct sd *sd = (struct sd *) gspca_dev; + if (len > 20) { u8 state = (data[20] & 0x80) ? 1 : 0; if (sd->button_pressed != state) {