Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp4160538rdb; Thu, 28 Dec 2023 12:11:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFqnZT+ABYGi0ZFUGlYvu63DvnRZDXBjNvK24CP5vftAZfjNKcyxqGbFEpBKdePSa5xS3Gv X-Received: by 2002:a05:6214:2aa9:b0:67f:1ba0:5bef with SMTP id js9-20020a0562142aa900b0067f1ba05befmr18396729qvb.32.1703794280480; Thu, 28 Dec 2023 12:11:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703794280; cv=none; d=google.com; s=arc-20160816; b=FRMEa7Jtg7Hj7wq+fif3aoKvXzdJDMVCeFLOrbmuKvEeViDsKRL1DOUmkSvePxVLvu a3qSN2gCFePY0nZHlDAmVA/t+8Jrea1KUna1XIbNIDHpIxydrQ23U3AjGyRVxh2CK8RB UKLjsU6Xah8UWM7Hcf75A2j0a4CHGHzvLC4Z0W5m9p0zNRDXtmxOZ1wOJI7S7ubASaD0 gUrrQx1cDgxONlU25ptrZ7+cQvUZTVlPKxngKDtt2/H1RqYKRSCDfdyZLc/zEtaUO2+k Rb3Z0DFAMLZDtfwxrawkFA/Ru30Enwnrfe4nbjFouC6fKJEHMhXDzd1ZYEMX/vEwTFeJ Sk/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=HfZWh6S86hfLbf3ALuySh4PKa92mkoOaYgRP6tzCQaQ=; fh=kL/RA2Gd9NuQcovU0+7My8qgZ6xDrReyLO6zCGgffAQ=; b=GQ7gEZXDHUfkh8QzxbUiGzB+RAkWKW6lHZW2etq1Gq+/4j+Zor25Sd0lF3ho3dCjh0 VbL2ZcTslFXcJQdiPblumdEkzUyYWUbF4XlEoOHBsORic6UUPoJKZ+zBJHvK4iiR/n3P EU2DSK53b2/fuf2EXkRuIGdT4iobss0bhEIfhT4Ezd1IM/9J7TAiIHtI9efrI9ZFHtJP hq4LuaaXKbt3vM56CiVQJMtg7ZaQBB/RHhA3NTS0+/fpyril50oWzzDrvulQO/twBiuM L3fR1MkE8hU51y1BH72qmZIgorA6TmqkHGtaK5JZZmVe0yEMJ8faXe75f0D+w5c22u5B QB7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UzeQM+vF; spf=pass (google.com: domain of linux-kernel+bounces-12848-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12848-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id br9-20020a05620a460900b007815c55ec33si5172035qkb.490.2023.12.28.12.11.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 12:11:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12848-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UzeQM+vF; spf=pass (google.com: domain of linux-kernel+bounces-12848-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12848-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3E3DE1C20F50 for ; Thu, 28 Dec 2023 20:11:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FC3511C9F; Thu, 28 Dec 2023 20:09:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UzeQM+vF" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A7DC11705 for ; Thu, 28 Dec 2023 20:09:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-7b7d55d7717so293128539f.2 for ; Thu, 28 Dec 2023 12:09:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703794188; x=1704398988; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HfZWh6S86hfLbf3ALuySh4PKa92mkoOaYgRP6tzCQaQ=; b=UzeQM+vFVJ1Z33zQAvAHTAHjxGTHwLNIeQX066HcWxc6uwdbYCagg+E8AEPY1hGbpJ /kBzDFdin6YQbFBPIU6J7Zi8XwzZJkYaZK2IBG48MKqhJOC6FVwuJwMoJpkTfPhRzmCu dsUh80Fg0dhuYsSZGOjlRBbUqkhgm4GQg2hzPHBVW79L+xXq2N6srNINPwgr2DyHcyrD tBteBTkeQuvMdrWiZPiNIm/k3WHOEzCz3LuXz0bPj+89T/TpuJQOW69IGtemCht+KNxD va/rA+EQtXBE3dq/GVxsCBsAsSflH4jYmZJH94jo4dUFco1WyLgg5Zwze2LYmcxTfpb2 j12w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703794188; x=1704398988; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HfZWh6S86hfLbf3ALuySh4PKa92mkoOaYgRP6tzCQaQ=; b=ZRYcMNfht/Nbvno9lIxDTh/rWIeZNR929kuUvgJf/OrDJARxoMr4bwViRVe57Io2QN Ctv89QW79lp1e/8thfAWO+xmzNm1AjugBXj2IrbMxMd6Wi832Nn4i9qy4fz96F1Ju0qs nap2M5cK65zy2Qn56tUhGHr/bsluXmbNkhfGkWExJTQy4fxhQ2643qO+gZy0/ZCASUEK co55vlYxyFERy/Bj/nHXvdNASv4d1CKwYm0vRN7dZJbW/7td3DMbGPPdWdCMeVj1Qi+Y rl+2O0rgh/KkVbdojGrGiLtl3Hwv1P9SDDYK+DA7s1hVyfRdbbvodI2rS28b3gWm3s5b lVWg== X-Gm-Message-State: AOJu0YwKJLyjW3Uzevt2O+ywB5300brwQqyYGm4pKvVNW6tjbtnm8VdF ZMvqmgkVtv/N8JTXKnIbtr0= X-Received: by 2002:a05:6e02:1785:b0:35f:e9a7:372a with SMTP id y5-20020a056e02178500b0035fe9a7372amr11090768ilu.47.1703794188311; Thu, 28 Dec 2023 12:09:48 -0800 (PST) Received: from localhost ([2601:344:8301:57f0:967c:a333:ae09:3f60]) by smtp.gmail.com with ESMTPSA id gz17-20020a05690c471100b005e93604a567sm7604354ywb.52.2023.12.28.12.09.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 12:09:47 -0800 (PST) From: Yury Norov To: Andrew Morton , Thomas Gleixner , Ming Lei , linux-kernel@vger.kernel.org Cc: Yury Norov , Andy Shevchenko , Rasmus Villemoes Subject: [PATCH 7/9] cpumask: define cleanup function for cpumasks Date: Thu, 28 Dec 2023 12:09:34 -0800 Message-Id: <20231228200936.2475595-8-yury.norov@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231228200936.2475595-1-yury.norov@gmail.com> References: <20231228200936.2475595-1-yury.norov@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Now we can simplify a 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 73ff2e0ef090..f85515ebcf42 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 @@ -988,6 +989,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); -- 2.40.1