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: 693336 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tF88d1db9z9vDt for ; Fri, 11 Nov 2016 03:46:57 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c4sV5-0003hh-HL; Thu, 10 Nov 2016 16:46:55 +0000 Received: from mout.kundenserver.de ([212.227.126.187]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c4sUm-0003IH-8D for linux-snps-arc@lists.infradead.org; Thu, 10 Nov 2016 16:46:39 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161110_084636_835222_758303A5 X-CRM114-Status: GOOD ( 12.96 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.126.187 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.126.187 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sean Young , Trond Myklebust , linux-s390@vger.kernel.org, Herbert Xu , x86@kernel.org, Sebastian Ott , Russell King , Javier Martinez Canillas , Ilya Dryomov , linux-snps-arc@lists.infradead.org, linux-media@vger.kernel.org, Arnd Bergmann , linux-kbuild@vger.kernel.org, Jiri Kosina , Michal Marek , nios2-dev@lists.rocketboards.org, Mauro Carvalho Chehab , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Anna Schumaker , "Luis R . Rodriguez" , linux-crypto@vger.kernel.org, Martin Schwidefsky , Ley Foon Tan , Andrew Morton , "David S. Miller" , Jonathan Cameron Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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) {