From patchwork Thu Oct 13 16:45:44 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: 9375465 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 E213460487 for ; Thu, 13 Oct 2016 16:46:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0EF62A144 for ; Thu, 13 Oct 2016 16:46:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3D1D2A172; Thu, 13 Oct 2016 16:46:26 +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 680792A144 for ; Thu, 13 Oct 2016 16:46:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933560AbcJMQqW (ORCPT ); Thu, 13 Oct 2016 12:46:22 -0400 Received: from mout.web.de ([212.227.15.3]:61716 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933248AbcJMQqV (ORCPT ); Thu, 13 Oct 2016 12:46:21 -0400 Received: from [192.168.1.2] ([77.182.72.22]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0MS29q-1bRbQR2g7W-00TGcz; Thu, 13 Oct 2016 18:45:45 +0200 Subject: [PATCH 16/18] [media] RedRat3: Move a variable assignment in redrat3_set_timeout() 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: <1877a803-14b2-b064-f051-841b82fb2076@users.sourceforge.net> Date: Thu, 13 Oct 2016 18:45:44 +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:vS5amltVF9F9SCPh5HGZRHWtjBLGQlAJtCFw9Ba+knd9Zi9DGgh z6Fk3bUyrVCQpQr7ARRFiQfmzz736nFiuNgwZPeqZrBbSmTAGsSDBac3uyPmN+NhK9xQbkv ugh0GCSeUKTd89GhTwzv5Uzgv634c9iX4d2NmpVqPoAa633tpAtMyJcL33kZejDeTbqL4gx BKvaqC4n7dUQtDpaoBSLA== X-UI-Out-Filterresults: notjunk:1; V01:K0:jUKhrwp7CFw=:OivG+7XQaohn82etU5St6F maH6aQfAdyY2pJfkngX5vLl7nwRycSeI+JqMCl0E1FldeXMa7gNedbij0s84NEJys5M1ZnTZM MN00tmf2kD412T1XlLtDrODkzfuU+D2TNxDuhGVEdFnm7pq7FYwjp2v7A2PF5GUvjhnHozW9o /59Du12KDMaw3g84DiCCaCdxYZ6t81gRvVt8h3aTNzA5oQ9EGs4R9FM5/ExTO8enHKIrGevel QPenu3C7GTscpOqiI0yDM6qUsSVxr4xDB5vA+BWDpfMBdabcnzAR0nkEWxccrUszgo8x7Ahh3 HeM8A72moXMyZkDJ1ga5qJbGxZWiypx7dkaSynl+Bh1AOa7bMGSgXPLx2Xv0EoklPb1s6fWCL o4B16umwIZDI+1xDRfuKUUlJVj70QbfxWhr+RwKZSTi+oJBJ9nMsBIHszntkgOPTW8dPyZKAz hNBhzHPvX0Uwq2jEIgkEXMDUaepmUzmRicZZ6tI5xUook1GpIf4hVJkk7pp4cJmGAuVRRPynJ bVxFb5m304Dw2fcZxt+eJPuVzjBf0gZyRmws0lQ9YNIIQsbMyMJcx2qucK4WknW/XeW2UqXXD sw2Y+vaKriaMgyDDupEsqwZPrYB5epqpQQt30mWMkDp4Mt6cbIpZEC6HI7HupbO27KQSlqzKh bDSNCV4imNtAA7UP3pmBpao2TxiDfqUCYwM6L/W6e83+WwzNF1TmZ2km/qY85+R9zMaAyuErL bn4+GA4zSVacI05mV8Ixfhr/FmHlUJsm68YAx9w5tlzzRSGwFTp78TP+cfU36qc/O0ypqtNWM NRrYGKZ 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 17:13:41 +0200 Move the assignment for the local variable "rr3" behind the source code for a memory allocation by this function. Signed-off-by: Markus Elfring --- drivers/media/rc/redrat3.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c index e46a92a..06c9eea 100644 --- a/drivers/media/rc/redrat3.c +++ b/drivers/media/rc/redrat3.c @@ -475,7 +475,7 @@ static u32 redrat3_get_timeout(struct redrat3_dev *rr3) static int redrat3_set_timeout(struct rc_dev *rc_dev, unsigned int timeoutns) { - struct redrat3_dev *rr3 = rc_dev->priv; + struct redrat3_dev *rr3; __be32 *timeout; int ret; @@ -484,6 +484,7 @@ static int redrat3_set_timeout(struct rc_dev *rc_dev, unsigned int timeoutns) return -ENOMEM; *timeout = cpu_to_be32(redrat3_us_to_len(timeoutns / 1000)); + rr3 = rc_dev->priv; ret = usb_control_msg(rr3->udev, usb_sndctrlpipe(rr3->udev, 0), RR3_SET_IR_PARAM,