Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932361AbcKCT5L (ORCPT ); Thu, 3 Nov 2016 15:57:11 -0400 Received: from mout.web.de ([212.227.15.14]:64877 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750970AbcKCT5J (ORCPT ); Thu, 3 Nov 2016 15:57:09 -0400 Subject: Re: [PATCH 3/3] [media] au0828-video: Move two assignments in au0828_init_isoc() To: Hans Verkuil , linux-media@vger.kernel.org References: <1ab6b168-3c69-97c2-d02e-cd64b7fa222f@users.sourceforge.net> <4e6e77af-1b2c-33a6-1bc3-058ac5ecc038@xs4all.nl> Cc: Hans Verkuil , Laurent Pinchart , Mauro Carvalho Chehab , =?UTF-8?Q?Rafael_Louren=c3=a7o_de_Lima_Chehab?= , Shuah Khan , Wolfram Sang , LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: <65b399e5-8c18-45a4-643d-527dd3bbff3d@users.sourceforge.net> Date: Thu, 3 Nov 2016 20:56:49 +0100 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: <4e6e77af-1b2c-33a6-1bc3-058ac5ecc038@xs4all.nl> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:TX9OUu2JZ0aNPtJn8bwI/VVi55ZLa3qu6ZOS1SEorlRBzptVGTS 4hIoFpj+gyGsIRktDD72XKJUHZo8sINSOKoACY3wP3RUFi7oJmtQzk/KPFiEzl/QScqE2pJ xuNn7FFSxVd5YTYNNb6S1LgUyA58RcPwXyUwxBu4zSjj+qq+2y2VLmtomlEzKB33+qwAYcR c76ad9au8O6BuFvpQ/9Ng== X-UI-Out-Filterresults: notjunk:1;V01:K0:xee0o7nielM=:0XDZAH3wDZINuoq8/E07N3 DNJT2gY6bfwmhxMfiiip3rOpzO319+hBorPrqqlXvfFjf6srHO8cMgnlV3fuZGLiNKN3r4uvQ /5FqDMyt9d8ynRvlY6pgsOElm4sstQlo3kuCPA2QZktNdUilpxlVFboGmWanYvldnYf81Q2ni Kn9nWEUMvZ7GLWjJzVDmKzyqZ9ySQAs1rsSUDWOlakFnuZ7NxtEN6h8NQi+Qmre4EkkDUEfQz Zf0NsQ4rV7Q/3rtUMFiHQxnBULKpHDykmkq++KmQyHw0L25nNGy2ee0rNfCAJ9Eg/Bh/8zkeD Gp4IcTU1hymk2fyDf9lf74dA4OEY8dPxFZeQ9xJnly5FhEMpsFsadIMKxXd+kQIOyAx4GjYD4 0HSsU03bXyhoMR4sKBXWTW1QrVcQDH/sYtVELj8JUsgBAR2Gl0ysT3wWqJhahLxf/bLaYfBFR 0D/Cjmk2q8R1sVxIjJumdVvRkv8tLQAX/U3AUDYSCgEIa2GJVLLhvitPNpy/zXrkKmVm8kIQn 2YGTWMMRJB3jLogkuvW/ZAhu2Q6EgiZNbDnbvxOYBqsCDBAzrNvn7nmKKBasr3U1mOY66A56r 4Gvtoxf+hDwpI0erkZDneeygYmTyDDTCGE85z0mzo+YVC+i5JtL3TZzCSHqqNivz8e6+Hkyaf XAYWStA4Pj45xlqUxkZwnxCWWo8r9VCc2rjKZMlb8tDDjulHi8XTvovkenlVRU87gPKW1bKrD 9I2v5+E6/WCn1XCfeDCz3diiII8pRrfynVQsOitPd/8iJqkXOUAJ+GXXbYnW8iZUD9PVma4nz WaKgT8k Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1958 Lines: 54 >> 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. > > I don't see the point, Another explanation try … > dropping this patch. I proposed that these assignments should only be performed after the required memory allocations succeeded. Is this detail worth for further considerations? >> 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++) { >>