Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3173343pxb; Mon, 24 Jan 2022 04:12:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwK0jvVpoMaqpMe9I35J2+MpmMMFObo9gX/IXH/fHXBd8OO9vkbx83Pya0vxcn4jb9lRcK+ X-Received: by 2002:a17:902:a601:b0:148:adf2:9725 with SMTP id u1-20020a170902a60100b00148adf29725mr14186846plq.136.1643026320333; Mon, 24 Jan 2022 04:12:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643026320; cv=none; d=google.com; s=arc-20160816; b=cB7HJI+Suvhi11AfZ6tS1ZAmyER8XrR8CwYKOhu55Oe1sCGkbWfaaDgYiW2UBRL6UE Q+NvjPBDl0/hXaWaDwZ3Us6Tvy8cCFb1tvqoAlAwSf4Ua9bJmQAOKeZuaNTB/JDtPbeT YQYaCff2hql+TYgW/7bWda1tChPqjZ51wykmyq6ZFDs1Xq+uvGJG4Cbphqdny4auUwB0 FGPK2LNWl66JmEIwQFGmkFe/4ApJvNsrDQxadF/kUo1eZC+cAhdJm2T4m2lGpQfhxPty 0OgpBTditAFglO0GPJcEGReCHWFmQaLfICW53jEDruAQ7UJP6Kh8NhZJwlntPyjXSkxj Eagg== 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=wuCEC1DNMMa7rD1lJm/KbzT4QoZBEAK+Wq0lZsijL0E=; b=F1bnXGi7yPRmq1THA/cbzPn2fBvV4rn7tjcBlQoBGfCCgQOdGOWh3JwIzF60aTX+iC iX395ASDW0OH0wck6qyYcWZHfbydr/rsLBbZJOCz8s8PICvlA+Q2UA/bBkThY1xLqjfh 2EugUmKDGH3pLz4FL0AbyRp+3ZBSSB0sLpLjK/NcvcG0WNOcOdn29WDi1zPLJOJhcGwJ n5judRHqKFQFHKZ+22U0HrHRipoKp3jZbxhC2ixbAQs/oBdTm+6yCc433RzEpInXSGNk O317aXBvRlph1xhUBcYIeXxsUd10VXPVLdX/LWW0Z/Ak99ut2Ts6Ea3mKqqIlxNzzlpl tfOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=adBm5C46; 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 w7si3702741plg.258.2022.01.24.04.11.48; Mon, 24 Jan 2022 04:12: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=adBm5C46; 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 S239692AbiAWSk0 (ORCPT + 99 others); Sun, 23 Jan 2022 13:40:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239650AbiAWSkO (ORCPT ); Sun, 23 Jan 2022 13:40:14 -0500 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36D4CC061744; Sun, 23 Jan 2022 10:40:14 -0800 (PST) Received: by mail-pl1-x635.google.com with SMTP id y17so3130394plg.7; Sun, 23 Jan 2022 10:40:14 -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=wuCEC1DNMMa7rD1lJm/KbzT4QoZBEAK+Wq0lZsijL0E=; b=adBm5C46WHa+SqaVcfg/e7fBkpNQqkpVo+XFem4Slx6gw952BGG6XbNnKPU+0j7a1z CV9pkYrmO/yS2n03l5PKu9DuG7U8o+2dLXjMRbayjl4y7ovc6A14u23xvv++vlL2RwZb QBOnNfjUAXDNvJ0ils0KPIaveiqyrImHkBU5YO8vJeuD+wXqT7Vd/npI4VLDyp2sIUEh 9TpvMAiivxyIJvIAKnoVKMnfIRBi+0uh53dq6uCARjaZqdpPQgtBg0+xE8okK8qJUw5x GkFNj1C6hy7fktEJHJ4RaFYXgSegQ1d9X2bTja4WR/1sp9o36n4hN/tS1Y2dfuUXihBK KLUw== 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=wuCEC1DNMMa7rD1lJm/KbzT4QoZBEAK+Wq0lZsijL0E=; b=PvBCyqFrXaxokdRwLpkokMr7JOSbDvna2M2wj6PmvX2TPCJxnGuYpU6w0ehERWp+d+ 8LMBiQD6/w3ukOJ9Ceord6VvnBY5P7YSLJYYqbkXuRLEYAKCYzBNVXTsCNIy/y+4zjFt 24s9uOID5oMuc9q9KpzayB3yQOJ+Qll+QgBRq+5GBHK1z/d2Ot3+rFSDmfZEH+iEGv5i bO5vHtc8FouKcMjh4lwlgT25NzJQ2oDCpEsNkiry2x7XmmgBJIMmH/7iuXb4Gy6dOLvE XKIUipJX6UhCs5CYO6TPLhBTG3sTRCcCuCQuIlGuoIXb8TPAKQCQelJsGFEpGk0vdHfs GFIA== X-Gm-Message-State: AOAM531INligb4Xonb5ylcepuLd4QKg1QXjM3ex4iiKfNVYYj/d0nqh0 28fA987bx1SUGJxM13A67SVbMXo/LuM= X-Received: by 2002:a17:903:1c5:b0:14b:f87:bf3b with SMTP id e5-20020a17090301c500b0014b0f87bf3bmr11650785plh.130.1642963213640; Sun, 23 Jan 2022 10:40:13 -0800 (PST) Received: from localhost (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id om12sm5089855pjb.48.2022.01.23.10.40.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 10:40:13 -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, Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Jakub Kicinski , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org Subject: [PATCH 08/54] net: ethernet: replace bitmap_weight with bitmap_empty for intel Date: Sun, 23 Jan 2022 10:38:39 -0800 Message-Id: <20220123183925.1052919-9-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 The ice_vf_has_no_qs_ena() calls bitmap_weight() to check if any bit of a given bitmap is set. It's better to use bitmap_empty() in that case because bitmap_empty() stops traversing the bitmap as soon as it finds first set bit, while bitmap_weight() counts all bits unconditionally. Signed-off-by: Yury Norov --- drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c index 39b80124d282..9dd52aab68cc 100644 --- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c @@ -267,8 +267,8 @@ ice_set_pfe_link(struct ice_vf *vf, struct virtchnl_pf_event *pfe, */ static bool ice_vf_has_no_qs_ena(struct ice_vf *vf) { - return (!bitmap_weight(vf->rxq_ena, ICE_MAX_RSS_QS_PER_VF) && - !bitmap_weight(vf->txq_ena, ICE_MAX_RSS_QS_PER_VF)); + return (bitmap_empty(vf->rxq_ena, ICE_MAX_RSS_QS_PER_VF) && + bitmap_empty(vf->txq_ena, ICE_MAX_RSS_QS_PER_VF)); } /** -- 2.30.2