[PATCH 28/53] net: mscc: ocelot: Simplify a create*_workqueue() call

Bart Van Assche posted 53 patches 1 year, 5 months ago
Only 52 patches received!
[PATCH 28/53] net: mscc: ocelot: 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/mscc/ocelot_stats.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/mscc/ocelot_stats.c b/drivers/net/ethernet/mscc/ocelot_stats.c
index c018783757fb..55bb6fac6e36 100644
--- a/drivers/net/ethernet/mscc/ocelot_stats.c
+++ b/drivers/net/ethernet/mscc/ocelot_stats.c
@@ -951,7 +951,6 @@ static int ocelot_prepare_stats_regions(struct ocelot *ocelot)
 
 int ocelot_stats_init(struct ocelot *ocelot)
 {
-	char queue_name[32];
 	int ret;
 
 	ocelot->stats = devm_kcalloc(ocelot->dev,
@@ -960,9 +959,8 @@ int ocelot_stats_init(struct ocelot *ocelot)
 	if (!ocelot->stats)
 		return -ENOMEM;
 
-	snprintf(queue_name, sizeof(queue_name), "%s-stats",
-		 dev_name(ocelot->dev));
-	ocelot->stats_queue = create_singlethread_workqueue(queue_name);
+	ocelot->stats_queue = create_singlethread_workqueue2(
+		"%s-stats", dev_name(ocelot->dev));
 	if (!ocelot->stats_queue)
 		return -ENOMEM;