Reinstate const in next_thread()
PATCH 1/1 Reinstate const in next_thread()
Before commit 47e65328a7b1cdfc4e3102e50d60faf94ebba7d3, next_thread() took a const task_t. Reinstate the const qualifier, getting the next thread never changes the current thread.
include/linux/sched.h +1 -1
@@ -1205,7 +1205,7 @@ extern void wait_task_inactive(task_t *#define thread_group_leader (p) (p->pid == p->tgid) -static inline task_t *next_thread (task_t *p) +static inline task_t *next_thread (const task_t *p) {return list_entry (rcu_dereference (p->thread_group.next), task_t, thread_group);
Quoted 5 lines · Keith Owens
Before commit
47e65328a7b1cdfc4e3102e50d60faf94ebba7d3,next_thread()took a consttask_t. Reinstate the const qualifier, getting the next thread never changes the current thread.
Can do, but why? Does code generation improve?
Quoted 8 lines · Andrew Morton (on Mon, 3 Apr 2006 01:33:42 -0700) wrote:
Quoted 5 lines · Keith Owens
Before commit
47e65328a7b1cdfc4e3102e50d60faf94ebba7d3,next_thread()took a consttask_t. Reinstate the const qualifier, getting the next thread never changes the current thread.Can do, but why? Does code generation improve?
I have not checked. The const qualifier on this type of function falls into the "better safe than sorry" category.