mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch 2.6.17-rc1] Reinstate const in next_thread()
@ 2006-04-03  8:25 Keith Owens
  2006-04-03  8:33 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Keith Owens @ 2006-04-03  8:25 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: Eric Biederman, linux-kernel

Before commit 47e65328a7b1cdfc4e3102e50d60faf94ebba7d3, next_thread()
took a const task_t.  Reinstate the const qualifier, getting the next
thread never changes the current thread.

Signed-off-by: Keith Owens <kaos@sgi.com>

Index: linux/include/linux/sched.h
===================================================================
--- linux.orig/include/linux/sched.h	2006-04-03 18:20:22.000000000 +1000
+++ linux/include/linux/sched.h	2006-04-03 18:20:36.309150547 +1000
@@ -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);


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch 2.6.17-rc1] Reinstate const in next_thread()
  2006-04-03  8:25 [patch 2.6.17-rc1] Reinstate const in next_thread() Keith Owens
@ 2006-04-03  8:33 ` Andrew Morton
  2006-04-03  8:40   ` Keith Owens
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2006-04-03  8:33 UTC (permalink / raw)
  To: Keith Owens; +Cc: oleg, ebiederm, linux-kernel

Keith Owens <kaos@sgi.com> wrote:
>
> Before commit 47e65328a7b1cdfc4e3102e50d60faf94ebba7d3, next_thread()
> took a const task_t.  Reinstate the const qualifier, getting the next
> thread never changes the current thread.
> 

Can do, but why?  Does code generation improve?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch 2.6.17-rc1] Reinstate const in next_thread()
  2006-04-03  8:33 ` Andrew Morton
@ 2006-04-03  8:40   ` Keith Owens
  0 siblings, 0 replies; 3+ messages in thread
From: Keith Owens @ 2006-04-03  8:40 UTC (permalink / raw)
  To: Andrew Morton; +Cc: oleg, ebiederm, linux-kernel

Andrew Morton (on Mon, 3 Apr 2006 01:33:42 -0700) wrote:
>Keith Owens <kaos@sgi.com> wrote:
>>
>> Before commit 47e65328a7b1cdfc4e3102e50d60faf94ebba7d3, next_thread()
>> took a const task_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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-04-03  8:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-03  8:25 [patch 2.6.17-rc1] Reinstate const in next_thread() Keith Owens
2006-04-03  8:33 ` Andrew Morton
2006-04-03  8:40   ` Keith Owens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome