Commit ff4c0d52 authored by Bruno Prémont's avatar Bruno Prémont Committed by Ben Skeggs

drm/nouveau/nouveau: Do not BUG_ON(!spin_is_locked()) on UP

On !SMP systems spinlocks do not exist. Thus checking of they
are active will always fail.

Use
  assert_spin_locked(lock);
instead of
  BUG_ON(!spin_is_locked(lock));
to not BUG() on all UP systems.
Signed-off-by: default avatarBruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 4761703b
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
void void
nvkm_event_put(struct nvkm_event *event, u32 types, int index) nvkm_event_put(struct nvkm_event *event, u32 types, int index)
{ {
BUG_ON(!spin_is_locked(&event->refs_lock)); assert_spin_locked(&event->refs_lock);
while (types) { while (types) {
int type = __ffs(types); types &= ~(1 << type); int type = __ffs(types); types &= ~(1 << type);
if (--event->refs[index * event->types_nr + type] == 0) { if (--event->refs[index * event->types_nr + type] == 0) {
...@@ -39,7 +39,7 @@ nvkm_event_put(struct nvkm_event *event, u32 types, int index) ...@@ -39,7 +39,7 @@ nvkm_event_put(struct nvkm_event *event, u32 types, int index)
void void
nvkm_event_get(struct nvkm_event *event, u32 types, int index) nvkm_event_get(struct nvkm_event *event, u32 types, int index)
{ {
BUG_ON(!spin_is_locked(&event->refs_lock)); assert_spin_locked(&event->refs_lock);
while (types) { while (types) {
int type = __ffs(types); types &= ~(1 << type); int type = __ffs(types); types &= ~(1 << type);
if (++event->refs[index * event->types_nr + type] == 1) { if (++event->refs[index * event->types_nr + type] == 1) {
......
...@@ -98,7 +98,7 @@ nvkm_notify_send(struct nvkm_notify *notify, void *data, u32 size) ...@@ -98,7 +98,7 @@ nvkm_notify_send(struct nvkm_notify *notify, void *data, u32 size)
struct nvkm_event *event = notify->event; struct nvkm_event *event = notify->event;
unsigned long flags; unsigned long flags;
BUG_ON(!spin_is_locked(&event->list_lock)); assert_spin_locked(&event->list_lock);
BUG_ON(size != notify->size); BUG_ON(size != notify->size);
spin_lock_irqsave(&event->refs_lock, flags); spin_lock_irqsave(&event->refs_lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment