All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Hans Verkuil <hverkuil@xs4all.nl>,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH 3/6] v4l2-event: Remove pending events from fh event queue when unsubscribing
Date: Tue, 01 Nov 2011 14:41:45 +0100	[thread overview]
Message-ID: <4EAFF719.4020301@redhat.com> (raw)

Hi,

hverkuil wrote:

 > > This patch fixes these dangling pointers in the available queue by removing
 > > all matching pending events on unsubscription.
 >
 > The idea is fine, but the implementation is inefficient.
 >
 > Instead of the list_for_each_entry_safe you can just do:
 >
 >	for (i = 0; i < sev->in_use; i++) {
 >		list_del(&sev->events[sev_pos(sev, i)].list);
 >		fh->navailable--;
 >	}
 >
 > It's untested, but this should do the trick.

Agreed, I've modified my patch to use this construction instead.

Regards,

Hans

             reply	other threads:[~2011-11-01 13:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-01 13:41 Hans de Goede [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-11-02  9:14 [PATCH 3/6] v4l2-event: Remove pending events from fh event queue when unsubscribing Hans de Goede
2011-10-31 15:16 Various ctrl and event frame work patches (version 2) Hans de Goede
2011-10-31 15:16 ` [PATCH 3/6] v4l2-event: Remove pending events from fh event queue when unsubscribing Hans de Goede
2011-11-02 10:00   ` Sakari Ailus
2011-10-27 11:17 Various ctrl and event frame work patches Hans de Goede
2011-10-27 11:18 ` [PATCH 3/6] v4l2-event: Remove pending events from fh event queue when unsubscribing Hans de Goede
2011-10-27 12:07   ` Laurent Pinchart
2011-10-30 10:24   ` 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=4EAFF719.4020301@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.