[PATCH 52/53] nfc: nci: Simplify the create*_workqueue() calls

Bart Van Assche posted 53 patches 1 year, 5 months ago
Only 52 patches received!
[PATCH 52/53] nfc: nci: Simplify the create*_workqueue() calls
Posted by Bart Van Assche 1 year, 5 months ago
Pass a format string to create*_workqueue() instead of formatting the
workqueue name before create*_workqueue() is called.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 net/nfc/nci/core.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index f456a5911e7d..4b5cb2017e39 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -1225,29 +1225,28 @@ int nci_register_device(struct nci_dev *ndev)
 {
 	int rc;
 	struct device *dev = &ndev->nfc_dev->dev;
-	char name[32];
 
 	ndev->flags = 0;
 
 	INIT_WORK(&ndev->cmd_work, nci_cmd_work);
-	snprintf(name, sizeof(name), "%s_nci_cmd_wq", dev_name(dev));
-	ndev->cmd_wq = create_singlethread_workqueue(name);
+	ndev->cmd_wq =
+		create_singlethread_workqueue2("%s_nci_cmd_wq", dev_name(dev));
 	if (!ndev->cmd_wq) {
 		rc = -ENOMEM;
 		goto exit;
 	}
 
 	INIT_WORK(&ndev->rx_work, nci_rx_work);
-	snprintf(name, sizeof(name), "%s_nci_rx_wq", dev_name(dev));
-	ndev->rx_wq = create_singlethread_workqueue(name);
+	ndev->rx_wq =
+		create_singlethread_workqueue2("%s_nci_rx_wq", dev_name(dev));
 	if (!ndev->rx_wq) {
 		rc = -ENOMEM;
 		goto destroy_cmd_wq_exit;
 	}
 
 	INIT_WORK(&ndev->tx_work, nci_tx_work);
-	snprintf(name, sizeof(name), "%s_nci_tx_wq", dev_name(dev));
-	ndev->tx_wq = create_singlethread_workqueue(name);
+	ndev->tx_wq =
+		create_singlethread_workqueue2("%s_nci_tx_wq", dev_name(dev));
 	if (!ndev->tx_wq) {
 		rc = -ENOMEM;
 		goto destroy_rx_wq_exit;
Re: [PATCH 52/53] nfc: nci: Simplify the create*_workqueue() calls
Posted by Krzysztof Kozlowski 1 year, 5 months ago
On 01/07/2024 00:27, Bart Van Assche wrote:
> Pass a format string to create*_workqueue() instead of formatting the
> workqueue name before create*_workqueue() is called.
> 
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof