mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Hans Verkuil" <hverkuil@xs4all.nl>
To: "Laurent Pinchart" <laurent.pinchart@ideasonboard.com>
Cc: "Andrew Chew" <achew@nvidia.com>,
	"'Figo.zhang'" <zhangtianfei@leadcoretech.com>,
	"pawel@osciak.com" <pawel@osciak.com>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] videobuf: Initialize lists in videobuf_buffer.
Date: Wed, 17 Nov 2010 13:44:57 +0100	[thread overview]
Message-ID: <79f17a04986247b4ac5806e708f3d2d5.squirrel@webmail.xs4all.nl> (raw)
In-Reply-To: <201011171337.35663.laurent.pinchart@ideasonboard.com>


> Hi Hans,
>
> On Wednesday 17 November 2010 08:11:06 Hans Verkuil wrote:
>> On Wednesday, November 17, 2010 02:38:09 Andrew Chew wrote:
>> > > > diff --git a/drivers/media/video/videobuf-dma-contig.c
>> > >
>> > > b/drivers/media/video/videobuf-dma-contig.c
>> > >
>> > > > index c969111..f7e0f86 100644
>> > > > --- a/drivers/media/video/videobuf-dma-contig.c
>> > > > +++ b/drivers/media/video/videobuf-dma-contig.c
>> > > > @@ -193,6 +193,8 @@ static struct videobuf_buffer
>> > >
>> > > *__videobuf_alloc_vb(size_t size)
>> > >
>> > > >   	if (vb) {
>> > > >
>> > > >   		mem = vb->priv = ((char *)vb) + size;
>> > > >   		mem->magic = MAGIC_DC_MEM;
>> > > >
>> > > > +		INIT_LIST_HEAD(&vb->stream);
>> > > > +		INIT_LIST_HEAD(&vb->queue);
>> > >
>> > > i think it no need to be init, it just a list-entry.
>> >
>> > Okay, if that's really the case, then sh_mobile_ceu_camera.c,
>> > pxa_camera.c, mx1_camera.c, mx2_camera.c, and omap1_camera.c needs to
>> be
>> > fixed to remove that WARN_ON(!list_empty(&vb->queue)); in their
>> > videobuf_prepare() methods, because those WARN_ON's are assuming that
>> > vb->queue is properly initialized as a list head.
>> >
>> > Which will it be?
>>
>> These list entries need to be inited. It is bad form to have
>> uninitialized
>> list entries. It is not as if this is a big deal to initialize them
>> properly.
>
> I disagree with that. List heads must be initialized, but there's no point
> in
> initializing list entries.

You are right. I got confused due to some problems I had in the past in
another driver, but it turned out to be a list header that caused the
problems, not a list entry. So removing the bogus WARN_ONs is sufficient.

Regards,

       Hans

-- 
Hans Verkuil - video4linux developer - sponsored by Cisco


  reply	other threads:[~2010-11-17 12:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-16 20:24 achew
2010-11-17  1:10 ` Figo.zhang
     [not found]   ` <643E69AA4436674C8F39DCC2C05F763816BB828A40@HQMAIL03.nvidia.com>
2010-11-17  1:39     ` Figo.zhang
2010-11-17  7:11     ` Hans Verkuil
2010-11-17  7:16       ` Figo.zhang
2010-11-17  7:52         ` Hans Verkuil
2010-11-17 12:37       ` Laurent Pinchart
2010-11-17 12:44         ` Hans Verkuil [this message]
2010-11-17  7:13 ` 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=79f17a04986247b4ac5806e708f3d2d5.squirrel@webmail.xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=achew@nvidia.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=pawel@osciak.com \
    --cc=zhangtianfei@leadcoretech.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

all inboxes | Powered by JetHome®