Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1519137
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 06/11] [media] dib0700: fix nec repeat handling |
| Date | 2016-11-10 17:50 +0100 |
| Message-ID | <sC0I2-h7-17@gated-at.bofh.it> (permalink) |
| References | <sC0I2-h7-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Sean Young <sean@mess.org>
When receiving a nec repeat, ensure the correct scancode is repeated
rather than a random value from the stack. This removes the need
for the bogus uninitialized_var() and also fixes the warnings:
drivers/media/usb/dvb-usb/dib0700_core.c: In function ‘dib0700_rc_urb_completion’:
drivers/media/usb/dvb-usb/dib0700_core.c:679: warning: ‘protocol’ may be used uninitialized in this function
[sean addon: So after writing the patch and submitting it, I've bought the
hardware on ebay. Without this patch you get random scancodes
on nec repeats, which the patch indeed fixes.]
Signed-off-by: Sean Young <sean@mess.org>
Tested-by: Sean Young <sean@mess.org>
Cc: stable@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/media/usb/dvb-usb/dib0700_core.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/media/usb/dvb-usb/dib0700_core.c b/drivers/media/usb/dvb-usb/dib0700_core.c
index 92d5408..47ce9d5 100644
--- a/drivers/media/usb/dvb-usb/dib0700_core.c
+++ b/drivers/media/usb/dvb-usb/dib0700_core.c
@@ -704,7 +704,7 @@ static void dib0700_rc_urb_completion(struct urb *purb)
struct dvb_usb_device *d = purb->context;
struct dib0700_rc_response *poll_reply;
enum rc_type protocol;
- u32 uninitialized_var(keycode);
+ u32 keycode;
u8 toggle;
deb_info("%s()\n", __func__);
@@ -745,7 +745,8 @@ static void dib0700_rc_urb_completion(struct urb *purb)
poll_reply->nec.data == 0x00 &&
poll_reply->nec.not_data == 0xff) {
poll_reply->data_state = 2;
- break;
+ rc_repeat(d->rc_dev);
+ goto resubmit;
}
if ((poll_reply->nec.data ^ poll_reply->nec.not_data) != 0xff) {
--
2.9.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 00/11] getting back -Wmaybe-uninitialized Arnd Bergmann <arnd@arndb.de> - 2016-11-10 17:50 +0100
[PATCH v2 01/11] Kbuild: enable -Wmaybe-uninitialized warning for "make W=1" Arnd Bergmann <arnd@arndb.de> - 2016-11-10 17:50 +0100
[PATCH v2 06/11] [media] dib0700: fix nec repeat handling Arnd Bergmann <arnd@arndb.de> - 2016-11-10 17:50 +0100
[PATCH v2 10/11] pcmcia: fix return value of soc_pcmcia_regulator_set Arnd Bergmann <arnd@arndb.de> - 2016-11-10 17:50 +0100
[PATCH v2 07/11] [media] rc: print correct variable for z8f0811 Arnd Bergmann <arnd@arndb.de> - 2016-11-10 17:50 +0100
[PATCH v2 08/11] crypto: aesni: shut up -Wmaybe-uninitialized warning Arnd Bergmann <arnd@arndb.de> - 2016-11-10 17:50 +0100
[PATCH v2 02/11] NFSv4.1: work around -Wmaybe-uninitialized warning Arnd Bergmann <arnd@arndb.de> - 2016-11-10 17:50 +0100
[PATCH v2 11/11] Kbuild: enable -Wmaybe-uninitialized warnings by default Arnd Bergmann <arnd@arndb.de> - 2016-11-10 17:50 +0100
[PATCH v2 09/11] [v3] infiniband: shut up a maybe-uninitialized warning Arnd Bergmann <arnd@arndb.de> - 2016-11-10 18:00 +0100
[PATCH v2 03/11] x86: apm: avoid uninitialized data Arnd Bergmann <arnd@arndb.de> - 2016-11-10 18:00 +0100
Re: [PATCH v2 00/11] getting back -Wmaybe-uninitialized Linus Torvalds <torvalds@linux-foundation.org> - 2016-11-11 18:20 +0100
Re: [PATCH v2 00/11] getting back -Wmaybe-uninitialized Arnd Bergmann <arnd@arndb.de> - 2016-11-11 21:00 +0100
csiph-web