list_entry returns a pointer to the container data structure. In the
example on p. 21/22, this would be a pointer to struct task_struct.
Unfortunately, the pointer declaration is missing. Correctly, the example
statement should read
Code:
struct task_struct *tsk = list_entry(ptr, struct task_struct, run_list);
Here we assume that ptr points to a list_head instance embedded in
task_struct (this was indeed the case for the O(1) scheduler):
Code:
struct task_struct {
...
struct list_head run_list;
...
}