Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3176389pxb; Mon, 24 Jan 2022 04:16:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwO0L4SoUhlksodNGja99rIb/PL3NPYSCp+0oP8XkIz86ttFs6/BW5lEnf1K0vqt2fxA6qf X-Received: by 2002:a17:90b:1bc1:: with SMTP id oa1mr1612012pjb.209.1643026560632; Mon, 24 Jan 2022 04:16:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643026560; cv=none; d=google.com; s=arc-20160816; b=jsAlNdCRPZ/dGD+q7/xPGNQcenLq67YcIF5wWCgCcRGjN+ras55BV/aSOP8Q7wdApb JtsQn0ModxDA1dHhjfFlz/q3LCRU/LiZzDN4KvBmEBbVj/p2waEXLBYSfwpBbTDM72A2 dIxTSjXKpNpui9IuyV+m1BnfidryojB1ZI0xPOxQ9CsKDEcE/JPlmBuHxN2G2CYYY99a pzw7NSbaiUIbpby1bcZJWfi79x+VrR7rBzjOf66Q/qXWEwQks09QsCZ0KSQJOodUYX6v zSKA17izplKftklCEHY/gv7eTm8DsJ+Wt4w3KKK1EvKoOGka0H1GMWZUuZHUNs0oWWQR 7kGw== 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=GndtSn11kZKp8gPiAnYtAF0D1ExNO7oxGiuzzMjH66E=; b=BtEdmZplo3tA235gF5O3aa+w0Soa/eMuj8RsAhmkuAUTypG7o1Y5nu1PMbTuTfwnmQ 0+WCLW/DvE8AqybPloIFphWsonb1N6PzC6nhkrWEckTAowrl99YLamiJmk5mK+4X60Dr sTOh88o54GeMPs10UPZAp82Fe+0PRD0Pc57P8/gqkBXU09Xp/PDzXoCyvDs7wI+I90w1 UbGROUh+3pwKr1w4E2h/9s5ss6jFzkokzEVCJg4KPeCU8kDcUZN3I9f6oLfSMk78OlrP j07biA1TxGY/JVkXcvxKISuIHSoCMCsXqeiaE3/g9X0OYqQC3dnQ+xYOhBK6cz/uj2ub 0WZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BCY8BFgQ; 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 r4si1892933pji.6.2022.01.24.04.15.49; Mon, 24 Jan 2022 04:16:00 -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=BCY8BFgQ; 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 S240369AbiAWSnT (ORCPT + 99 others); Sun, 23 Jan 2022 13:43:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239954AbiAWSmK (ORCPT ); Sun, 23 Jan 2022 13:42:10 -0500 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22CDDC06173B; Sun, 23 Jan 2022 10:42:10 -0800 (PST) Received: by mail-pj1-x102c.google.com with SMTP id d15-20020a17090a110f00b001b4e7d27474so14270046pja.2; Sun, 23 Jan 2022 10:42:10 -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=GndtSn11kZKp8gPiAnYtAF0D1ExNO7oxGiuzzMjH66E=; b=BCY8BFgQYJuoXKOVV9p7rADrcLbaR8XwOD2oDh49UsHvgwjsHzRqmVsA58kTvbMC52 8JK4BMrp4oZfp3fXguYb/3lGTDBa79/2a2dIP0EYqWSBlrHq6Q1+lWRisPqcd8kiwU0n NPAE97Kv0/tSwl1szc7CNNNEDeP3vnAGePfb1sRIXNHsvVq//ZdFKZvSrgBsOfnP584S XvRmz/4ORGJRhEHl2lHJCyNgfxlXqpkwXextNWwwAIASqn5NxAhQPNubJtagwZsHxm8g v/3WdP4q4IDpdGmg4yIOJm3LL/ymjzOiEu9TOP39Q8wNTbN+vnWyGAj8b/VaQE3Hwxm5 JWYQ== 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=GndtSn11kZKp8gPiAnYtAF0D1ExNO7oxGiuzzMjH66E=; b=PAH95OcIOJauGinXVTdq3le7/k+ZaeU8AHRhsVmPawHQVJu3i1+K6VUZbi/hzXvqYM ZNpPYRN+ELCzqX7vNJ17I8G1NX3uODS8f0S713Q2wZMO5D9Jq+wWARwStJE0eL6XWOWO JnLb8wrynFEJlxdVBd/Khve57orDBpSR1ClrlSd2zACrUVdLwOXghoXCySLNMVLJ65oa Ye0LnD9vNHNs7GsIGKYWtlAHIcxKPxWD7RQkV2yKUSAAvOxIjviI+ABcSFST81W7DkhU dPddtS43vAA0MJV4m+lG2G7s/NREEnWpOsvPTlUPEiC/QRpDZpl7iuNzzDOIvYp5Y/6I VZig== X-Gm-Message-State: AOAM533Ey+Ojucb3IXUvOW0kP3ZyH+g5WRSmz8DLOVIooKVfIomYhhRk 7KwiTv5vXH3cs8aeenStDLk= X-Received: by 2002:a17:90a:7101:: with SMTP id h1mr9564886pjk.93.1642963329571; Sun, 23 Jan 2022 10:42:09 -0800 (PST) Received: from localhost (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id c8sm14352243pfl.122.2022.01.23.10.42.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 10:42:09 -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, James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org Subject: [PATCH 45/54] scsi: replace cpumask_weight with cpumask_weight_gt Date: Sun, 23 Jan 2022 10:39:16 -0800 Message-Id: <20220123183925.1052919-46-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 lpfc_cpuhp_get_eq() calls cpumask_weight() to compare the weight of cpumask with a given number. We can do it more efficiently with cpumask_weight_gt because conditional cpumask_weight may stop traversing the cpumask earlier, as soon as condition is met. Signed-off-by: Yury Norov --- drivers/scsi/lpfc/lpfc_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index a56f01f659f8..325e9004dacd 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -12643,7 +12643,7 @@ lpfc_cpuhp_get_eq(struct lpfc_hba *phba, unsigned int cpu, * gone offline yet, we need >1. */ cpumask_and(tmp, maskp, cpu_online_mask); - if (cpumask_weight(tmp) > 1) + if (cpumask_weight_gt(tmp, 1)) continue; /* Now that we have an irq to shutdown, get the eq -- 2.30.2