From patchwork Thu Oct 13 16:39:23 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: 9375469 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 6B55460487 for ; Thu, 13 Oct 2016 16:46:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D9C42A174 for ; Thu, 13 Oct 2016 16:46:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5273E2A175; Thu, 13 Oct 2016 16:46:57 +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 ED3B02A172 for ; Thu, 13 Oct 2016 16:46:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933582AbcJMQq0 (ORCPT ); Thu, 13 Oct 2016 12:46:26 -0400 Received: from mout.web.de ([212.227.17.11]:61342 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933351AbcJMQqV (ORCPT ); Thu, 13 Oct 2016 12:46:21 -0400 Received: from [192.168.1.2] ([77.182.72.22]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0ML8Sz-1buS3a2y8n-000NAW; Thu, 13 Oct 2016 18:39:27 +0200 Subject: [PATCH 12/18] [media] RedRat3: Move a variable assignment in redrat3_init_rc_dev() 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:39:23 +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:cC2ePiijxI9kYk0Km1JD1NHVBaIBvmdBeXXnH7+x/3xHU8Sshix 0luQGt/nmGkhchMOySVv2jq0LOxUGrL6IB8X0NyQJr5mfECiKkd76Rndit52ydd2RvX+6v6 /VT8viEhtVbuw87eF5v4kCm1SKMruwSRGQrVTZIKzXSdVs+60jDnSxa1uq+89/2nEE2E5wN fb+wvBOkY9hSYGAS9/BUQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:QNcrz43XCgM=:MzZETLjhSD9E9S+aqfqHFr 8ayvDsx/PxsNHe4WdEa0q/s9dvZ3J4VlJEmfP3nJuOdQaThFFDqVI/fyfE1Ju/jVBX7Kbou8i mrdEC7VyyqV37JG3r7PYDcFonj4OyrzpB48h5KivxYWvwzeYKFYBUbP0UjjlVnx5z+a4UCaU0 xshVdWLWrDW0ndd8V0HvKNxvpbt9z0RP7Lc+pa7ryYVnpwpFTWBQ6ZaXNfZN5HADVqqWf+RZo QDkDAUId+OuQQEZBXCE3Kbls9hSP39MZndgxhUmClA63h1KMn97fKneoPOOLTuocsbM6b0O/Q wjd2zTJzz9pA6c25P9zIezKgX/AfN4330xfly4ZMi3yeunlqouAoKFyQr+JunL7qgHh/QDpw0 TlAdhd9DfwQ+/47i1fGBoz1DVs49YqU2I8+gEUYj4tj6Zia9w+1ZDCKoXvWUOdAg2hWn97Dss sxzk6/1CLNEk20p4kK5jC+e7dZ6OM1NgstulRsXv92ASqX+m8zE3vkio25cA/mf6CgxJtxlvr LT8jtjpE2aYKXbgK05cU8lZVGlPRvMO7YKvncffYv/Yc1YHpDeT/zuueOoVxHmtL82VyhM9lT f4y9OAMT4FJ9hrtWbwoSSOyRNKKade2mhj0zID0NG7pnwYPb+WbjETNioczNotUB/5xG3ycU4 GKIUTtxzHWYOuqXcxaGymC+vhw7ElqvVIi4WcfTPNEB8bOY6+Zd8V8PumtgM1CcPbqIZ76qvE w9b3Jy+0aPEFdTsXFDTdHVAe9XUq5tAhWq8KGM3BzUZJHUagBfHO9ywNXJaajP2t5DfpN7SEA LWEIhdd 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 14:50:05 +0200 Move the assignment for the local variable "prod" 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 b23a8bb..002030f 100644 --- a/drivers/media/rc/redrat3.c +++ b/drivers/media/rc/redrat3.c @@ -856,12 +856,13 @@ static struct rc_dev *redrat3_init_rc_dev(struct redrat3_dev *rr3) { struct rc_dev *rc; int ret; - u16 prod = le16_to_cpu(rr3->udev->descriptor.idProduct); + u16 prod; rc = rc_allocate_device(); if (!rc) goto out; + prod = le16_to_cpu(rr3->udev->descriptor.idProduct); snprintf(rr3->name, sizeof(rr3->name), "RedRat3%s " "Infrared Remote Transceiver (%04x:%04x)", prod == USB_RR3IIUSB_PRODUCT_ID ? "-II" : "",