Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2229396pxb; Sun, 18 Apr 2021 23:59:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlmnoYuhxo97TRQaNhuIBAWYpVUwociXHbuxWbCjOJE4rb4L/LMi6wjN/1nA+rrusNsgIV X-Received: by 2002:a05:6402:4314:: with SMTP id m20mr23253135edc.5.1618815557539; Sun, 18 Apr 2021 23:59:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618815557; cv=none; d=google.com; s=arc-20160816; b=HTXikBDTo2kEz5H67tJw0kHPF5V5w5IMf7hedDtlrTXdCIcP5DTD3r1BCD/p1vMlCN KeorWn1Ecds/9faqs7ypu3eOfMDglbqn2GhQyfPE3wdyB3078IIZUu5k/SEiajksmElC ko6lRXr4eRSCpt78KOPq9QBbYz8yN9/xGsLZaWyr5lNs5Ws05ZpqpbtBd6zRG9VTvBXo yhS1QqHjTCfrXEaVQiChcl4penos0fHn6VRjL+/45yy83CzbBm4sYabQxKSp7V42uss4 XgbLniuyfL92cmsVm/hnekEF3Mebt9pGCVrE5sV2y0stYOVfwujj3PhQ0vXQ/HRFFW1X rmGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=fkV+Pi3iCC1dzpT7aGxNdWglsEiPELgqZ4OhcTsaIeI=; b=pCnY2eri/UPuJILdlnEni2t3dK3W9zSdb8RsYjq5DM58upam0XR2zqH7dgabNgm1KC Bb5MhHc1ubSTzi9Se1MRHM0J4/Q9XJ4h6IYHMSA+sIGloSZyeIQK8A9zUQQcxY78WORO T17p1TYp7x+38zErod3vp3xjU9Ka/lKfM6gKL7mqS+kmJtZR6U8vMmS0/Rvgv+QLecqr T7lVPpXCZrO8zRNi51HkNij+tnDg3jS4pFO8endG0X9d3RkbSEMPT9VxFWWAW+H8x2Yo 25OPpsS4B1s3keku6gsT7spnLqo3uck6hAowveJs2v0uIgG4Njv19i38eJ6iFFey9Pol yEgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=Bad0YWM8; 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 zm9si11043688ejb.180.2021.04.18.23.58.54; Sun, 18 Apr 2021 23:59:17 -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; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=Bad0YWM8; 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 S237300AbhDSG5G (ORCPT + 99 others); Mon, 19 Apr 2021 02:57:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237409AbhDSG5E (ORCPT ); Mon, 19 Apr 2021 02:57:04 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E0A8C061761 for ; Sun, 18 Apr 2021 23:56:33 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id j7so2383216eds.8 for ; Sun, 18 Apr 2021 23:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=fkV+Pi3iCC1dzpT7aGxNdWglsEiPELgqZ4OhcTsaIeI=; b=Bad0YWM8Sq2gg5hwhfWo16oWSJEsZzMf/OlxgaxCaSiPCf6TTqCQUxste2ZO3hNzzy LBMDmWFsA04A46vkWx6IjRUf4Dt9fW5K/6sbfdzOf5xnMWoUgnj3l2Za5HyIk/7znZmy 48qshdzeb0hrJyinncQlUve6dM94hTyXG3sDA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fkV+Pi3iCC1dzpT7aGxNdWglsEiPELgqZ4OhcTsaIeI=; b=GPzbXhA7XZ3VAGxeoNYbYQis2iTWxTIm+LjMMKnWaZgh/YHrt2M1uj9QNx2j9PTtBB 2H62NeNxQSwudSAJtXRfwkNcTNlQgw+897vDjIQx18q/3h8n52MbV6ZGDnngrZlDvUi0 /sB0zQySY/OJW88lkOHltj2HsXTIIJR7PET57vSXABhrxBjX40D64nX/yjezsKK47bsm L7XTnljmylMR30PdCuWDSDJpdpTgakguJdJVp8a4YNB1nHHgwfW6RD6+DQVTf0QM/ROF gv7K9qfJQAUReaXtzYXxe4d69DVexRqN0JpWVakXYLwuDRHdcBugqcEB5J8Fu6bz6/RM UdjQ== X-Gm-Message-State: AOAM533e8qK5xb809Z7kTQBz5a6+8xFYHpLfj3r42oViGK5DXRTioz9z GNgM+OMp2V9n6lAJa13m2EBrsQ== X-Received: by 2002:aa7:d046:: with SMTP id n6mr23100257edo.357.1618815392235; Sun, 18 Apr 2021 23:56:32 -0700 (PDT) Received: from [192.168.1.149] ([80.208.71.248]) by smtp.gmail.com with ESMTPSA id c13sm5829017edw.88.2021.04.18.23.56.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Apr 2021 23:56:31 -0700 (PDT) Subject: Re: [PATCH 1/2] workqueue: Have 'alloc_workqueue()' like macros accept a format specifier To: Christophe JAILLET , 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 References: From: Rasmus Villemoes Message-ID: <92fed8ae-d92e-0732-2dfc-8fc726802a62@rasmusvillemoes.dk> Date: Mon, 19 Apr 2021 08:56:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/04/2021 23.26, Christophe JAILLET wrote: > 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_workqueue(fmt, args...) \ > + alloc_workqueue(fmt, __WQ_LEGACY | WQ_MEM_RECLAIM, 1, ##args) The changes make sense, but are you sure that no current users of those macros have some % character in the string they pass? If all users pass string literals the compiler/0day bot should catch those, but as the very example you give in 2/2 shows, not everybody passes string literals. Maybe git grep would quickly tell that there's only 8 callers and they are all audited quickly or something like that; in that case please include a note to that effect in the commit log. Rasmus