Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3175084pxb; Mon, 24 Jan 2022 04:14:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwxasYAZXf7lW4yeIkrX0/hPCNIHdGhwy4lqZ+Ai3JcFZPRSQJ2lntTshDFQf+ZEJllVJnN X-Received: by 2002:a63:6ac1:: with SMTP id f184mr7311533pgc.20.1643026470338; Mon, 24 Jan 2022 04:14:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643026470; cv=none; d=google.com; s=arc-20160816; b=di3q1eFl8EskV5k3kmruQcAtWe1skj9FIIF8PrTm9YFgIvCCf81VSm/ztulZ69MlHO eg86VXMwEzZw8VoKUzuK5TURHvJ+n9HFXGKUoRNaO9mGvF/Z3gn0YTg2O8wRVrJBYZ7M eZ7tgqfZu+HHmMw12ap+vk2QbDLdYhaa1rD477O9WccmllV2tacML6cFdMEOpssKTrvf NO17yKbGEQaHR3UOArid5yomBjlVo/fbmPvypswocWRiCGh1gS51Zx9SQDk0WCKXiyYj K4jI7pcvY8ENriwzP0TPG/uf0wrQpX3rcFRwP3CHJ7Yo19ZULB2eAjlFnP9VgkW/ZOZH zFzA== 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=QPKVddXMwyPUGJHCiBL7SqymTrzOfaCYlNdg2PQJoYo=; b=so67KtABaluTHBKVt4MUC3qILI/w95QE6rl5HixOJYOHL9ro4peYOIJsF+G95yq4/Z gwts92eQhmKo7t+U7lNHxufCMkuNPICsU6MoJyWEGSPdjRZbmuzgBm2z8fcPGvBy3AGO d++iswKt9dOFmfzt8fnaovWGI/7d2bhPeKa7su9SiQwglTBVkelnrytlzFEpJ3oqHZ9D 4Qmeu84TXTK9CHl40SzJeU4ajga+wj+9LktWYQc/jB9Wv3DszVDD+PhKT0jq+giIpXrD 5PG8sArAQJLZQB9704bw+AJrrDP700M6Fk+cF69KDvwOkvK8/UR6i9oXcNaDr80oLXvV Lkiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Iuh+2Dtx; 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 z8si12391278pfh.245.2022.01.24.04.14.16; Mon, 24 Jan 2022 04:14:30 -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=Iuh+2Dtx; 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 S239882AbiAWSlv (ORCPT + 99 others); Sun, 23 Jan 2022 13:41:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239880AbiAWSlE (ORCPT ); Sun, 23 Jan 2022 13:41:04 -0500 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B9B0C061762 for ; Sun, 23 Jan 2022 10:41:04 -0800 (PST) Received: by mail-pf1-x435.google.com with SMTP id 128so13765689pfe.12 for ; Sun, 23 Jan 2022 10:41:04 -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=QPKVddXMwyPUGJHCiBL7SqymTrzOfaCYlNdg2PQJoYo=; b=Iuh+2DtxuSEMkkUDpbhNS7s4A4Ryp5/2axsi17WCpZOdLQexzRWGG94IclzD4noeoE m7xu9iXKYySVHL8p04V+gv0xr+CPfTI6cdzYMcx9GRpoKbAgk3QFV7SaqeijUQUhL/f0 z/rGeX05aH+UT1FOD/rswO/+tOuwXagALyijgDkxJpRjDrcl6VxZXY8Mh3x3IQWLEAM1 TeLWq5rkQRmlZOkzw/Xut+RSfu10I5+m/ascmhUvfod6cLzfSCuIO+uY5F9RrHD9j8XF x7e2zB/H0SmJXM4XoVwvO6XSbNtXaLUff0UBYfTH1/hqb/lF8+SDeujHTLbfILlN8FMz y5vA== 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=QPKVddXMwyPUGJHCiBL7SqymTrzOfaCYlNdg2PQJoYo=; b=mwDeq1xJTaSeaNVVtFOIU2NGVB6miFU9Y2SGTTCPzRBC4/Cj9uYbCULIkvivL9rd9t RSfrdZzCTGWSNLDYFhOUo6mkE/i8dbhav2q1wBClz+uTu9mFwcRaqKXFa4yhDJhF9jgn z1BalPF1Xe5didGsR015YeW7C5mKsLQD4+FJr9RcXj6rbnAl97M4ORqHRS+qnBptRx09 AkaYegliJ76p900eia+u+yZBUviYmLpDoEhydec2nRh8xWpNInX12rz3AmDP3bdgbVpC kjEhMFHibUD4YtFfSgnaoVOprd41eZ/fVKhrA9ISbhY+phqCBwADWQ0N9oihB9lQLwNl hseg== X-Gm-Message-State: AOAM530mNNbZf/yr6q7cqP56R8XCiSDFDVvQDUQt04AguZGJ5spw/A7v vlccIqnkN+TbcQ+69VlMDPA= X-Received: by 2002:a62:4c3:0:b0:4c2:7817:7360 with SMTP id 186-20020a6204c3000000b004c278177360mr11430170pfe.24.1642963263649; Sun, 23 Jan 2022 10:41:03 -0800 (PST) Received: from localhost (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id ns21sm4951068pjb.43.2022.01.23.10.41.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 10:41:03 -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, John Stultz , Thomas Gleixner , Stephen Boyd Subject: [PATCH 24/54] time: replace cpumask_weight with cpumask_empty in clocksource.c Date: Sun, 23 Jan 2022 10:38:55 -0800 Message-Id: <20220123183925.1052919-25-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 clocksource_verify_percpu() 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 --- kernel/time/clocksource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index 1cf73807b450..a2fecb4d8c0e 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c @@ -337,7 +337,7 @@ void clocksource_verify_percpu(struct clocksource *cs) cpus_read_lock(); preempt_disable(); clocksource_verify_choose_cpus(); - if (cpumask_weight(&cpus_chosen) == 0) { + if (cpumask_empty(&cpus_chosen)) { preempt_enable(); cpus_read_unlock(); pr_warn("Not enough CPUs to check clocksource '%s'.\n", cs->name); -- 2.30.2