lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 30 Jun 2024 15:27:10 -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>,
	Krzysztof Kozlowski <krzk@...nel.org>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>,
	Ryosuke Yasuoka <ryasuoka@...hat.com>,
	Fedor Pchelkin <pchelkin@...ras.ru>,
	Jeremy Cline <jeremy@...ine.org>,
	Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
Subject: [PATCH 52/53] nfc: nci: Simplify the create*_workqueue() calls

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@....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;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ