From patchwork Thu Feb 10 22:49:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 12742620 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A93C9C433EF for ; Fri, 11 Feb 2022 00:28:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YDFQvQGJ3YyfEBF7vBVevOBfgZicu++Ag+6rANB/pks=; b=lWvPYo9Up+R6K8 a2C+l8T0BtwZWapaMcCTCQsPy2a/YwqAzTAUG21UgW6hd1ajL6ZpFegT6bmbnOFYd+q0vMpKIy/Qe VF2ZYj9krOU0SNQRIR1wGEXtKMwTyy5FQeBBreUtu8FyGoYA45Guw7vgY1XyIUPCXYH9L2wSb8YcN /U3iZuMjXcUdvfiDxXj7/RudYYnLivwHlnxmiGwEnSV8swZ/CgXNnsAJoFSsP5KDG7bvQbDe9Z/5M 6Fm2e+h2mm2VyVHaO+NCDkx9XpYMEwr+VjLPoP51cu9e+aG+mDFLtodTQH9i5zZByL+P6JbIYlQWO J8Qcv71ZC2SZbK4PyV/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nIJm4-005JMC-FN; Fri, 11 Feb 2022 00:26:56 +0000 Received: from mail-il1-x133.google.com ([2607:f8b0:4864:20::133]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nIJm0-005JLg-NU for linux-arm-kernel@lists.infradead.org; Fri, 11 Feb 2022 00:26:54 +0000 Received: by mail-il1-x133.google.com with SMTP id b5so5723382ile.11 for ; Thu, 10 Feb 2022 16:26:52 -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=1MJU8h6aqi1lREanFgpSWWzF65VdO9IwfkWhBgqaH3Y=; b=mvi1bzuGc+ZCDBoKyIvPuu57FjwX/ZNRRmbHLZvq28NxvswbVJpCtL+TPmWTVqyuNq zHOVncwF2tsmDVT250gY7kLq+jhckLGi7PlKEqS4kMkEFP1KTu7Z7xjiQlYjB2792Sy0 y79LwuSrYF42p6Ksm7buY7+zkijxS7uB/hHR9ElJmFJeaWgz2GF8WWh/oKXQxLhRyRAL sBCNNuvExT46DRyy/8TIoNJF5PD3spUAqOHHh9NO3ZMs/icV5NIDHPE+azUqsowaetzV 7cpHrDo+EZ7zUtQ5l6ZDe3klqtAXMvArBpa4JNsPnSEGr2ueqLcJfFXWmveEcH8M/UrG z/9w== 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=1MJU8h6aqi1lREanFgpSWWzF65VdO9IwfkWhBgqaH3Y=; b=nQK1KmpseJeFWaGrdLlPVCE/bt4dVUJBQsoeDg38kDCeVDFWdORyjV/PLobbg14Rq1 OezcWwlYyUeASPbYA9HcWoA+DKZiZTsAF7Z+SO/2TIJDJ295x2MsK+nTCrQtnxJGIHw9 XnUFzNpRPIXDPTfyizOsLU64VakoD2VWzm7gg6MdyXa3Ups+m5OudzZYZ0PvPhHnZvCk J52bPOCKZ8VgFNSGrqxAtBs+ECHquplFujiAEuDgBJdRRA+h7MVUIAOg3Eew5HjX0+Co K1jg2SGwa+7ah+8TMtAZPO1KwHbk1q93Z/gvGBVggP5+7bE6uGjx6z0m/1umI3fsDd6z iBtQ== X-Gm-Message-State: AOAM531KxRseUw3a8VAuIUpMTnmPtDKhWy3oLW+HUW173OIhVdMJfLN7 jqW3PRhdd8JkJOyRllgzX0c= X-Google-Smtp-Source: ABdhPJw4HRWGUzFWRINnqDSvHJhe4t426yscU51lkh9YSM6/oOmml5+22RpllautY9urs7QLFyNzJQ== X-Received: by 2002:a92:ab01:: with SMTP id v1mr5297485ilh.149.1644539212078; Thu, 10 Feb 2022 16:26:52 -0800 (PST) Received: from localhost ([12.28.44.171]) by smtp.gmail.com with ESMTPSA id y22sm12896727iow.2.2022.02.10.16.26.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 16:26:51 -0800 (PST) From: Yury Norov To: Yury Norov , Andy Shevchenko , Rasmus Villemoes , Andrew Morton , =?utf-8?b?TWljaGHFgiBNaXJvc8WC?= =?utf-8?b?YXc=?= , 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, Li Yang , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 43/49] soc/qman: replace cpumask_weight with cpumask_weight_lt Date: Thu, 10 Feb 2022 14:49:27 -0800 Message-Id: <20220210224933.379149-44-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220210_162652_785160_6A3B4C95 X-CRM114-Status: GOOD ( 12.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org qman_test_stash() calls cpumask_weight() to compare the weight of cpumask with a given number. We can do it more efficiently with cpumask_weight_lt because conditional cpumask_weight may stop traversing the cpumask earlier, as soon as condition is (or can't be) met. Signed-off-by: Yury Norov --- drivers/soc/fsl/qbman/qman_test_stash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/fsl/qbman/qman_test_stash.c b/drivers/soc/fsl/qbman/qman_test_stash.c index b7e8e5ec884c..28b08568a349 100644 --- a/drivers/soc/fsl/qbman/qman_test_stash.c +++ b/drivers/soc/fsl/qbman/qman_test_stash.c @@ -561,7 +561,7 @@ int qman_test_stash(void) { int err; - if (cpumask_weight(cpu_online_mask) < 2) { + if (cpumask_weight_lt(cpu_online_mask, 2)) { pr_info("%s(): skip - only 1 CPU\n", __func__); return 0; }