From patchwork Mon Oct 24 21:01:31 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: 9393295 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 7C61B60231 for ; Mon, 24 Oct 2016 21:05:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C3A0290A3 for ; Mon, 24 Oct 2016 21:05:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6049D290CA; Mon, 24 Oct 2016 21:05:16 +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 0B55A290A3 for ; Mon, 24 Oct 2016 21:05:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965458AbcJXVBp (ORCPT ); Mon, 24 Oct 2016 17:01:45 -0400 Received: from mout.web.de ([212.227.15.4]:57377 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964839AbcJXVBo (ORCPT ); Mon, 24 Oct 2016 17:01:44 -0400 Received: from [192.168.1.2] ([77.182.95.108]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0MeBVG-1cGqQN0i6w-00PywP; Mon, 24 Oct 2016 23:01:33 +0200 Subject: [PATCH 3/3] [media] au0828-video: Move two assignments in au0828_init_isoc() To: linux-media@vger.kernel.org, Hans Verkuil , Laurent Pinchart , Mauro Carvalho Chehab , =?UTF-8?Q?Rafael_Louren=c3=a7o_de_Lima_Chehab?= , Shuah Khan , Wolfram Sang References: Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: <1ab6b168-3c69-97c2-d02e-cd64b7fa222f@users.sourceforge.net> Date: Mon, 24 Oct 2016 23:01:31 +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: X-Provags-ID: V03:K0:2YhOV1ZO6CJ1Uuky0llNMlNC1YT5ll90s7q2Lrbs1lMHU+XZgq4 3GZU071bCl53zv+5l/BCZ0ijy2GGkkuCXinG/sjIqkUcuUxW3Q+xX5YCLSmzwTWvVJ6V0Wp Bvp/591kT0A2qGZ2033ASSZQDtwvj1DoghwI4tZt470/GRlABm18tjRgwfa/EeV5J1Aoe0H NWuuNvUarG+/aEh4tENHQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:FARBTe8JanI=:qwoIjt5mseGguQUU/eYecU RZxblGdiGs9HOXQ9RBj4nG8oh4WGeLCGbJSJxQkZkp+qn1PLzUt1Png9fuJlL1QFtS4/D4nf1 wB8XDk0Zd0yf42VsWDO82K+fhq6FzoPEpgSP9o71jVittIftIgyIqS3h6c3TgJZ4p9nxMpk4l tBlY2+NE+wcsUPKlPDSOq8NUgJtQ1DuSNWtlYK/aPtkGYWVb7Dt9/tPt+fUVSv13kuaVwn1Ur LteI4OIpk+d6URJ1azj0gbdxTjeW8WiCS4RJ5wKZEc52rMAWSSAwjB8/yQHZ1918TNcU6vgq0 64A0URBXRYEeH3L8B6FW0M6W7TmjglC8e+5DhKQTBTBL4q8hgWxvXZ3FQRkmEwMMsfJ9Lbbry c5fgCu5GIUeBYAH++jAKxrYPBcYhgXTS2qG97BGJPEZwN8cRet5F2io4NbIReitm8hjZ1sm/0 ShDPX/uKF+1W5xkECnxHl3soB0y9XtCe1yYYUcjERW40T1E6qOeUGkth3t3KcOSy64xQANTBB Q0ekk6848Bypx0iNOxoKtcwNONiHDgKfARZy1cy26/N3SdVNpOPipjxlJ//rJGygcThYMpM+1 fTmw44xQDmMLg/OrVcbcvIwABpBvuSvKiH8DuD/msRayRFciuE4pRYCY7ugJK9oBmX8g5rf7z Jet8uvd6P8d71pAFxh3JJlz/hRRjBIiEm0x0xFWRtAR6+PUgw9IR9beDqm3bIWSw9BmORiqyK wfSegJzveI7KOSCIYCxVJVo2hckaL8etq9rMSfaOBxQiLZMuD+n5gw9OzawMhG3omeet0qpTl SFZNmpm 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: Mon, 24 Oct 2016 22:44:02 +0200 Move the assignment for the data structure members "isoc_copy" and "num_bufs" behind the source code for memory allocations by this function. Signed-off-by: Markus Elfring --- drivers/media/usb/au0828/au0828-video.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c index b5c88a7..5ebda64 100644 --- a/drivers/media/usb/au0828/au0828-video.c +++ b/drivers/media/usb/au0828/au0828-video.c @@ -218,9 +218,6 @@ static int au0828_init_isoc(struct au0828_dev *dev, int max_packets, int rc; au0828_isocdbg("au0828: called au0828_prepare_isoc\n"); - - dev->isoc_ctl.isoc_copy = isoc_copy; - dev->isoc_ctl.num_bufs = num_bufs; dev->isoc_ctl.urb = kcalloc(num_bufs, sizeof(*dev->isoc_ctl.urb), GFP_KERNEL); @@ -240,6 +237,7 @@ static int au0828_init_isoc(struct au0828_dev *dev, int max_packets, dev->isoc_ctl.buf = NULL; sb_size = max_packets * dev->isoc_ctl.max_pkt_size; + dev->isoc_ctl.num_bufs = num_bufs; /* allocate urbs and transfer buffers */ for (i = 0; i < dev->isoc_ctl.num_bufs; i++) { @@ -276,6 +274,7 @@ static int au0828_init_isoc(struct au0828_dev *dev, int max_packets, k += dev->isoc_ctl.max_pkt_size; } } + dev->isoc_ctl.isoc_copy = isoc_copy; /* submit urbs and enables IRQ */ for (i = 0; i < dev->isoc_ctl.num_bufs; i++) {