From d81a041c2316e9779531c1956a7cfc4f969b9a1d Mon Sep 17 00:00:00 2001 From: John Levon Date: Wed, 6 Oct 2021 23:03:06 +0100 Subject: [PATCH] lib/event: avoid cast of event_queue_run_batch Signed-off-by: John Levon Change-Id: I1f23b9ab3aa5ace791a9460267606fcb03287245 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9776 Community-CI: Mellanox Build Bot Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Tomasz Zawadzki --- lib/event/reactor.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/event/reactor.c b/lib/event/reactor.c index 3732c3f40..695b0e1bd 100644 --- a/lib/event/reactor.c +++ b/lib/event/reactor.c @@ -527,10 +527,11 @@ spdk_event_call(struct spdk_event *event) } } -static inline uint32_t -event_queue_run_batch(struct spdk_reactor *reactor) +static inline int +event_queue_run_batch(void *arg) { - unsigned count, i; + struct spdk_reactor *reactor = arg; + size_t count, i; void *events[SPDK_EVENT_BATCH_SIZE]; struct spdk_thread *thread; struct spdk_lw_thread *lw_thread; @@ -598,7 +599,7 @@ event_queue_run_batch(struct spdk_reactor *reactor) spdk_mempool_put_bulk(g_spdk_event_mempool, events, count); - return count; + return (int)count; } /* 1s */ @@ -1429,7 +1430,7 @@ reactor_interrupt_init(struct spdk_reactor *reactor) } rc = spdk_fd_group_add(reactor->fgrp, reactor->events_fd, - (spdk_fd_fn)event_queue_run_batch, reactor); + event_queue_run_batch, reactor); if (rc) { spdk_fd_group_remove(reactor->fgrp, reactor->resched_fd); close(reactor->resched_fd);