* [PATCH] workqueue: add printf attribute to __alloc_workqueue()
@ 2024-12-24 4:43 Su Hui
2024-12-24 19:51 ` Tejun Heo
0 siblings, 1 reply; 2+ messages in thread
From: Su Hui @ 2024-12-24 4:43 UTC (permalink / raw)
To: tj, jiangshanlai; +Cc: Su Hui, matthew.brost, linux-kernel, kernel-janitors
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>
---
kernel/workqueue.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 8b07576814a5..0c752812ae09 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -5641,6 +5641,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)
--
2.30.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] workqueue: add printf attribute to __alloc_workqueue()
2024-12-24 4:43 [PATCH] workqueue: add printf attribute to __alloc_workqueue() Su Hui
@ 2024-12-24 19:51 ` Tejun Heo
0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2024-12-24 19:51 UTC (permalink / raw)
To: Su Hui; +Cc: jiangshanlai, matthew.brost, linux-kernel, kernel-janitors
On Tue, Dec 24, 2024 at 12:43:58PM +0800, Su Hui wrote:
> 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>
Applied to wq/for-6.13-fixes.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-12-24 19:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-24 4:43 [PATCH] workqueue: add printf attribute to __alloc_workqueue() Su Hui
2024-12-24 19:51 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox