]> www.infradead.org Git - users/hch/xfs.git/commitdiff
workqueue: add printf attribute to __alloc_workqueue()
authorSu Hui <suhui@nfschina.com>
Tue, 24 Dec 2024 04:43:58 +0000 (12:43 +0800)
committerTejun Heo <tj@kernel.org>
Tue, 24 Dec 2024 19:50:38 +0000 (09:50 -1000)
Fix a compiler warning with W=1:
kernel/workqueue.c: error:
function ‘__alloc_workqueue’ might be a candidate for ‘gnu_printf’
format attribute[-Werror=suggest-attribute=format]
 5657 |  name_len = vsnprintf(wq->name, sizeof(wq->name), fmt, args);
      |  ^~~~~~~~

Fixes: 9b59a85a84dc ("workqueue: Don't call va_start / va_end twice")
Signed-off-by: Su Hui <suhui@nfschina.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/workqueue.c

index 8336218ec4b8686ad9b71b13dff0f31d12524ada..f7d8fc2045795ddde681631bef003e5332acbcf1 100644 (file)
@@ -5645,6 +5645,7 @@ static void wq_adjust_max_active(struct workqueue_struct *wq)
        } while (activated);
 }
 
+__printf(1, 0)
 static struct workqueue_struct *__alloc_workqueue(const char *fmt,
                                                  unsigned int flags,
                                                  int max_active, va_list args)