Skip to contentSkip to conversation

kernel/workqueue: Verify alloc_workqueue() argument list consistency

PATCH Applied Bart Van Assche 3 participants 4 messages Mar 19, 2019 – Apr 16, 2019 Workqueue

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel/workqueue: Verify alloc_workqueue() argument list consistency

This patch avoids that gcc reports the following warning when building with W=1:

kernel/workqueue.c:4250:2: warning: function alloc_workqueue might be a candidate for gnu_printf format attribute [-Wsuggest-attribute=format]
vsnprintf(wq->name, sizeof(wq->name), fmt, args);

Cc Lai Jiangshan <[email protected]>
Cc Alexander Duyck <[email protected]>
Cc Dan Williams <[email protected]>
Fixes 669de8bda87b ("kernel/workqueue: Use dynamic lockdep keys for workqueues")
---
 include/linux/workqueue.h | 1 +
 1 file changed, 1 insertion(+)
include/linux/workqueue.h +1 -0
index d59525fca4d3..30737b5183c0 100644
@@ -404,6 +404,7 @@ extern struct workqueue_struct *system_freezable_power_efficient_wq;
  * RETURNS:
  * Pointer to the allocated workqueue on success, %NULL on failure.
  */
+__printf(1, 4)
 struct workqueue_struct *alloc_workqueue(const char *fmt,
 					 unsigned int flags,
 					 int max_active, ...);
Signature · 1 line
2.21.0.155.ge902e9bcae20
#1 lore raw
Quoted 17 lines · Bart Van Assche

This patch avoids that gcc reports the following warning when building with W=1:

kernel/workqueue.c:4250:2: warning: function alloc_workqueue might be a candidate for gnu_printf format attribute [-Wsuggest-attribute=format]> vsnprintf(wq->name, sizeof(wq->name), fmt, args);>

Cc Lai Jiangshan <[email protected]>>Cc: Alexander Duyck <[email protected]>>Cc: Dan Williams <[email protected]>>Fixes: 669de8bda87b ("kernel/workqueue: Use dynamic lockdep keys for workqueues"

include/linux/workqueue.h |1

1 file changed, 1 insertion()
include/linux/workqueue.h +0 -1
index d59525fca4d3..30737b5183c0 100644
--- a/include/linux/workqueue.h

ﯦハ眥맗뾖⧮쟼⢮䪮竧ꇣ为7 @@extern struct workqueue_struct *system_freezable_power_efficient_wq;> *RETURNS:
*Pointer to the allocated workqueue on success, %NULL on failure.
*/
__printf(1, 4)
struct workqueue_struct *alloc_workqueue(const char *fmt,

Quoted 2 lines
					 unsigned int flags,
					 int max_active, ...);

Ping?

Bart.

#2 lore raw
Quoted 30 lines · Bart Van Assche
Quoted 24 lines · Bart Van Assche

This patch avoids that gcc reports the following warning when building with W=1:

kernel/workqueue.c:4250:2: warning: function alloc_workqueue might be a candidate for gnu_printf format attribute [-Wsuggest-attribute=format]
vsnprintf(wq->name, sizeof(wq->name), fmt, args);

Cc Lai Jiangshan <[email protected]>
Cc Alexander Duyck <[email protected]>
Cc Dan Williams <[email protected]>
Fixes 669de8bda87b ("kernel/workqueue: Use dynamic lockdep keys for workqueues")
---
 include/linux/workqueue.h | 1 
 1 file changed, 1 insertion()
include/linux/workqueue.h +0 -1
index d59525fca4d3..30737b5183c0 100644
--- a/include/linux/workqueue.h

ﯦハ眥맗뾖⧮쟼⢮䪮竧ꇣ为 ,7 @@ extern struct workqueue_struct *system_freezable_power_efficient_wq;
* RETURNS:
* Pointer to the allocated workqueue on success, %NULL on failure.
*/
__printf(1, 4)
struct workqueue_struct *alloc_workqueue(const char *fmt,

include/linux/workqueue.h extern struct workqueue_struct *system_freezable_power_efficient_wq; · line 410

Quoted 2 lines
include/linux/workqueue.h +0 -0
 					 unsigned int flags,
 					 int max_active, ...);

Ping?

Quoted 1 line

Bart.

I'm not sure if your Cc list is really the right people to be reviewing the patch. Wouldn't it make more sense to Cc the people who were on the original patch that you are now fixing?

maintainer Applied
#3 lore raw
In reply to Bart Van Assche
Quoted 11 lines · Bart Van Assche

This patch avoids that gcc reports the following warning when building with W=1:

kernel/workqueue.c:4250:2: warning: function alloc_workqueue might be a candidate for gnu_printf format attribute [-Wsuggest-attribute=format]
vsnprintf(wq->name, sizeof(wq->name), fmt, args);

Cc Lai Jiangshan <[email protected]>
Cc Alexander Duyck <[email protected]>
Cc Dan Williams <[email protected]>
Fixes 669de8bda87b ("kernel/workqueue: Use dynamic lockdep keys for workqueues")

Applied to wq/for-5.2.

Thanks.

Signature · 1 line
tejun