Skip to content

Commit

Permalink
tests: work_queue: fix few mismatched CONTAINER_OF
Browse files Browse the repository at this point in the history
Fix few mismatched CONTAINER_OF, going from struct k_work to struct
triggered_test_item should pass by struct k_work_poll.

Signed-off-by: Fabio Baltieri <[email protected]>
  • Loading branch information
fabiobaltieri authored and cfriedt committed Aug 30, 2023
1 parent f0d0b54 commit a15e7d2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/kernel/workq/work_queue/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,9 @@ ZTEST(workqueue_delayed, test_delayed)

static void triggered_work_handler(struct k_work *work)
{
struct k_work_poll *pwork = CONTAINER_OF(work, struct k_work_poll, work);
struct triggered_test_item *ti =
CONTAINER_OF(work, struct triggered_test_item, work);
CONTAINER_OF(pwork, struct triggered_test_item, work);

TC_PRINT(" - Running triggered test item %d\n", ti->key);

Expand Down Expand Up @@ -545,8 +546,9 @@ ZTEST(workqueue_triggered, test_already_triggered)

static void triggered_resubmit_work_handler(struct k_work *work)
{
struct k_work_poll *pwork = CONTAINER_OF(work, struct k_work_poll, work);
struct triggered_test_item *ti =
CONTAINER_OF(work, struct triggered_test_item, work);
CONTAINER_OF(pwork, struct triggered_test_item, work);

results[num_results++] = ti->key;

Expand Down

0 comments on commit a15e7d2

Please sign in to comment.