From patchwork Thu Nov 10 16:44:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9421571 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 EE0D260512 for ; Thu, 10 Nov 2016 16:50:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2F912976F for ; Thu, 10 Nov 2016 16:50:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E76F329778; Thu, 10 Nov 2016 16:50:15 +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.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham 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 9317A2976F for ; Thu, 10 Nov 2016 16:50:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935241AbcKJQqv (ORCPT ); Thu, 10 Nov 2016 11:46:51 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:51312 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935157AbcKJQqr (ORCPT ); Thu, 10 Nov 2016 11:46:47 -0500 Received: from wuerfel.lan ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.129]) with ESMTPA (Nemesis) id 0LaOEx-1cX2M51GpT-00mKca; Thu, 10 Nov 2016 17:45:42 +0100 From: Arnd Bergmann To: Linus Torvalds Cc: Andrew Morton , Arnd Bergmann , Anna Schumaker , "David S. Miller" , Herbert Xu , Ilya Dryomov , Javier Martinez Canillas , Jiri Kosina , Jonathan Cameron , Ley Foon Tan , "Luis R . Rodriguez" , Martin Schwidefsky , Mauro Carvalho Chehab , Michal Marek , Russell King , Sean Young , Sebastian Ott , Trond Myklebust , x86@kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, nios2-dev@lists.rocketboards.org, linux-s390@vger.kernel.org, linux-crypto@vger.kernel.org, linux-media@vger.kernel.org, linux-nfs@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH v2 06/11] [media] dib0700: fix nec repeat handling Date: Thu, 10 Nov 2016 17:44:49 +0100 Message-Id: <20161110164454.293477-7-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161110164454.293477-1-arnd@arndb.de> References: <20161110164454.293477-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K0:Z8dtucaPuovvaTgsujmonRFwzTBaPXMFJIUYwEyb9FBMUtGnPEU TzWuTLGzmf1YhA3lTkEXIb3c9fCOQPibYnl7hU6e0dXhbBOS1KFIvFZh+68WVgCffcefYLP b5n/vqFWDvzIbxSAChbI1biwMzMniNDOh9XjuZAe5Gvgyz6upEvEU1qFk3O1DJjYvgGZ5kU sofbrT66udn0W76N30YqQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:RxhRhWDnlPM=:seil0rfM4ijr86nUjQKIKT lteCuxBBoZBaYwD5rp+am+kIOJYcKeZ/j7bJwXz1i3yhtTVWy0Xbe7WZkQ9q+7Kb8PkFAaYVE cK+nmALoj65xzU+as+1W8W8WSn8IbuwOkony336cd3LAU4sT4lhMxXgO7Y6rc958CcRLxSf+M Lx9MPfr7FcWG0FZ6I32mlaTC1F1CY6GT6mzNFqZQcZ6ORY8KBgSR0NnrV8NErG1uOF2MFZDpV X11kQjzbUwgub7+Px6KP0wdipvpUSKgp4f0O8sqvwTpRWU92J56mbKG7jl/QQ/XZsK4lFqNwn vnQaP48kz+29BFExI1F96ebvj6KOyFBCrxe5VGG5/PRkpV6woqwrBMSqMGlP7s+CDZOhBHbvN Vgnig8v5fQg47IimVHZ+Ug0r3aUnP23gDXgpOU99rdi0qSHBfsGm2d1NEzyxkUhOB/aOgr99T wqpqYI4Zs2r8pb317jRiFH6NGG9dUDySR4fPdph2ewf18pVI6CfJr1rmQZiqnsH30QXM6rgOA TLpDS930fP4XzspWv7MjoeguaVLto3i6wHRssEOpb8xMpH6stQCe9mn6+GC5s/7JHNoA0tYkQ GqJ2eQq35HwoCA/r3PmmdGf5QpQ5nai3GdUjc69/FCOZ3IWk/3xTHZwV8O/DbbMKXw3Oyj9nF xbWl+iprdqq31JRbtV2S49o1sVd4oEGeN3xXtBZhnEarbxr8VQjQ7IltoEuhnf+lcuYj+5CO1 iWrr+c0PEW9Nf0LV 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 From: Sean Young 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 Tested-by: Sean Young Cc: stable@vger.kernel.org Signed-off-by: Arnd Bergmann --- 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) {