From patchwork Fri Oct 14 11:45:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9376467 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 6E35160865 for ; Fri, 14 Oct 2016 11:46:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F2D02A3AF for ; Fri, 14 Oct 2016 11:46:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 53F832A47C; Fri, 14 Oct 2016 11:46:06 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 E292B2A473 for ; Fri, 14 Oct 2016 11:46:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754296AbcJNLpo (ORCPT ); Fri, 14 Oct 2016 07:45:44 -0400 Received: from mout.web.de ([212.227.15.14]:51736 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754641AbcJNLpk (ORCPT ); Fri, 14 Oct 2016 07:45:40 -0400 Received: from [192.168.1.2] ([78.49.117.2]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0LpOOj-1cZrS41Osf-00fA3h; Fri, 14 Oct 2016 13:45:33 +0200 Subject: [PATCH 5/5] [media] winbond-cir: Move a variable assignment in two functions To: linux-media@vger.kernel.org, =?UTF-8?Q?David_H=c3=a4rdeman?= , Mauro Carvalho Chehab , Sean Young References: <566ABCD9.1060404@users.sourceforge.net> <1d7d6a2c-0f1e-3434-9023-9eab25bb913f@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <0b6de919-35a0-8ee3-9ea7-907c9b9a36f2@users.sourceforge.net> Date: Fri, 14 Oct 2016 13:45:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1d7d6a2c-0f1e-3434-9023-9eab25bb913f@users.sourceforge.net> X-Provags-ID: V03:K0:4UB0hFmsXr7elPtxMFnbcPhRG+cO1dueoLQhTXvLhKwx3aAdRzB kiiYCofTnREoPHWTclfZ0a61UC/Yity+nQW39qe43q0NUlnvxyuQdAwF2tYWRDw23Y5oxNI UxTwam+blRM4yWnEs1u7ghdEWbS7lZQkkqZVgaK15uIQw66ytUzzdp7JzuUPH73cf3WqWnX VhJoMAB5mP8lJJn4IWg9A== X-UI-Out-Filterresults: notjunk:1; V01:K0:vxPuc8UxQgc=:oDfLall9cZvausjbSoORv3 CtJZ+S4f5NK3TtenqzyvE8PmTY08hT0p0bmCHgcSSdE0m/lDg+zoGzxRSsBsvwd5i6Apmu5yQ zal6deMnvf6BpGaKYBsklocLVPSYPShcw717kv03DTA5V4nnXhUHR/qa/VEU2e/+Gf+cOqHjK X6s+cTakX6P+CBX+p/YRQqfhij40+uJHmOaqoekEYD2Any0lzkhK5ze7VX7OfA2w5MaXvJNAz Jl63uDsxratnvD1y8HSwm57TEwf2/np4N3kPdoP1nWIT5Psdx6UzCRb5OuSQ2XR8HfY8dWClC 9b++WUIxpZwvylHrj+9LOUET2M4dGzw0fp8AXE1fvgjkJkixZj5G+sKZC8h0DvHcHzFfZJBuP 4dvedtmHxgOxIz6xQsPqk22TxrE6sKJd1aR3na7OcdXJNyfe3bz96RnuygxIZ8fAHNmeknZWG uVMYWEzOZvjtusQNJ3tgeFQ4YyAXeS5vNKb6ep0emVtpQ1y4KqgiztpLYVDlCsT3dlfmHsTlT iCEAAUZQ1thsIck3X4CS409CYmOVBozmXlGgt4DRMApJKN/O52g+V7hQQ5tyzB3nS87oQFS9K +/eWbFGKHROs3MOE+fxvAKeMvo8iC7Ip+kLDhS4sKAuxM407s3BSxBbsGE1kEiVihmtozxY5W X1M0sOEOm4m/Tm/5KPKMZBJFRHO9VdGyYKsjdQ6f/7moJvZKZSkJ667m74qqYvK6U71NXgqm0 7o5p5R0uXNFSjQPjYINqM8h6PVQ5O3j1yB5vho1lySP3OjWGUITORyNXJnR+NR/h3OCl1q2xj n40Jana 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: Markus Elfring Date: Fri, 14 Oct 2016 13:13:11 +0200 Move the assignment for the local variable "data" behind the source code for condition checks by these functions. Signed-off-by: Markus Elfring --- drivers/media/rc/winbond-cir.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c index 3d286b9..716b1fe 100644 --- a/drivers/media/rc/winbond-cir.c +++ b/drivers/media/rc/winbond-cir.c @@ -566,7 +566,7 @@ wbcir_set_carrier_report(struct rc_dev *dev, int enable) static int wbcir_txcarrier(struct rc_dev *dev, u32 carrier) { - struct wbcir_data *data = dev->priv; + struct wbcir_data *data; unsigned long flags; u8 val; u32 freq; @@ -592,6 +592,7 @@ wbcir_txcarrier(struct rc_dev *dev, u32 carrier) break; } + data = dev->priv; spin_lock_irqsave(&data->spinlock, flags); if (data->txstate != WBCIR_TXSTATE_INACTIVE) { spin_unlock_irqrestore(&data->spinlock, flags); @@ -611,7 +612,7 @@ wbcir_txcarrier(struct rc_dev *dev, u32 carrier) static int wbcir_txmask(struct rc_dev *dev, u32 mask) { - struct wbcir_data *data = dev->priv; + struct wbcir_data *data; unsigned long flags; u8 val; @@ -637,6 +638,7 @@ wbcir_txmask(struct rc_dev *dev, u32 mask) return -EINVAL; } + data = dev->priv; spin_lock_irqsave(&data->spinlock, flags); if (data->txstate != WBCIR_TXSTATE_INACTIVE) { spin_unlock_irqrestore(&data->spinlock, flags);