public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Hans Verkuil <hverkuil@xs4all.nl>,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: linux-arm-kernel@lists.infradead.org,
	Arnd Bergmann <arnd@arndb.de>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/7] [media] hdpvr: hide unused variable
Date: Tue, 26 Jan 2016 15:09:56 +0100	[thread overview]
Message-ID: <1453817424-3080054-2-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1453817424-3080054-1-git-send-email-arnd@arndb.de>

The i2c client pointer is only used when CONFIG_I2C is set, and
otherwise produces a compile-time warning:

drivers/media/usb/hdpvr/hdpvr-core.c: In function 'hdpvr_probe':
drivers/media/usb/hdpvr/hdpvr-core.c:276:21: error: unused variable 'client' [-Werror=unused-variable]

This uses the same #ifdef to hide the variable when the code using
it is hidden.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/media/usb/hdpvr/hdpvr-core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/usb/hdpvr/hdpvr-core.c b/drivers/media/usb/hdpvr/hdpvr-core.c
index 3fc64197b4e6..08f0ca7aa012 100644
--- a/drivers/media/usb/hdpvr/hdpvr-core.c
+++ b/drivers/media/usb/hdpvr/hdpvr-core.c
@@ -273,7 +273,9 @@ static int hdpvr_probe(struct usb_interface *interface,
 	struct hdpvr_device *dev;
 	struct usb_host_interface *iface_desc;
 	struct usb_endpoint_descriptor *endpoint;
+#if IS_ENABLED(CONFIG_I2C)
 	struct i2c_client *client;
+#endif
 	size_t buffer_size;
 	int i;
 	int retval = -ENOMEM;
-- 
2.7.0


  reply	other threads:[~2016-01-26 14:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-26 14:09 [PATCH 1/7] [media] pwc: hide unused label Arnd Bergmann
2016-01-26 14:09 ` Arnd Bergmann [this message]
2016-01-26 14:09 ` [PATCH 3/7] [media] gspca: avoid unused variable warnings Arnd Bergmann
2016-07-03 21:22   ` [3/7,media] " Hans de Goede
2016-01-26 14:09 ` [PATCH 4/7] [media] b2c2: flexcop: avoid unused function warnings Arnd Bergmann
2016-01-26 14:09 ` [PATCH 5/7] [media] em28xx: only use mt9v011 if camera support is enabled Arnd Bergmann
2016-01-26 14:10 ` [PATCH 6/7] [media] em28xx: add MEDIA_TUNER dependency Arnd Bergmann
2016-01-26 14:33   ` Mauro Carvalho Chehab
2016-01-26 15:53     ` Arnd Bergmann
2016-01-26 16:36       ` Mauro Carvalho Chehab
2016-01-26 16:51         ` Arnd Bergmann
2016-01-26 17:08           ` Mauro Carvalho Chehab
2016-01-26 22:01             ` Arnd Bergmann
2016-01-26 14:10 ` [PATCH 7/7] [media] go7007: add MEDIA_CAMERA_SUPPORT dependency Arnd Bergmann
2016-01-26 15:04   ` Mauro Carvalho Chehab
2016-01-26 15:41     ` Mauro Carvalho Chehab
2016-01-26 14:40 ` [PATCH 1/7] [media] pwc: hide unused label kbuild test robot
2016-01-26 15:29 ` Arnd Bergmann

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=1453817424-3080054-2-git-send-email-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=hans.verkuil@cisco.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.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