[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240630222904.627462-28-bvanassche@acm.org>
Date: Sun, 30 Jun 2024 15:26:45 -0700
From: Bart Van Assche <bvanassche@....org>
To: Tejun Heo <tj@...nel.org>
Cc: Lai Jiangshan <jiangshanlai@...il.com>,
"Martin K . Petersen" <martin.petersen@...cle.com>,
linux-kernel@...r.kernel.org,
Bart Van Assche <bvanassche@....org>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Lars Povlsen <lars.povlsen@...rochip.com>,
Steen Hegelund <Steen.Hegelund@...rochip.com>,
Daniel Machon <daniel.machon@...rochip.com>,
UNGLinuxDriver@...rochip.com,
"justinstitt@...gle.com" <justinstitt@...gle.com>,
Wei Fang <wei.fang@....com>,
Kees Cook <kees@...nel.org>,
Louis Peens <louis.peens@...igine.com>,
Horatiu Vultur <horatiu.vultur@...rochip.com>,
Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
Subject: [PATCH 27/53] net: sparx5: Simplify the create*_workqueue() calls
Pass a format string to create*_workqueue2() instead of formatting the
workqueue name before create*_workqueue() is called.
Signed-off-by: Bart Van Assche <bvanassche@....org>
---
drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.c | 6 ++----
drivers/net/ethernet/microchip/sparx5/sparx5_main.c | 6 ++----
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.c b/drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.c
index a06dc5a9b355..e15736831747 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.c
@@ -1231,7 +1231,6 @@ const struct ethtool_ops sparx5_ethtool_ops = {
int sparx_stats_init(struct sparx5 *sparx5)
{
- char queue_name[32];
int portno;
sparx5->stats_layout = sparx5_stats_layout;
@@ -1249,9 +1248,8 @@ int sparx_stats_init(struct sparx5 *sparx5)
if (sparx5->ports[portno])
sparx5_config_port_stats(sparx5, portno);
- snprintf(queue_name, sizeof(queue_name), "%s-stats",
- dev_name(sparx5->dev));
- sparx5->stats_queue = create_singlethread_workqueue(queue_name);
+ sparx5->stats_queue = create_singlethread_workqueue2(
+ "%s-stats", dev_name(sparx5->dev));
if (!sparx5->stats_queue)
return -ENOMEM;
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
index b64c814eac11..39c87e85fb8c 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
@@ -596,7 +596,6 @@ static void sparx5_board_init(struct sparx5 *sparx5)
static int sparx5_start(struct sparx5 *sparx5)
{
u8 broadcast[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
- char queue_name[32];
u32 idx;
int err;
@@ -661,9 +660,8 @@ static int sparx5_start(struct sparx5 *sparx5)
/* Init mact_sw struct */
mutex_init(&sparx5->mact_lock);
INIT_LIST_HEAD(&sparx5->mact_entries);
- snprintf(queue_name, sizeof(queue_name), "%s-mact",
- dev_name(sparx5->dev));
- sparx5->mact_queue = create_singlethread_workqueue(queue_name);
+ sparx5->mact_queue =
+ create_singlethread_workqueue2("%s-mact", dev_name(sparx5->dev));
if (!sparx5->mact_queue)
return -ENOMEM;
Powered by blists - more mailing lists