From patchwork Thu Oct 13 16:20:34 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: 9375315 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 5F4B060839 for ; Thu, 13 Oct 2016 16:20:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DD362A146 for ; Thu, 13 Oct 2016 16:20:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3DCCE2A151; Thu, 13 Oct 2016 16:20:53 +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 D82632A146 for ; Thu, 13 Oct 2016 16:20:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756775AbcJMQUt (ORCPT ); Thu, 13 Oct 2016 12:20:49 -0400 Received: from mout.web.de ([212.227.15.14]:59896 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755487AbcJMQUr (ORCPT ); Thu, 13 Oct 2016 12:20:47 -0400 Received: from [192.168.1.2] ([77.182.72.22]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0LfAbI-1b5wb53d96-00olTD; Thu, 13 Oct 2016 18:20:36 +0200 Subject: [PATCH 02/18] [media] RedRat3: Move two assignments in redrat3_transmit_ir() To: linux-media@vger.kernel.org, Hans Verkuil , Mauro Carvalho Chehab , Sean Young , Wolfram Sang References: <566ABCD9.1060404@users.sourceforge.net> <81cef537-4ad0-3a74-8bde-94707dcd03f4@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: Date: Thu, 13 Oct 2016 18:20:34 +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: <81cef537-4ad0-3a74-8bde-94707dcd03f4@users.sourceforge.net> X-Provags-ID: V03:K0:Vq7NMUvXkv2+g5c3WARnEyXJAJ4mTro/iMyxFfytQz5hJGhc4EY jrOPePnoQ03o2a6U9WS71CdcZe1c654JXq+fdIZfFDgSHz2npK+ixENbjSjHhE5a80TJ+PL dvorFJI48Xsw4XRX+qabXk2jOWkQra5xOhGn7RjFOZ5Qj3MZrIh3/B+9KFS0yJPY1bfMjmu LZ2pWnR8drOhfGrYmmYBg== X-UI-Out-Filterresults: notjunk:1; V01:K0:0o8gU97Rc9o=:rjnL78B5qZKEcf3C/iPTrn rzNRudLdJmS6Bq1zdBHq4oUwF29KjrSjooEd5I4BXKd680/jD2T4xfB47ToUUXMgkOOKr8XLe SD6FT1vKVFOCvmhNkEO0r/Lsvvs+bziMAouh8oLhVyVDRxE0XyzuVs5ee33SlohtQskWuNyE+ bA+bgLR5gpB+Lh61wC9XaTRE85JOAbjKesTczoFVIrvbvfeorttssmL+8ZxDHOEIBNZEIkPxp 1pkR1L/6v1KrJkl523KuGaJf7AHNYB6TFRTDsBHMhZSvrk03wj25K4W6c8bDa4BtKwKdp9+f3 I4p8XJKSr7fYWE2JuWrSlruT/h2wGXy4P2GNoTpdWTcZfc9GBRbxlYQ77O9DFgzawAxYAKQld vCE0gOg2kvR41H8AQ3zwhPOd6L2BaCC/rSAdIBtkbR+fjfyps4ylt/3KT3CfpBcucH4YaARzL mIlDUy6ZL95A9H/d2JCwvfJ3SP4vx43lUJpkH67SbjTxHSdDK+ndDogUiVoh8LVcOwguKn8dN cxJIV5r2IeWfyY3NOst33cgfCgwPy1vcvam04t0e7V3znkk8Q8SMVZawDsmjnjrariKH9eRby rkXDk7KFKiPdetdQcq2l7AiPCDEYEXdkhb9LtBHbYfaZHdsB3EkAQJ+iCJ768X7iwjhD7uo9m KBUU9i5MwhauAsbnAJfAMrWJ7S6ZDflFF3/VUY2qheL/nfk2majd57RKaAWt4nLawHs5qUFtl 4H/OjljpjfEj1wPXU9uY0tGlxuJFPn0Qzh94tSbFDTRXtEUpjaIvFnR3km9mCjLa69jQswiRy WfX3IkN 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: Thu, 13 Oct 2016 10:25:57 +0200 Move the assignment for the data structure member "transmitting" and the local variable "curlencheck" behind the source code for memory allocations by this function. Signed-off-by: Markus Elfring --- drivers/media/rc/redrat3.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c index d89958b..f5a6850 100644 --- a/drivers/media/rc/redrat3.c +++ b/drivers/media/rc/redrat3.c @@ -727,7 +727,7 @@ static int redrat3_transmit_ir(struct rc_dev *rcdev, unsigned *txbuf, int ret, ret_len; int lencheck, cur_sample_len, pipe; int *sample_lens = NULL; - u8 curlencheck = 0; + u8 curlencheck; unsigned i, sendbuf_len; if (rr3->transmitting) { @@ -738,9 +738,6 @@ static int redrat3_transmit_ir(struct rc_dev *rcdev, unsigned *txbuf, if (count > RR3_MAX_SIG_SIZE - RR3_TX_TRAILER_LEN) return -EINVAL; - /* rr3 will disable rc detector on transmit */ - rr3->transmitting = true; - sample_lens = kcalloc(RR3_DRIVER_MAXLENS, sizeof(*sample_lens), GFP_KERNEL); @@ -755,6 +752,9 @@ static int redrat3_transmit_ir(struct rc_dev *rcdev, unsigned *txbuf, goto out; } + /* rr3 will disable rc detector on transmit */ + rr3->transmitting = true; + curlencheck = 0; for (i = 0; i < count; i++) { cur_sample_len = redrat3_us_to_len(txbuf[i]); if (cur_sample_len > 0xffff) {