From: Hans de Goede <hdegoede@redhat.com> To: Arnd Bergmann <arnd@arndb.de>, Mauro Carvalho Chehab <mchehab@osg.samsung.com> Cc: linux-arm-kernel@lists.infradead.org, Hans Verkuil <hans.verkuil@cisco.com>, Leandro Costantino <lcostantino@gmail.com>, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [3/7,media] gspca: avoid unused variable warnings Date: Sun, 3 Jul 2016 23:22:40 +0200 [thread overview] Message-ID: <aa137f3d-3f15-b2b3-78ce-eea3887394d4@redhat.com> (raw) In-Reply-To: <1453817424-3080054-3-git-send-email-arnd@arndb.de> Hi Arnd, On 26-01-16 15:09, Arnd Bergmann wrote: > 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 <arnd@arndb.de> > 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") Sorry for being super slow to respond to this patch, can you please do a new version using __maybe_unused instead of adding #ifdef-s ? Thanks, Hans > --- > 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) { >
WARNING: multiple messages have this Message-ID (diff)
From: hdegoede@redhat.com (Hans de Goede) To: linux-arm-kernel@lists.infradead.org Subject: [3/7,media] gspca: avoid unused variable warnings Date: Sun, 3 Jul 2016 23:22:40 +0200 [thread overview] Message-ID: <aa137f3d-3f15-b2b3-78ce-eea3887394d4@redhat.com> (raw) In-Reply-To: <1453817424-3080054-3-git-send-email-arnd@arndb.de> Hi Arnd, On 26-01-16 15:09, Arnd Bergmann wrote: > 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 <arnd@arndb.de> > 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") Sorry for being super slow to respond to this patch, can you please do a new version using __maybe_unused instead of adding #ifdef-s ? Thanks, Hans > --- > 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) { >
next prev parent reply other threads:[~2016-07-03 21:23 UTC|newest] Thread overview: 36+ 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 2016-01-26 14:09 ` [PATCH 2/7] [media] hdpvr: hide unused variable Arnd Bergmann 2016-01-26 14:09 ` Arnd Bergmann 2016-01-26 14:09 ` [PATCH 3/7] [media] gspca: avoid unused variable warnings Arnd Bergmann 2016-01-26 14:09 ` Arnd Bergmann 2016-07-03 21:22 ` Hans de Goede [this message] 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 ` 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:09 ` Arnd Bergmann 2016-01-26 14:10 ` [PATCH 6/7] [media] em28xx: add MEDIA_TUNER dependency Arnd Bergmann 2016-01-26 14:10 ` Arnd Bergmann 2016-01-26 14:33 ` Mauro Carvalho Chehab 2016-01-26 14:33 ` Mauro Carvalho Chehab 2016-01-26 15:53 ` Arnd Bergmann 2016-01-26 15:53 ` Arnd Bergmann 2016-01-26 16:36 ` Mauro Carvalho Chehab 2016-01-26 16:36 ` Mauro Carvalho Chehab 2016-01-26 16:51 ` Arnd Bergmann 2016-01-26 16:51 ` Arnd Bergmann 2016-01-26 17:08 ` Mauro Carvalho Chehab 2016-01-26 17:08 ` Mauro Carvalho Chehab 2016-01-26 22:01 ` Arnd Bergmann 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 14:10 ` Arnd Bergmann 2016-01-26 15:04 ` Mauro Carvalho Chehab 2016-01-26 15:04 ` Mauro Carvalho Chehab 2016-01-26 15:41 ` 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 14:40 ` kbuild test robot 2016-01-26 15:29 ` Arnd Bergmann 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=aa137f3d-3f15-b2b3-78ce-eea3887394d4@redhat.com \ --to=hdegoede@redhat.com \ --cc=arnd@arndb.de \ --cc=hans.verkuil@cisco.com \ --cc=lcostantino@gmail.com \ --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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.