V4L: Event: debugging fixes
cover V4L: Event: debugging fixes
Hi,
Laurent Pinchart found that on uni-processor kernels without spinlock debugging spin_is_locked() is always zero, which causes a bad WARN_ON() message to be shown. The following patch removes the WARN_ON() and replaces it with assert_spin_locked() which works correctly.
Regards,
Signature · 2 lines
Sakari Ailus [email protected]
PATCH 1/1 V4L: Events: Replace bad WARN_ON() with assert_spin_locked()
spin_is_locked() always returns zero when spinlock debugging is disabled on a single CPU machine. Replace WARN_ON() with assert_spin_locked().
Thanks to Laurent Pinchart for spotting this!
--- drivers/media/video/v4l2-event.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/media/video/v4l2-event.c +1 -1
@@ -152,7 +152,7 @@ static struct v4l2_subscribed_event *v4l2_event_subscribed(struct v4l2_events *events = fh->events;struct v4l2_subscribed_event *sev; -WARN_ON (!spin_is_locked (&fh->vdev->fh_lock)); +assert_spin_locked (&fh->vdev->fh_lock);list_for_each_entry (sev, &events->subscribed, list) {if (sev->type == type)
Signature · 1 line
1.5.6.5
Re: [PATCH 1/1] V4L: Events: Replace bad WARN_ON() with assert_spin_locked()
Quoted 7 lines · On Monday 03 May 2010 17:42:46 Sakari Ailus wrote:
spin_is_locked()always returns zero when spinlock debugging is disabled on a single CPU machine. ReplaceWARN_ON()withassert_spin_locked().Thanks to Laurent Pinchart for spotting this!
Signed-off-by Sakari Ailus <[email protected]>
Quoted 17 lines
--- drivers/media/video/v4l2-event.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)(quoted diff) +0
-0
b/drivers/media/video/v4l2-event.cindex 170e40f..91bb1c8 100644drivers/media/video/v4l2-event.c +1
-1@@ -152,7 +152,7 @@ static struct v4l2_subscribed_event *v4l2_event_subscribed( struct v4l2_events *events = fh->events;struct v4l2_subscribed_event *sev; -WARN_ON (!spin_is_locked (&fh->vdev->fh_lock)); +assert_spin_locked (&fh->vdev->fh_lock);list_for_each_entry (sev, &events->subscribed, list) {if (sev->type == type)
Signature · 3 lines
Regards, Laurent Pinchart