Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1991402pxb; Sun, 18 Apr 2021 14:28:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxitG27UF0Ia4gR/6QThYjs6YadAjbo0PCHqilKY1CuCclbMWmGFlwBDJ7o+ZeDHNi115tj X-Received: by 2002:a17:90b:3b81:: with SMTP id pc1mr20972158pjb.40.1618781331748; Sun, 18 Apr 2021 14:28:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618781331; cv=none; d=google.com; s=arc-20160816; b=j+9BXUAudkS1M6NrpI+3XA3fRRgKu80A4qO41/QsZtidVGIdcFDvZlW6gQq6NagGZq 8TUuKh3OBafMRwVAO5VswCiTLDmJNnBs8Oof+b7hlQxZ8bFWQscoTI9V5G88Mgk0Jg9A D8mqMvJUtgSybiQJt5ksiLek/mjI9/lYwKlBFetOxXCqTwzz8pEAip8ABLr3u/8ey1kB Ul0A8ihYTmR+F0VLLejpPmc+sM5rEI6cImoIG3xfMabjypdkdIYXe5BiZ/SG/DqYc0nn AOwiWH9OWoACievd49Am7nAQXEXgRghiW+HIrcBBkcEca6KQXNi4uwnPSK+OfHqF3QMA W9zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=BqKwnmNYXdzEa0bf733xjgauj1d2gkNepdM2RYfqQuw=; b=c2fj52NzsuA7u7InjHDm6ufzL0A0/tq5zrLcdOTYeJ56Cz7008N7n5bljhxMC3ECPu SWMJXXww42BBPYbV12X5Fsf63dahP8riC0Td7tJzB8dly9gP3Q3I1jEliJOGAyMB1oBP EpdMOICuqb6VvGv8BwHLsntzZaYM6e9TbKgHD8hvF5eHbUvxt5nfCd3+6r3hy+1jmbDW EZ+MkfbaHzg+hNqQJR8JX6Eh8ASacMiOaf28s5GyGkyM2mEPoNnDfO4FxTnjYYU325J2 R3ycebo4bwe98C72CuJT2G11xisyiQKANVdtzLQ0iBY+uQA4Pt2tG3xl6L6oYcX2CBf8 S1Aw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f2si14583144plr.416.2021.04.18.14.28.40; Sun, 18 Apr 2021 14:28:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232806AbhDRV0s (ORCPT + 99 others); Sun, 18 Apr 2021 17:26:48 -0400 Received: from smtp02.smtpout.orange.fr ([80.12.242.124]:36648 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232491AbhDRV0q (ORCPT ); Sun, 18 Apr 2021 17:26:46 -0400 Received: from localhost.localdomain ([86.243.172.93]) by mwinf5d25 with ME id uMSG2400721Fzsu03MSGDU; Sun, 18 Apr 2021 23:26:17 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 18 Apr 2021 23:26:17 +0200 X-ME-IP: 86.243.172.93 From: Christophe JAILLET To: tj@kernel.org, jiangshanlai@gmail.com, saeedm@nvidia.com, leon@kernel.org, davem@davemloft.net, kuba@kernel.org, bvanassche@acm.org Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 1/2] workqueue: Have 'alloc_workqueue()' like macros accept a format specifier Date: Sun, 18 Apr 2021 23:26:16 +0200 Message-Id: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Improve 'create_workqueue', 'create_freezable_workqueue' and 'create_singlethread_workqueue' so that they accept a format specifier and a variable number of arguments. This will put these macros more in line with 'alloc_ordered_workqueue' and the underlying 'alloc_workqueue()' function. This will also allow further code simplification. Suggested-by: Bart Van Assche Signed-off-by: Christophe JAILLET --- include/linux/workqueue.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index d15a7730ee18..145e756ff315 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h @@ -425,13 +425,13 @@ struct workqueue_struct *alloc_workqueue(const char *fmt, alloc_workqueue(fmt, WQ_UNBOUND | __WQ_ORDERED | \ __WQ_ORDERED_EXPLICIT | (flags), 1, ##args) -#define create_workqueue(name) \ - alloc_workqueue("%s", __WQ_LEGACY | WQ_MEM_RECLAIM, 1, (name)) -#define create_freezable_workqueue(name) \ - alloc_workqueue("%s", __WQ_LEGACY | WQ_FREEZABLE | WQ_UNBOUND | \ - WQ_MEM_RECLAIM, 1, (name)) -#define create_singlethread_workqueue(name) \ - alloc_ordered_workqueue("%s", __WQ_LEGACY | WQ_MEM_RECLAIM, name) +#define create_workqueue(fmt, args...) \ + alloc_workqueue(fmt, __WQ_LEGACY | WQ_MEM_RECLAIM, 1, ##args) +#define create_freezable_workqueue(fmt, args...) \ + alloc_workqueue(fmt, __WQ_LEGACY | WQ_FREEZABLE | WQ_UNBOUND | \ + WQ_MEM_RECLAIM, 1, ##args) +#define create_singlethread_workqueue(fmt, args...) \ + alloc_ordered_workqueue(fmt, __WQ_LEGACY | WQ_MEM_RECLAIM, ##args) extern void destroy_workqueue(struct workqueue_struct *wq); -- 2.27.0