linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: Hans Verkuil <hverkuil@xs4all.nl>, linux-media@vger.kernel.org
Cc: "Hans Verkuil" <hans.verkuil@cisco.com>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Rafael Lourenço de Lima Chehab" <chehabrafael@gmail.com>,
	"Shuah Khan" <shuah@kernel.org>,
	"Wolfram Sang" <wsa-dev@sang-engineering.com>,
	LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 3/3] [media] au0828-video: Move two assignments in au0828_init_isoc()
Date: Thu, 3 Nov 2016 20:56:49 +0100	[thread overview]
Message-ID: <65b399e5-8c18-45a4-643d-527dd3bbff3d@users.sourceforge.net> (raw)
In-Reply-To: <4e6e77af-1b2c-33a6-1bc3-058ac5ecc038@xs4all.nl>

>> From: Markus Elfring <elfring@users.sourceforge.net>
>> 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 <elfring@users.sourceforge.net>
>> ---
>>  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++) {
>>


  reply	other threads:[~2016-11-03 19:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-24 20:58 [PATCH 0/3] [media] au0828-video: Fine-tuning for au0828_init_isoc() SF Markus Elfring
2016-10-24 20:59 ` [PATCH 1/3] [media] au0828-video: Use kcalloc() in au0828_init_isoc() SF Markus Elfring
2016-10-24 22:28   ` Andrey Utkin
2016-10-25  0:11     ` Mauro Carvalho Chehab
2016-10-25  5:51       ` Julia Lawall
2016-10-25 12:46       ` Andrey Utkin
2016-10-25  8:40   ` Dan Carpenter
2016-10-24 21:00 ` [PATCH 2/3] [media] au0828-video: Delete three error messages for a failed memory allocation SF Markus Elfring
2016-10-24 21:01 ` [PATCH 3/3] [media] au0828-video: Move two assignments in au0828_init_isoc() SF Markus Elfring
2016-10-25  9:06   ` Dan Carpenter
2016-11-03 12:41   ` Hans Verkuil
2016-11-03 19:56     ` SF Markus Elfring [this message]
2016-11-04  8:09       ` Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=65b399e5-8c18-45a4-643d-527dd3bbff3d@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=chehabrafael@gmail.com \
    --cc=hans.verkuil@cisco.com \
    --cc=hverkuil@xs4all.nl \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=shuah@kernel.org \
    --cc=wsa-dev@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).