Skip to contentSkip to conversation

sched: Fix rq lock use through wrong spinlock api

PATCH New Frederic Weisbecker 1 participant 1 message Dec 10, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched: Fix rq lock use through wrong spinlock api

Now that rq lock is a raw spinlock, it needs to be manipulated using appropriate helpers.

This fixes the following warning:

kernel/sched_fair.c: In function ‘task_fork_fair’:
kernel/sched_fair.c:1958: attention : passing argument 1 of ‘spinlock_check’ from incompatible pointer type kernel/sched_fair.c:1978: attention : passing argument 1 of ‘spin_unlock_irqrestore’ from incompatible pointer type

Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 kernel/sched_fair.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/sched_fair.c +2 -2
index 804a411..5bedf6e 100644
@@ -1955,7 +1955,7 @@ static void task_fork_fair(struct task_struct *p)
 	struct rq *rq = this_rq();
 	unsigned long flags;
 
-	spin_lock_irqsave(&rq->lock, flags);
+	raw_spin_lock_irqsave(&rq->lock, flags);
 
 	if (unlikely(task_cpu(p) != this_cpu))
 		__set_task_cpu(p, this_cpu);
@@ -1975,7 +1975,7 @@ static void task_fork_fair(struct task_struct *p)
 		resched_task(rq->curr);
 	}
 
-	spin_unlock_irqrestore(&rq->lock, flags);
+	raw_spin_unlock_irqrestore(&rq->lock, flags);
 }
 
 /*
Signature · 1 line
1.6.2.3