bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 8/8] kern: avoid the casts in enqueue_head() and enqueue_tail()


From: Marin Ramesa
Subject: [PATCH 8/8] kern: avoid the casts in enqueue_head() and enqueue_tail()
Date: Mon, 16 Dec 2013 23:55:19 +0100

* kern/eventcount.c (simpler_thread_setrun) (enqueue_head) (th): Avoid the cast.
* kern/thread.c (thread_halt_self) (enqueue_tail) (thread): Likewise.
* kern/thread_swap.c (thread_swapin) (enqueue_tail) (thread): Likewise.

---
 kern/eventcount.c  | 2 +-
 kern/thread.c      | 2 +-
 kern/thread_swap.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kern/eventcount.c b/kern/eventcount.c
index b1b791b..f9159a2 100644
--- a/kern/eventcount.c
+++ b/kern/eventcount.c
@@ -340,7 +340,7 @@ simpler_thread_setrun(
 
        whichq = (th)->sched_pri;
        simple_lock(&(rq)->lock);       /* lock the run queue */
-       enqueue_head(&(rq)->runq[whichq], (queue_entry_t) (th));
+       enqueue_head(&(rq)->runq[whichq], &((th)->links));
 
        if (whichq < (rq)->low || (rq)->count == 0)
                 (rq)->low = whichq;    /* minimize */
diff --git a/kern/thread.c b/kern/thread.c
index 254497e..9009573 100644
--- a/kern/thread.c
+++ b/kern/thread.c
@@ -1149,7 +1149,7 @@ void      thread_halt_self(void)
 
                s = splsched();
                simple_lock(&reaper_lock);
-               enqueue_tail(&reaper_queue, (queue_entry_t) thread);
+               enqueue_tail(&reaper_queue, &(thread->links));
                simple_unlock(&reaper_lock);
 
                thread_lock(thread);
diff --git a/kern/thread_swap.c b/kern/thread_swap.c
index 996ff1f..c9c4572 100644
--- a/kern/thread_swap.c
+++ b/kern/thread_swap.c
@@ -97,7 +97,7 @@ void thread_swapin(thread)
                thread->state = (thread->state & ~TH_SWAP_STATE)
                                | TH_SW_COMING_IN;
                swapper_lock();
-               enqueue_tail(&swapin_queue, (queue_entry_t) thread);
+               enqueue_tail(&swapin_queue, &(thread->links));
                swapper_unlock();
                thread_wakeup((event_t) &swapin_queue);
                break;
-- 
1.8.1.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]