Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3518018pxb; Mon, 24 Jan 2022 11:13:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJx7K8zAufhmsmAAV1be2mxv2cERy7/fci48qOmMW0bhWlNPrfgCKRmdHJpHdD/Bd7fPcEiV X-Received: by 2002:a17:902:e84d:b0:14b:5631:445 with SMTP id t13-20020a170902e84d00b0014b56310445mr4831061plg.21.1643051636978; Mon, 24 Jan 2022 11:13:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643051636; cv=none; d=google.com; s=arc-20160816; b=RNrUl82a+6GPj6YZxTXV03qKDl38Vo6T3V+jYa27HBjB8GZXAuXzR0dvGknfVxhD6i kfQscLc/i4a9IbaZlev8gQx0Zz3YCmYxjWi6pYJQXcNtGk2DPc299vEyVC6/d17Ed3QK N3mJljLYLRwk7KHwm0kmnIpRdryRfoxF6lP9eleHNYv2oWwT72/1V0cAsE1smnX/WV0F Hffc8t0wn9r3/aSsDvKdbLtSutlrKVj5X/sLBol4S5c2b0FpzTLv2W+Ua3cZChi/pT4/ 28308ZrdbcNuEInPJqWU5Qovt/s02cb2wbOQq3BaCmA8dShvqKwZ/g8DJqH0KaEOnKGu 0UzA== 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=rYHuWK5Qi1WJe+lyWjsXdvFID1iuwjPdPSOmLkV/mAs=; b=JY2P7lRn+cZMf9peQEFiHztvYTZpyeIL8IrjnNSGhKr9+2k4bDwHn/inbl9ENgGEIf +a4ncYq4H25jTQ4elduZ+kutPEvXeIT/MsNQApPS4Gb9l1mTnOACVm8+TGOuSObiqQJm +yyk0a8DmFZJzSnWkP766RqCjdhoibq0XxNC5CxxdHvaUAMFAbC6mLsz5kwVnoWSSlaR DRFVAUhdfDagss/o+eNZ1TCKWksyojV7tEVnmJFIVHL9SUCZOuYe/Ab/eXiGgpn6e1O9 2+fvuUDDTppHD5i/XSPr2GevFx3DxPOHOy7+B80HZ9yHNKu1JBMYXFqpowvufcEHteGW d+Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=FAJT+OJk; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a2si15149092pgk.61.2022.01.24.11.13.43; Mon, 24 Jan 2022 11:13:56 -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=@infradead.org header.s=casper.20170209 header.b=FAJT+OJk; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242672AbiAXMtv (ORCPT + 99 others); Mon, 24 Jan 2022 07:49:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242338AbiAXMtv (ORCPT ); Mon, 24 Jan 2022 07:49:51 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA292C06173B for ; Mon, 24 Jan 2022 04:49:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=rYHuWK5Qi1WJe+lyWjsXdvFID1iuwjPdPSOmLkV/mAs=; b=FAJT+OJki2EuUlnC1L7AN/60wF 8h06mWRdsutXmsqM6a2AG6SJl0HmWJ8HuZtpn1gcf+GZ0EEAPXYSiQNKapRsLJ+p5PG+xDJTMSoU4 W9IHbEaxrj3MVUFm9gBdsWZo3qQLmc5MBZolAxmKt56j6yt4EmdcxaEiJ0FkMf56ZIP6aealsUfOG 7IzVUhShFHTIjFG6Z1lSyvJXPTEEhiM3VQeZPUqKPfNZZZ63O24KUzVBXMPhm/4IvfrWRYLkqB+60 KgRwOsUcZU4uSFb+RGSpB2xva35V/7NMvolG0CEkcUvOV/KiAJW/WRRQo3QXsXHzv0Fd/63Zs7nmn 5D6Layww==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nBymu-000doh-K7; Mon, 24 Jan 2022 12:49:37 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id B40F13002A6; Mon, 24 Jan 2022 13:49:35 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8DC822B3559BA; Mon, 24 Jan 2022 13:49:35 +0100 (CET) Date: Mon, 24 Jan 2022 13:49:35 +0100 From: Peter Zijlstra To: Andy Shevchenko Cc: Yury Norov , Rasmus Villemoes , Andrew Morton , =?utf-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , Greg Kroah-Hartman , David Laight , Joe Perches , Dennis Zhou , Emil Renner Berthing , Nicholas Piggin , Matti Vaittinen , Alexey Klimov , linux-kernel@vger.kernel.org Subject: Re: [PATCH 27/54] lib/bitmap: add bitmap_weight_{cmp, eq, gt, ge, lt, le} functions Message-ID: References: <20220123183925.1052919-1-yury.norov@gmail.com> <20220123183925.1052919-28-yury.norov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 24, 2022 at 02:43:30PM +0200, Andy Shevchenko wrote: > It may be other way around: > > if ((unsigned int)num > nbits) Yes, that's my preferred method too :-)