Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3174399pxb; Mon, 24 Jan 2022 04:13:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKlLceOqVxdFrDeZw6cU2tL1ssKfF93uRndO0LWAIY4oLd2ieRL1Iv+yK9QGgERVqKHzph X-Received: by 2002:a17:903:228d:b0:14b:341e:5ffb with SMTP id b13-20020a170903228d00b0014b341e5ffbmr8445655plh.6.1643026415551; Mon, 24 Jan 2022 04:13:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643026415; cv=none; d=google.com; s=arc-20160816; b=AmjVnWVFamXpQqJQpFalphSKA94Ffy+N+f8HbE9LnXm7r5DR517fw0FL5/YptvGva+ xuk4q4AGrU/uYeQF7TGn9bdDpZtt3eppsH07MVY1kHulkHjBUL0dIcTuRurF8i9e7pgZ YMSqGUMnlYX/9PExxEVXBDJ02qpOx29rz8AR1VIq4/DQujD/5b6uhJV+J/rL6VhaXjWz 6bInxvF3gZ4FKR+R42UgW+BcXoJIAU13B4GKidTnL2Su1miGEJasN9QHelJ5xGZTYlrV Xed6BeHZH8hYA4jq+m/zJoJ0fzfZTi5DfDpHvUQdsBJqn1eSLmz1X1hsPtrI7XMCZ9Hr FG0A== 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:to:from :dkim-signature; bh=KWn9RMzA0EUrBxcMa6INAn/WVMY8I9S/vbZ+cvBsro8=; b=RpgQG9KXsjN5Kzxr4UE24LCt+EJRKwt/kHfFBcIPoJJWJq+dtfyjWTExLkqy1AeI2V +AJpQZ0+g6gEuSSkWgEBQqZ93UGvZF8s19tK6hNQtHdkCz69uDILwuYZEcDBWJxEMjmH BiN7okgSIAtMoZQnCL2kHRSJC8l3lcT1HvJHrEL7pyipogtFHMkcXf2caYF4WAfryHZS UE+nWFG30EM6XcohlJHKKZzEyn8VQ+FZPfLp6c41o09LnOgLXW3Xo9GBbhYDDZWV8SkF jcsYP1u3wcE/poXVz9DBAxIcLxb6nDHTjktlApLO+rPYQycNPziVjGMt/6Nf3DxiJtsC 9qrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FEY4hkDC; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u15si12630810pfi.368.2022.01.24.04.13.24; Mon, 24 Jan 2022 04:13:35 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=FEY4hkDC; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239823AbiAWSk5 (ORCPT + 99 others); Sun, 23 Jan 2022 13:40:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239652AbiAWSkm (ORCPT ); Sun, 23 Jan 2022 13:40:42 -0500 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C318BC06175F; Sun, 23 Jan 2022 10:40:32 -0800 (PST) Received: by mail-pg1-x535.google.com with SMTP id v3so7872549pgc.1; Sun, 23 Jan 2022 10:40:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=KWn9RMzA0EUrBxcMa6INAn/WVMY8I9S/vbZ+cvBsro8=; b=FEY4hkDCe+Bsb7dfhGhUPLZa3Mw0PtBQkOfweZG+4g+/AQd4KD6MMYPm2IDe5hdOX+ dkS3dA+wGDjARWWN5zO+u2yDzeYbGG5IN02WiGuELJoafSGPci3NnnLTdh9I8IhX7fti IpZ5jdcKQ0bOMVbXM9UFM6PgySOQy8PN/gr/8ncHmWzSzsjnyDIxkh9Zl6kXWPt+9/JC EfexkcP1u+e9NGbS8fqX0N1v0PcG40IfxWO1qSi6HVNUzwqETgbERn2BGZG4SW3pKOSA LnMk3qdAMIJw9tW9NvT+99rYqWeMvl91UnjK3COqKpRkCgyEYPdAn318dKt59hcjMA5Y Oj+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KWn9RMzA0EUrBxcMa6INAn/WVMY8I9S/vbZ+cvBsro8=; b=sPOPwlZishlFtZKSSIkea6+dos7H9o88E6jperQcZg8nv4sm9ou8fTgspNg5bWBqEx FWO/KVoQSBA1JPII5qHBh+xufOWa15+mh6nRpaHFRk2a1t+XVltkJz+fNRxRx71ucs0e kTbk3tfKeXJhOYVifCIm3hSq80cxnt/h43p969ztzcNYDxbCzumWNxfNVAM9K8KmT7Eh oIr92xPu38rppGv5fGka05S5FuH+9BIFCxqS5nd+6djpM3XpePFqYRluVejFATc8wydN S2EY6apwUsaVWahcQpXf6khTV3mGruSpI/h2gU6jtsT4oJ86jdnuUlkx9KeNnqziMVii zlPw== X-Gm-Message-State: AOAM53031B3Ivz7/kcJqZbIlfGqcBbBJ9kk9/4fRf1wG1FNnJALNKk3z Gj4X017ekgk7bskuKazRFvY= X-Received: by 2002:a63:2d6:: with SMTP id 205mr3524267pgc.64.1642963231993; Sun, 23 Jan 2022 10:40:31 -0800 (PST) Received: from localhost (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id f9sm9845631pgf.94.2022.01.23.10.40.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 10:40:31 -0800 (PST) From: Yury Norov To: Yury Norov , Andy Shevchenko , Rasmus Villemoes , Andrew Morton , =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= , Greg Kroah-Hartman , Peter Zijlstra , David Laight , Joe Perches , Dennis Zhou , Emil Renner Berthing , Nicholas Piggin , Matti Vaittinen , Alexey Klimov , linux-kernel@vger.kernel.org, Geert Uytterhoeven , Yang Guang , linux-ia64@vger.kernel.org Subject: [PATCH 14/54] arch/ia64: replace cpumask_weight with cpumask_empty where appropriate Date: Sun, 23 Jan 2022 10:38:45 -0800 Message-Id: <20220123183925.1052919-15-yury.norov@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220123183925.1052919-1-yury.norov@gmail.com> References: <20220123183925.1052919-1-yury.norov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org setup_arch() calls cpumask_weight() to check if any bit of a given cpumask is set. We can do it more efficiently with cpumask_empty() because cpumask_empty() stops traversing the cpumask as soon as it finds first set bit, while cpumask_weight() counts all bits unconditionally. Signed-off-by: Yury Norov --- arch/ia64/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 5010348fa21b..fd6301eafa9d 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c @@ -572,7 +572,7 @@ setup_arch (char **cmdline_p) #ifdef CONFIG_ACPI_HOTPLUG_CPU prefill_possible_map(); #endif - per_cpu_scan_finalize((cpumask_weight(&early_cpu_possible_map) == 0 ? + per_cpu_scan_finalize((cpumask_empty(&early_cpu_possible_map) ? 32 : cpumask_weight(&early_cpu_possible_map)), additional_cpus > 0 ? additional_cpus : 0); #endif /* CONFIG_ACPI_NUMA */ -- 2.30.2