From: Andrew Morton we now have: int foo(..) { if (expr1) { ... return x; } else { ... return y; } } but some versions of gcc have a habit of (wrongly) warning about the failure to return anything from a non-void-returning function. Fiddle the code to avoid that. Cc: "Rafael J. Wysocki" Cc: Gautham R Shenoy Cc: Oleg Nesterov Cc: Srivatsa Vaddagiri Cc: Zilvinas Valinskas Signed-off-by: Andrew Morton --- kernel/workqueue.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff -puN kernel/workqueue.c~simplify-cleanup_workqueue_thread-fix kernel/workqueue.c --- a/kernel/workqueue.c~simplify-cleanup_workqueue_thread-fix +++ a/kernel/workqueue.c @@ -330,13 +330,15 @@ static void insert_wq_barrier(struct cpu static int flush_cpu_workqueue(struct cpu_workqueue_struct *cwq) { + int ret; + if (cwq->thread == current) { /* * Probably keventd trying to flush its own queue. So simply run * it by hand rather than deadlocking. */ run_workqueue(cwq); - return 1; + ret = 1; } else { struct wq_barrier barr; int active = 0; @@ -351,8 +353,9 @@ static int flush_cpu_workqueue(struct cp if (active) wait_for_completion(&barr.done); - return active; + ret = active; } + return ret; } /** _