Skip to contentSkip to conversation

Fix inc_rt_tasks() to not declare variable 'rq' if it's not needed

PATCH Applied David Howells 3 participants 3 messages Jul 11, 2008 – Jul 18, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix inc_rt_tasks() to not declare variable 'rq' if it's not needed

Fix inc_rt_tasks() to not declare variable 'rq' if it's not needed. It is declared if CONFIG_SMP or CONFIG_RT_GROUP_SCHED, but only used if CONFIG_SMP.

This is a consequence of patch 1f11eb6a8bc92536d9e93ead48fa3ffbd1478571 plus patch 1100ac91b6af02d8639d518fad5b434b1bf44ed6.

---

 kernel/sched_rt.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
kernel/sched_rt.c +2 -0
index acba8eb..ec19ce5 100644
@@ -505,7 +505,9 @@ void inc_rt_tasks(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
 	rt_rq->rt_nr_running++;
 #if defined CONFIG_SMP || defined CONFIG_RT_GROUP_SCHED
 	if (rt_se_prio(rt_se) < rt_rq->highest_prio) {
+#ifdef CONFIG_SMP
 		struct rq *rq = rq_of_rt_rq(rt_rq);
+#endif
 
 		rt_rq->highest_prio = rt_se_prio(rt_se);
 #ifdef CONFIG_SMP
#1 lore raw

Re: [PATCH] Fix inc_rt_tasks() to not declare variable 'rq' if it's notneeded

Quoted 1 line
Quoted 1 line
Quoted 1 line

On Fri, Jul 11, 2008 at 8:34 AM, in message

<[email protected]>, David Howells

Quoted 8 lines · <[email protected]> wrote:

Fix inc_rt_tasks() to not declare variable 'rq' if it's not needed. It is declared if CONFIG_SMP or CONFIG_RT_GROUP_SCHED, but only used if CONFIG_SMP.

This is a consequence of patch 1f11eb6a8bc92536d9e93ead48fa3ffbd1478571 plus patch 1100ac91b6af02d8639d518fad5b434b1bf44ed6.

Acked by: Gregory Haskins <[email protected]>

Quoted 21 lines

---

 kernel/sched_rt.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
kernel/sched_rt.c +2 -0
index acba8eb..ec19ce5 100644
@@ -505,7 +505,9 @@ void inc_rt_tasks(struct sched_rt_entity *rt_se, struct 
 rt_rq *rt_rq)
 	rt_rq->rt_nr_running++;
 #if defined CONFIG_SMP || defined CONFIG_RT_GROUP_SCHED
 	if (rt_se_prio(rt_se) < rt_rq->highest_prio) {
+#ifdef CONFIG_SMP
 		struct rq *rq = rq_of_rt_rq(rt_rq);
+#endif
 
 		rt_rq->highest_prio = rt_se_prio(rt_se);

#ifdef CONFIG_SMP

Applied
#2 lore raw
In reply to David Howells
Quoted 6 lines · David Howells

Fix inc_rt_tasks() to not declare variable 'rq' if it's not needed. It is declared if CONFIG_SMP or CONFIG_RT_GROUP_SCHED, but only used if CONFIG_SMP.

This is a consequence of patch 1f11eb6a8bc92536d9e93ead48fa3ffbd1478571 plus patch 1100ac91b6af02d8639d518fad5b434b1bf44ed6.

applied, thanks David.

Ingo