Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3206217pxb; Mon, 24 Jan 2022 04:59:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJzDIp4QKpQwOPu0IdAoyCF0MgU3ybpYt4uomzGw2PWyh3ycvG2M81/eU/oRewdF0NeL/8Rl X-Received: by 2002:a17:902:e5cd:b0:14b:b3e:cdb6 with SMTP id u13-20020a170902e5cd00b0014b0b3ecdb6mr14030123plf.33.1643029167420; Mon, 24 Jan 2022 04:59:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643029167; cv=none; d=google.com; s=arc-20160816; b=oV7ec6sQpv3LRQtkk0zeYeiLgJixhtQ5YOhEvyT0ClRiindss7ikyqoFhUrIq2xgyi C/ebYt7xDkvYSpo8aUtae9S+zNrGGYBCeO0ATKTTf/oT+y4b5B7azXZ8fELCsr0LH1xP 11BI5nN9f/frUsODI7R9fM1x0AlLm1wliMUQ8bsThtujBN572k2117W1WA6HK1mSBBMt YAYFBKGwV6HujvjhfRThE+cflrYKQfIpHMsXU2tUd8qoc0IgpOSVapk3dTPcvl06pRtj dToXvNwesMxEcTpDFO3dOFo6dxkJ9kR80zTMMAvkki61J5V3ELh7LOvpNazXeDJOeEKQ ADkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=KFAQupawMUi4r4f8s5uSFPc8o5ouF5Iq/cJSWiYfjlY=; b=jz5WJPiJWBvan/+dZ+3pl1SyVG17sFzzLgWO9mVwwwjEoNV5okp3AenCqd0if7UZIk 8Y0F68AtlmbHcf0AaJkcTUgUey0u1gctdorOsWx/0/2D1lKWH69GzRKrZpi6x+uH5skd B2L3ZkyO4C0BvptkdJlqefwefyRVBYKfMY8ExsvXxAaHUibULpFGK3OpK3Mwbijtc6dI bBC1jXqifzf6lbnB3a/EFIOGr2F5nqYBeNEIMKOqjznBph8Wq4o6B9krbgRugNuihF1Y rLXcAV0yPmSzhPouNyFLY+ci3yldESk7W5zVAcmpqDYzi/gCSp86pa1PbrFSEJPxv9Tj Ntcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cYlPo3tk; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t31si13543050pga.276.2022.01.24.04.59.15; Mon, 24 Jan 2022 04:59:27 -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=@kernel.org header.s=k20201202 header.b=cYlPo3tk; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233574AbiAWTNH (ORCPT + 99 others); Sun, 23 Jan 2022 14:13:07 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:60134 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229533AbiAWTNF (ORCPT ); Sun, 23 Jan 2022 14:13:05 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7DC7561044; Sun, 23 Jan 2022 19:13:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 155EBC340E4; Sun, 23 Jan 2022 19:13:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642965184; bh=GJPd6oWq/9UOGgtYOqM5tOECxwhKwp2mxJxFwAAeO2I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cYlPo3tkXmU4veIUKk9yFbqjWQnGwSpfYNOF3mExP8FuaeK6uuIeWVdiLMl328sXN pRvYceR+bcwg5vYMxfH8vFtOrZxydvRoF0z0BkTq9zhllEn2r377Px2zRhqOMJCHdV QZwTibz3nNjoWQxcYjVguWWlxWW2rHpDUeXNmegfAie1B7DaagbqLAuiOAR0Z/peQ5 FYd2HmOgO0THGdp2ATn2x+YoO7Y+LwTTdhjRG08RGej5nRLlezR0OMmbE2B1yXjo/n fROYUoN/6xhpwpyvzzwxXts9SRvVyHPhB7gtaEAEBOXSS9ZQouVpD1eURc5a7LlT19 +fyWifImbo7KA== Date: Sun, 23 Jan 2022 21:13:00 +0200 From: Leon Romanovsky To: Yury Norov Cc: Andy Shevchenko , Rasmus Villemoes , Andrew Morton , =?utf-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , 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, Mike Marciniszyn , Dennis Dalessandro , Jason Gunthorpe , linux-rdma@vger.kernel.org Subject: Re: [PATCH 18/54] drivers/infiniband: replace cpumask_weight with cpumask_empty where appropriate Message-ID: References: <20220123183925.1052919-1-yury.norov@gmail.com> <20220123183925.1052919-19-yury.norov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220123183925.1052919-19-yury.norov@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 23, 2022 at 10:38:49AM -0800, Yury Norov wrote: > drivers/infiniband/hw/hfi1/affinity.c code 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 > --- > drivers/infiniband/hw/hfi1/affinity.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Except that title needs to be: "RDMA/hfi: ....", the change looks ok. Thanks, Reviewed-by: Leon Romanovsky