CLEANUP: tasks: rename task_remove_from_tasklet_list() to tasklet_remove_*
The function really only operates on tasklets, its arguments are always
tasklets cast as tasks to match the function's type, to be cast back to
a struct tasklet. Let's rename it to tasklet_remove_from_tasklet_list(),
take a struct tasklet, and get rid of the undesired task casts.
diff --git a/include/proto/task.h b/include/proto/task.h
index 5f4940c..41227b8 100644
--- a/include/proto/task.h
+++ b/include/proto/task.h
@@ -246,21 +246,19 @@
LIST_ADDQ(&task_per_thread[tid].task_list, &tl->list);
}
-/* remove the task from the tasklet list. The task MUST already be there. If
- * unsure, use task_remove_from_task_list() instead.
+/* remove the task from the tasklet list. The tasklet MUST already be there. If
+ * unsure, use tasklet_remove_from_tasklet_list() instead.
*/
-static inline void __task_remove_from_tasklet_list(struct task *t)
+static inline void __tasklet_remove_from_tasklet_list(struct tasklet *t)
{
- LIST_DEL_INIT(&((struct tasklet *)t)->list);
- if (!TASK_IS_TASKLET(t))
- task_per_thread[tid].task_list_size--;
+ LIST_DEL_INIT(&t->list);
_HA_ATOMIC_SUB(&tasks_run_queue, 1);
}
-static inline void task_remove_from_tasklet_list(struct task *t)
+static inline void tasklet_remove_from_tasklet_list(struct tasklet *t)
{
- if (likely(!LIST_ISEMPTY(&((struct tasklet *)t)->list)))
- __task_remove_from_tasklet_list(t);
+ if (likely(!LIST_ISEMPTY(&t->list)))
+ __tasklet_remove_from_tasklet_list(t);
}
/*