diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-10-29 16:13:21 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-11-03 17:54:55 +0000 |
| commit | a553bd6d68a9f37a7194e9bb03027fa3e511f2e2 (patch) | |
| tree | 0ab01ede0430d5d42af25784578281d12320a6b7 | |
| parent | a22ab3f98f96908dc1bf7b7ad675e0005193d8e5 (diff) | |
lib: Move workqueue private functions into workqueue.c
Some Functions are not used outside of workqueue.c.
Move them inside of workqueue.c to limit scope.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| -rw-r--r-- | lib/workqueue.c | 16 | ||||
| -rw-r--r-- | lib/workqueue.h | 16 |
2 files changed, 16 insertions, 16 deletions
diff --git a/lib/workqueue.c b/lib/workqueue.c index 2281c4c369..e87edef68b 100644 --- a/lib/workqueue.c +++ b/lib/workqueue.c @@ -42,6 +42,15 @@ static void work_queue_item_free(struct work_queue_item *item) return; } +static inline void work_queue_item_dequeue(struct work_queue *wq, + struct work_queue_item *item) +{ + assert(wq->item_count > 0); + + wq->item_count--; + STAILQ_REMOVE(&wq->items, item, work_queue_item, wq); +} + static void work_queue_item_remove(struct work_queue *wq, struct work_queue_item *item) { @@ -133,6 +142,13 @@ static int work_queue_schedule(struct work_queue *wq, unsigned int delay) return 0; } +static inline void work_queue_item_enqueue(struct work_queue *wq, + struct work_queue_item *item) +{ + STAILQ_INSERT_TAIL(&wq->items, item, wq); + wq->item_count++; +} + void work_queue_add(struct work_queue *wq, void *data) { struct work_queue_item *item; diff --git a/lib/workqueue.h b/lib/workqueue.h index 5d84739d5c..8b340ce532 100644 --- a/lib/workqueue.h +++ b/lib/workqueue.h @@ -117,22 +117,6 @@ work_queue_last_item(struct work_queue *wq) return STAILQ_LAST(&wq->items, work_queue_item, wq); } -static inline void work_queue_item_enqueue(struct work_queue *wq, - struct work_queue_item *item) -{ - STAILQ_INSERT_TAIL(&wq->items, item, wq); - wq->item_count++; -} - -static inline void work_queue_item_dequeue(struct work_queue *wq, - struct work_queue_item *item) -{ - assert(wq->item_count > 0); - - wq->item_count--; - STAILQ_REMOVE(&wq->items, item, work_queue_item, wq); -} - /* create a new work queue, of given name. * user must fill in the spec of the returned work queue before adding * anything to it |
