From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 863DEC433F5 for ; Thu, 10 Feb 2022 23:25:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345641AbiBJXZD (ORCPT ); Thu, 10 Feb 2022 18:25:03 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:39846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345626AbiBJXZB (ORCPT ); Thu, 10 Feb 2022 18:25:01 -0500 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F009C5F59; Thu, 10 Feb 2022 15:25:01 -0800 (PST) Received: by mail-io1-xd29.google.com with SMTP id n17so9423204iod.4; Thu, 10 Feb 2022 15:25:01 -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=LzHqTGHmePwb1HFpWGG6zaHocU/Khr4mZgW/QCywhtg=; b=KoLazyQAnXN19qSU6nxWkSGgxQn6EmVBtr3qzwTfLRB+aGELf8bGFJhozbakQx1iEk PUxM6wzuTaKRHeTsIZprdOuj6sqTkkrYzDIMDi5E8i7nYXpUhdzxEBwdiYaAvlDeIx1t 96VWVZ+975D/8O5jcAhI/mVegz8gGrktTeM2drEHa2GwMOUrikKDaXM3igq7417lQ3Lj Jlv8mrTTijUYUii2uunxvnpSZ4j+jz0TmvY27ElurL8V93UVXEPTvPxECxkFrNgnQ58g Hz5kP7ojDYf5OqRMRQows6fd45mycpx9LVjVxidT4apDBoraMBdlb0hNqNhzz/hXHq3S uPTw== 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=LzHqTGHmePwb1HFpWGG6zaHocU/Khr4mZgW/QCywhtg=; b=2TI23dzxDGHKXONlvezeJa1UxDOjY1qKuRJNt3DTSURK8tvyvqwo41jgrZ1oOdRUrX cXlitWvv5zi2GksCFT2uSjZ3sIeDVBs/LDe0YnIY76v6sfQhgXOEFnwSoVROSeSH1YUa VNCxxNuepqeDBP3VAFnRv1lP/3hBW5j70l9fZi23DeM7Nr5nwkb9NEtEA5VYwbRiU9v1 b3N/ZJYgew28mmEzLu+E2o+O+P/OBKSogz1mBUxzalGz2bl6151MAmAAQ4i9RYNnqFTq V/tbXkj4viRviboJs7YP9tuPrA39Z2WdHynNkLfwI0qkPWTmNFhoVE4JwtpS1tBnYNPk vnRA== X-Gm-Message-State: AOAM530h3Kg2DMQiaFVPWRItpCgNzm94r92+wXYQGnNEvJKBWryIgCD4 oKVp/evGmKFOB+ED0RN6Xxl+MJC0xwQSOA== X-Google-Smtp-Source: ABdhPJzO7Wh2ZWhAjGAIU3578tz0nBbH5iZ7BL9c68JQSZumb6v58jDO8OJm/FlZeMxdi0nFwkVgBw== X-Received: by 2002:a6b:500a:: with SMTP id e10mr5030200iob.157.1644535501349; Thu, 10 Feb 2022 15:25:01 -0800 (PST) Received: from localhost ([12.28.44.171]) by smtp.gmail.com with ESMTPSA id k10sm487246ilo.8.2022.02.10.15.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 15:25:00 -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 15/49] arch/ia64: replace cpumask_weight with cpumask_empty where appropriate Date: Thu, 10 Feb 2022 14:48:59 -0800 Message-Id: <20220210224933.379149-16-yury.norov@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210224933.379149-1-yury.norov@gmail.com> References: <20220210224933.379149-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.32.0 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yury Norov Date: Thu, 10 Feb 2022 22:48:59 +0000 Subject: [PATCH 15/49] arch/ia64: replace cpumask_weight with cpumask_empty where appropriate Message-Id: <20220210224933.379149-16-yury.norov@gmail.com> List-Id: References: <20220210224933.379149-1-yury.norov@gmail.com> In-Reply-To: <20220210224933.379149-1-yury.norov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 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.32.0