[PATCH 26/53] net: lan966x: Simplify a create*_workqueue() call

Bart Van Assche posted 53 patches 1 year, 5 months ago
Only 52 patches received!
[PATCH 26/53] net: lan966x: Simplify a create*_workqueue() call
Posted by Bart Van Assche 1 year, 5 months ago
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@acm.org>
---
 drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c b/drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c
index 06811c60d598..69e6bb0cc44d 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c
@@ -701,8 +701,6 @@ void lan966x_stats_get(struct net_device *dev,
 
 int lan966x_stats_init(struct lan966x *lan966x)
 {
-	char queue_name[32];
-
 	lan966x->stats_layout = lan966x_stats_layout;
 	lan966x->num_stats = ARRAY_SIZE(lan966x_stats_layout);
 	lan966x->stats = devm_kcalloc(lan966x->dev, lan966x->num_phys_ports *
@@ -713,9 +711,8 @@ int lan966x_stats_init(struct lan966x *lan966x)
 
 	/* Init stats worker */
 	mutex_init(&lan966x->stats_lock);
-	snprintf(queue_name, sizeof(queue_name), "%s-stats",
-		 dev_name(lan966x->dev));
-	lan966x->stats_queue = create_singlethread_workqueue(queue_name);
+	lan966x->stats_queue = create_singlethread_workqueue2(
+		"%s-stats", dev_name(lan966x->dev));
 	if (!lan966x->stats_queue)
 		return -ENOMEM;