From patchwork Tue Jan 9 10:51:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souradeep Chakrabarti X-Patchwork-Id: 186314 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2411:b0:101:2151:f287 with SMTP id m17csp27518dyi; Tue, 9 Jan 2024 02:53:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IExdYX5W7OsfsFpFZaKiymulIrRS6U8OkFygXeGyCkwhB4XwpCv8hh+bisjH9BnVJerCIH2 X-Received: by 2002:a17:90a:db95:b0:28d:62bd:b53c with SMTP id h21-20020a17090adb9500b0028d62bdb53cmr1535000pjv.95.1704797590393; Tue, 09 Jan 2024 02:53:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704797590; cv=none; d=google.com; s=arc-20160816; b=wGvOW27xJB053USph+b41kqLZdmR1FC6f8bzYVBlINtMe8BN/GzDqB7s6sHBEZ5sQP SnXe3Laf/Kr5WX/WihY0hppILJugnbkAh/c1sahI3gjLsMWGgK7XYV8O1pgCgXlNmRDj eDk7M74PX0s4kUFnZhxg/Tlnv5hBRZhjWD/OdEIRGcptVWst63HVAUoXfJ0+Utkh9owz 90Rx0HkAxdSzDqvXk8Ogd+FSvgvWh6dVTze7CBSK4tZD5IxGCEJGYPZloWof+4WgDeOB kcXRI43oncF3+sRaMPH3HmDILbTVs2AmvEjCsl1VvfVCsU6BlHtIDRAvMdk7Cdt4VM7q ZDuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :dkim-filter; bh=ZPRu3SXlIUr+8W26d0LPvybxMOuIzrvNRUu535P0XZM=; fh=tZ+d+kaZjTJMarg6XpXtL9/z8hMSaArJbuj7ZVP9x6U=; b=YIev025539TfcUuIom3MHtjbUJkcbWa3yqTDecbwQzJqGQsdKZJh1vYzk1Z+Nu03IM l80S3oDAmn9N3DNd6+IAZ22Uk8n1LqIdi2owZz9a0OhoQVE0vFDXbmiY0VP6Z6Ttt8tB fw0/bmSjLDXkFM4SgXnuNGykypx74C6+MFL5Tzb12WF0e55uy6IDIRG9pcsZMlzfPLcg DIKKnjqrkpzQNn9rOOJufv6SDIcQVCeW+InkHvk8NZzo3DjWY/ssYFo56ETgX6IMraXb RMglbipuq2iV1+tvS1ncpztS8Dtn/GNZ9uFId7151G6hV+Bv64TA0/UR2xpP5HBhNvmQ MzpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=ru1tJY2x; spf=pass (google.com: domain of linux-kernel+bounces-20729-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20729-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id z10-20020a17090ad78a00b0028cfa2f740asi6983838pju.12.2024.01.09.02.53.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 02:53:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20729-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=ru1tJY2x; spf=pass (google.com: domain of linux-kernel+bounces-20729-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20729-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3339B287C7D for ; Tue, 9 Jan 2024 10:53:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3AEB338DEC; Tue, 9 Jan 2024 10:51:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="ru1tJY2x" Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 77B003717B; Tue, 9 Jan 2024 10:51:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Received: by linux.microsoft.com (Postfix, from userid 1099) id 323D120B3CC1; Tue, 9 Jan 2024 02:51:33 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 323D120B3CC1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1704797493; bh=ZPRu3SXlIUr+8W26d0LPvybxMOuIzrvNRUu535P0XZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ru1tJY2xhw1R3FF8i2Jn9+MXzu9/ixQze9DSxOEGohcTqRzL4KF1ln5codcIrQK99 de7jWi7E4cKKZHtXz5nfwUvUyCqvAcVI2xzgazGFzzUfDrlQsI4Ww4Z/HsSudPQaFx EbDQOymGQxIkglZjhfqVCW5hx667UmQ5ZCIZ/ns8= From: Souradeep Chakrabarti To: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, longli@microsoft.com, yury.norov@gmail.com, leon@kernel.org, cai.huoqing@linux.dev, ssengar@linux.microsoft.com, vkuznets@redhat.com, tglx@linutronix.de, linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org Cc: schakrabarti@microsoft.com, paulros@microsoft.com Subject: [PATCH 2/4 net-next] cpumask: define cleanup function for cpumasks Date: Tue, 9 Jan 2024 02:51:16 -0800 Message-Id: <1704797478-32377-3-git-send-email-schakrabarti@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1704797478-32377-1-git-send-email-schakrabarti@linux.microsoft.com> References: <1704797478-32377-1-git-send-email-schakrabarti@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787609837807377706 X-GMAIL-MSGID: 1787609837807377706 From: Yury Norov Now we can simplify code that allocates cpumasks for local needs. Signed-off-by: Yury Norov --- include/linux/cpumask.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 228c23eb36d2..1c29947db848 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h @@ -7,6 +7,7 @@ * set of CPUs in a system, one bit position per CPU number. In general, * only nr_cpu_ids (<= NR_CPUS) bits are valid. */ +#include #include #include #include @@ -990,6 +991,8 @@ static inline bool cpumask_available(cpumask_var_t mask) } #endif /* CONFIG_CPUMASK_OFFSTACK */ +DEFINE_FREE(free_cpumask_var, struct cpumask *, if (_T) free_cpumask_var(_T)); + /* It's common to want to use cpu_all_mask in struct member initializers, * so it has to refer to an address rather than a pointer. */ extern const DECLARE_BITMAP(cpu_all_bits, NR_CPUS);