From 7d67b9ff28d09de58c632f80ef7d330e45e698f6 Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Wed, 11 Oct 2023 00:15:32 +0300 Subject: build: add -Wimplicit-fallthrough Also: - replace all /* fallthrough */ comments with portable fallthrough; pseudo keyword to accomodate both gcc and clang - add missing break; statements as required by older versions of gcc - cleanup some code to remove unnecessary fallthrough Signed-off-by: Igor Ryzhov --- lib/workqueue.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/workqueue.c') diff --git a/lib/workqueue.c b/lib/workqueue.c index fa5d585360..2281c4c369 100644 --- a/lib/workqueue.c +++ b/lib/workqueue.c @@ -271,9 +271,10 @@ void work_queue_run(struct event *thread) switch (ret) { case WQ_QUEUE_BLOCKED: { /* decrement item->ran again, cause this isn't an item - * specific error, and fall through to WQ_RETRY_LATER + * specific error, and retry later */ item->ran--; + goto stats; } case WQ_RETRY_LATER: { goto stats; @@ -296,9 +297,10 @@ void work_queue_run(struct event *thread) break; } case WQ_RETRY_NOW: - /* a RETRY_NOW that gets here has exceeded max_tries, same as - * ERROR */ - /* fallthru */ + /* a RETRY_NOW that gets here has exceeded max_tries, same + * as ERROR + */ + fallthrough; case WQ_SUCCESS: default: { work_queue_item_remove(wq, item); -- cgit v1.2.3