Received: by 2002:a05:7412:361b:b0:f9:2edb:3e4d with SMTP id ie27csp43135rdb; Sun, 17 Dec 2023 13:33:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IGHZzvYWxFn+MRrJUwUkOBDEvbZXBewfoKUKmruRrqM2KobRcq0rVoIrabKvdzPl4TFZyj2 X-Received: by 2002:a05:6e02:1986:b0:35d:6619:c5fc with SMTP id g6-20020a056e02198600b0035d6619c5fcmr20017561ilf.43.1702848792543; Sun, 17 Dec 2023 13:33:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702848792; cv=none; d=google.com; s=arc-20160816; b=ZXyI6ns9rvgzqP/X3EKiM+CzdAX9wZ5LsNx+b4Qn0H4dnO6Pn3XK/Wg9Dsu5di43c+ 4CK+9brLhULhcxDtUQKTSbe6S53N2o/O6Y/FydgICG2C5hLcO0h727mwzU+ut3hNePWg H136KxHoH2PRQzpB+MWZ/HRTbPV5gCYahDYHnU0B1B0Y0XRPM46ZLjr3qCSJTDaFKDJD /D7FiRAD1VNgFBblAdHVBPZEMDEkyfTiQbPAo1u/wYHONtl2P0Hfd0jNapbDNC2RvQzG aOrXaCrcVKhN/d/KgLvJAPOuNzx3kfIeh76FTC+aBquZdEOIMaYRFITy0fJH3S5N1kQO 9dYQ== 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=wpzqsz/EY8Rq2EqPBcLuvwzIwmdW6wTukR95VYfZ1CM=; fh=8sOXXBoj0Da8Y0NgieUQXtoCcUc9xSu2Fh93Y7ivrqo=; b=Z7FqVHZcmMz2AqDAoz6Fwo7RobFUmdkoC8Clm6Q+VSmameQsSMfUf/zzWjdLL6o/uQ c9OXJDv/ksTqIbN6RhNMp3kGS2wKCu7B16qgSYinrjnTb+vDkQzAXTmdweMQ8ljwgOwe 5JkB5hmdoiyCPFyb8kplDocUG49N5hQgtGKtfDeEwXyHP6Nl3fS+6th3aPHLoTBsqJyx lq3QizhQ9Rswm1Aiu90MzW2s54hRUEmnDWCPp1Wk4Rn0007IWM1cYleakSb5dEmMxQWq 3hO2ooTyD8q8a4uhSHb4B/8mPlTe7vO6iCDm6zQQXdY3gMVFj+7s4/+rQ5jDN0Swoeo4 r6Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=IgIDyJup; spf=pass (google.com: domain of linux-kernel+bounces-2822-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2822-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id c14-20020a170903234e00b001d1cbbf8ec3si6533583plh.467.2023.12.17.13.33.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 13:33:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2822-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=IgIDyJup; spf=pass (google.com: domain of linux-kernel+bounces-2822-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2822-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 6CB15B21519 for ; Sun, 17 Dec 2023 21:33:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B7B104B123; Sun, 17 Dec 2023 21:32:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IgIDyJup" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (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 9A532495FE; Sun, 17 Dec 2023 21:32:21 +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-qt1-f175.google.com with SMTP id d75a77b69052e-4274fd310c2so15778991cf.3; Sun, 17 Dec 2023 13:32:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702848740; x=1703453540; 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=wpzqsz/EY8Rq2EqPBcLuvwzIwmdW6wTukR95VYfZ1CM=; b=IgIDyJupFClZoNgCuvM1/sUlMo6Cw+hjm7qrbaiZkto2eW3R6F+RUzay1Ql7ldABYp ExVMfZSPIk49fOFoi6NceX2hxbioqcq0bMmo2RpsouhEgTxYdXElaGFlDZoVj5rOq13d Qbgp2zP0wqQWGAXXJCeF8rb9+rrA4Jyua4DgVNRHtpQh5TsJRTOdFLi1VRnyjq5J5rOk QFR1vmvNBGwRHeYSJ8M8WhLOgxehJlBYo1B8XjkKthPDhwPgUd04+ECtff5QU6LTb9YB wZA0JSX/hbWw+Ova5chG1Ln3lVWg+dYihPQb5K5UDWLhRxQJ7STEHAhN2Mr1sh730cjj cQgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702848740; x=1703453540; 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=wpzqsz/EY8Rq2EqPBcLuvwzIwmdW6wTukR95VYfZ1CM=; b=B5+itcPcoYxZqTuxOg5NJtxqMJLNzeG5WynDO6OnZljgwVmp+xc88N+TcejCOU4Zkr FT4vEY7TH2aawsEaAOKZh+0AdtfSj8z4i1FqdWC+fTeNvA0aJ+vjwSM32EI4AEX+Bnhv nDpoZpswlVXzO+QPwi9Apnct+4v5oe55qZIjk8Vfm1yYdX72bMdka7CyWpGUYEWMBD8p uGhYVwxzEe+VTkP7op4ipsdZjGkMhJC3EU1TgFVxK0GY9ElrHBjxX1+7aU4ofDhTbOQ5 Hr71gDm4f1VkO2Z/NBAyc81wWxbGrg3h/nLbqZ1XqdgRNj/J1C955VIMPva+f0Dejvh3 DcQA== X-Gm-Message-State: AOJu0YzqvHoDDsekiC7qm5QzmwyuR2gnZFvt1pKs2nwKz0edjHY+s/pn Sx2AXSJLqvQQkN3Y6twVAf8= X-Received: by 2002:a05:620a:2456:b0:77f:2496:4988 with SMTP id h22-20020a05620a245600b0077f24964988mr20524359qkn.14.1702848740308; Sun, 17 Dec 2023 13:32:20 -0800 (PST) Received: from localhost ([2601:344:8301:57f0:9c41:1dd2:7d5d:e008]) by smtp.gmail.com with ESMTPSA id p191-20020a0de6c8000000b005e3cbaa5ac3sm1564107ywe.105.2023.12.17.13.32.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 13:32:19 -0800 (PST) From: Yury Norov To: Souradeep Chakrabarti , 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/3] cpumask: define cleanup function for cpumasks Date: Sun, 17 Dec 2023 13:32:13 -0800 Message-Id: <20231217213214.1905481-3-yury.norov@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231217213214.1905481-1-yury.norov@gmail.com> References: <20231217213214.1905481-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 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); -- 2.40.1