linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: tj@kernel.org, jiangshanlai@gmail.com, saeedm@nvidia.com,
	leon@kernel.org, davem@davemloft.net, kuba@kernel.org,
	bvanassche@acm.org
Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Subject: [PATCH 1/2] workqueue: Have 'alloc_workqueue()' like macros accept a  format specifier
Date: Sun, 18 Apr 2021 23:26:16 +0200	[thread overview]
Message-ID: <ae88f6c2c613d17bc1a56692cfa4f960dbc723d2.1618780558.git.christophe.jaillet@wanadoo.fr> (raw)
In-Reply-To: <cover.1618780558.git.christophe.jaillet@wanadoo.fr>

Improve 'create_workqueue', 'create_freezable_workqueue' and
'create_singlethread_workqueue' so that they accept a format
specifier and a variable number of arguments.

This will put these macros more in line with 'alloc_ordered_workqueue' and
the underlying 'alloc_workqueue()' function.

This will also allow further code simplification.

Suggested-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 include/linux/workqueue.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index d15a7730ee18..145e756ff315 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -425,13 +425,13 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
 	alloc_workqueue(fmt, WQ_UNBOUND | __WQ_ORDERED |		\
 			__WQ_ORDERED_EXPLICIT | (flags), 1, ##args)
 
-#define create_workqueue(name)						\
-	alloc_workqueue("%s", __WQ_LEGACY | WQ_MEM_RECLAIM, 1, (name))
-#define create_freezable_workqueue(name)				\
-	alloc_workqueue("%s", __WQ_LEGACY | WQ_FREEZABLE | WQ_UNBOUND |	\
-			WQ_MEM_RECLAIM, 1, (name))
-#define create_singlethread_workqueue(name)				\
-	alloc_ordered_workqueue("%s", __WQ_LEGACY | WQ_MEM_RECLAIM, name)
+#define create_workqueue(fmt, args...)					\
+	alloc_workqueue(fmt, __WQ_LEGACY | WQ_MEM_RECLAIM, 1, ##args)
+#define create_freezable_workqueue(fmt, args...)			\
+	alloc_workqueue(fmt, __WQ_LEGACY | WQ_FREEZABLE | WQ_UNBOUND |	\
+			WQ_MEM_RECLAIM, 1, ##args)
+#define create_singlethread_workqueue(fmt, args...)			\
+	alloc_ordered_workqueue(fmt, __WQ_LEGACY | WQ_MEM_RECLAIM, ##args)
 
 extern void destroy_workqueue(struct workqueue_struct *wq);
 
-- 
2.27.0


  reply	other threads:[~2021-04-18 21:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-18 21:25 [PATCH 0/2] workqueue: Have 'alloc_workqueue()' like macros accept a format specifier Christophe JAILLET
2021-04-18 21:26 ` Christophe JAILLET [this message]
2021-04-18 23:03   ` [PATCH 1/2] " Bart Van Assche
2021-04-19  6:36     ` Marion et Christophe JAILLET
2021-04-19 20:02       ` Bart Van Assche
2021-04-22 12:24         ` Jason Gunthorpe
2021-04-22 17:12           ` Bart Van Assche
2021-04-22 18:00             ` Leon Romanovsky
2021-04-22 20:30               ` Bart Van Assche
2021-04-23 14:02                 ` Marco Elver
2021-04-23 14:27                 ` Jason Gunthorpe
2021-04-29 10:31           ` Dan Carpenter
2021-04-19  6:56   ` Rasmus Villemoes
2021-04-18 21:26 ` [PATCH 2/2] net/mlx5: Simplify workqueue name creation Christophe JAILLET
2021-04-19 10:22 ` [PATCH 0/2] workqueue: Have 'alloc_workqueue()' like macros accept a format specifier Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ae88f6c2c613d17bc1a56692cfa4f960dbc723d2.1618780558.git.christophe.jaillet@wanadoo.fr \
    --to=christophe.jaillet@wanadoo.fr \
    --cc=bvanassche@acm.org \
    --cc=davem@davemloft.net \
    --cc=jiangshanlai@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@nvidia.com \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).