Commit 836fa88c authored by Lingao Meng's avatar Lingao Meng Committed by Fabio Baltieri
Browse files

kernel: work: Add missing ASSERT for args



Add missing ASSERT for dwork & queue.

Signed-off-by: default avatarLingao Meng <menglingao@xiaomi.com>
parent 2a3b28a3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -867,6 +867,8 @@ static inline int work_delayable_busy_get_locked(const struct k_work_delayable *

int k_work_delayable_busy_get(const struct k_work_delayable *dwork)
{
	__ASSERT_NO_MSG(dwork != NULL);

	k_spinlock_key_t key = k_spin_lock(&lock);
	int ret = work_delayable_busy_get_locked(dwork);

@@ -968,6 +970,7 @@ int k_work_schedule_for_queue(struct k_work_q *queue,
			       struct k_work_delayable *dwork,
			       k_timeout_t delay)
{
	__ASSERT_NO_MSG(queue != NULL);
	__ASSERT_NO_MSG(dwork != NULL);

	SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_work, schedule_for_queue, queue, dwork, delay);
@@ -1004,6 +1007,7 @@ int k_work_reschedule_for_queue(struct k_work_q *queue,
				 struct k_work_delayable *dwork,
				 k_timeout_t delay)
{
	__ASSERT_NO_MSG(queue != NULL);
	__ASSERT_NO_MSG(dwork != NULL);

	SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_work, reschedule_for_queue, queue, dwork, delay);
+1 −1
Original line number Diff line number Diff line
@@ -1038,7 +1038,7 @@ static void handle_1cpu_basic_schedule_running(struct k_work *work)
	 */
	if (atomic_dec(&resubmits_left) > 0) {
		/* Schedule again on current queue */
		state->schedule_res = k_work_schedule_for_queue(NULL, one_dwork,
		state->schedule_res = k_work_schedule_for_queue(one_dwork->work.queue, one_dwork,
								K_MSEC(DELAY_MS));
	} else {
		/* Flag that it didn't schedule */