From patchwork Mon Jul 4 13:21:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9212647 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D26FC60572 for ; Mon, 4 Jul 2016 13:19:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C3AD9286F7 for ; Mon, 4 Jul 2016 13:19:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B5D68286F9; Mon, 4 Jul 2016 13:19:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C894286F7 for ; Mon, 4 Jul 2016 13:19:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753797AbcGDNT0 (ORCPT ); Mon, 4 Jul 2016 09:19:26 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:62794 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753734AbcGDNTZ (ORCPT ); Mon, 4 Jul 2016 09:19:25 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0M8iqK-1bA8hL2cZg-00C8gn; Mon, 04 Jul 2016 15:19:15 +0200 From: Arnd Bergmann To: Hans de Goede Cc: Arnd Bergmann , Mauro Carvalho Chehab , Leandro Costantino , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [media] gspca: avoid unused variable warnings Date: Mon, 4 Jul 2016 15:21:40 +0200 Message-Id: <20160704132212.1166461-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:0uQ1UHQWJoehvwVhFYNy100mAXh63q5pGhM6NIpNXi9Fqq0r2M7 ixWXcTSUIjIYDcbh9DULXGDLOQna/v9zIWIFd8Laed7ixFBY85VP3PxI51CGCL1u8gLzuJK GByjWBTIwMg17pSVALhurqCHHHQuZTdbf+3dvdhC9GJo3Y7O9nfwFTx3GJ8oPsvY6RujnrT Wzt/wg4NHFv7q3UR8gGtw== X-UI-Out-Filterresults: notjunk:1; V01:K0:1esWND4kiWI=:kqePOedoP24SxscoT35w16 ZaER0GqohtmLZfpOl+H5A1hOC8ZrfaAKr/GNnM3HGJ7QhbziENZ/ZgmM0SELmdLkDB4EsJ58O +5pkH/SqTdYsUMe49Uk8n6j1aqYfdMj7aboGq1dJnzLeiNlGjCvwl9tUEFavbcd12sNU8Xyd2 TaYBybU7A26U23K2F8FsaLCppCaEh4hb2DYPrbJF1zyxrs2rXToVj4QQO3hcObICUI6O43SVo 34X5JSzZJREz//MnDlGHZ05ktYarymr9wLGXE/CUp93GO+gB3mCI4s4OlyGPCdT15LfcwB9J6 x/+4X/+ckl5NoUb26BtdWnDanOkTr6C1x30bOeKeJphvbmmJhDA68u8VDdqJ03lsd1vN4DvPq qiahFor/e8omr6Hn1rlh0MrkSBbLLPVyoQ01JtssTo1L4dgUkKpi5vVDPDF7q/m4noPGoxCDI FGs1epg98XR03aH+uqlXpKBTKqaqXhAPViZEYzBNXCN7tAeAwDivG5DiN9GwK5+Ce8f+lZfaB nIqpB4laGqIms+G+EAc//zCw+QF+3hWRhvb9r1oAlm32pfrRjF5oZtPsC+Gy0nO5BSBARBDH5 iRod5QR4NPj52z8Dl6Dy6UCrV48S5F3TwSPSP/CZRBLO6r+recCiuP1zgCLTTyySYljtB/L0N CWdKH/BQkfOSfLWJn8vYGwz7h+RD3RBypMyMGaC1rZkny4wQ49zwjkIHnhSOmBwil6+8= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.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 annotates the variables as __maybe_unused, to let the compiler know that they are declared intentionally. 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") --- This is one of two approaches to avoid the warning, please pick either this or the other one. Signed-off-by: Arnd Bergmann --- drivers/media/usb/gspca/cpia1.c | 2 +- drivers/media/usb/gspca/konica.c | 2 +- drivers/media/usb/gspca/t613.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb/gspca/cpia1.c b/drivers/media/usb/gspca/cpia1.c index f23df4a9d8c5..52b88e9e656b 100644 --- a/drivers/media/usb/gspca/cpia1.c +++ b/drivers/media/usb/gspca/cpia1.c @@ -1624,7 +1624,7 @@ static int sd_start(struct gspca_dev *gspca_dev) static void sd_stopN(struct gspca_dev *gspca_dev) { - struct sd *sd = (struct sd *) gspca_dev; + struct sd *sd __maybe_unused = (struct sd *) gspca_dev; command_pause(gspca_dev); diff --git a/drivers/media/usb/gspca/konica.c b/drivers/media/usb/gspca/konica.c index 39c96bb4c985..0712b1bc90b4 100644 --- a/drivers/media/usb/gspca/konica.c +++ b/drivers/media/usb/gspca/konica.c @@ -243,7 +243,7 @@ static int sd_start(struct gspca_dev *gspca_dev) static void sd_stopN(struct gspca_dev *gspca_dev) { - struct sd *sd = (struct sd *) gspca_dev; + struct sd *sd __maybe_unused = (struct sd *) gspca_dev; 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..bb52fc1fe598 100644 --- a/drivers/media/usb/gspca/t613.c +++ b/drivers/media/usb/gspca/t613.c @@ -837,7 +837,7 @@ 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; + struct sd *sd __maybe_unused = (struct sd *) gspca_dev; int pkt_type; if (data[0] == 0x5a) {