From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: 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 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 MIME-Version: 1.0 In-Reply-To: <81cef537-4ad0-3a74-8bde-94707dcd03f4@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-media-owner@vger.kernel.org List-ID: 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) { -- 2.10.1